clavue 8.8.62 → 8.8.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli.js +5 -5
- package/dist/mao-command.js +8 -8
- package/dist/provider-command.js +5 -10
- package/dist/provider-setup.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Clavue v8.8.
|
|
1
|
+
# Clavue v8.8.64
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
@@ -63,7 +63,7 @@ curl -fsSL https://unpkg.com/clavue/install.sh | bash
|
|
|
63
63
|
Install a specific version:
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
curl -fsSL https://unpkg.com/clavue@8.8.
|
|
66
|
+
curl -fsSL https://unpkg.com/clavue@8.8.64/install.sh | bash -s -- 8.8.64
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
## Quick Start
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from "node:module";
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
|
-
// clavue v8.8.
|
|
4
|
+
// clavue v8.8.64 (built from source)
|
|
5
5
|
// Copyright (c) Anthropic PBC. All rights reserved.
|
|
6
6
|
var eLo=Object.create;var lwe=Object.defineProperty;var tLo=Object.getOwnPropertyDescriptor;var nLo=Object.getOwnPropertyNames;var rLo=Object.getPrototypeOf,oLo=Object.prototype.hasOwnProperty;var gwn=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),hwn=e=>{throw TypeError(e)};var s=(e,t)=>lwe(e,"name",{value:t,configurable:!0}),Pn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var S=(e,t)=>()=>(e&&(t=e(e=0)),t);var ye=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bt=(e,t)=>{for(var n in t)lwe(e,n,{get:t[n],enumerable:!0})},_wn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nLo(t))!oLo.call(e,o)&&o!==n&&lwe(e,o,{get:()=>t[o],enumerable:!(r=tLo(t,o))||r.enumerable});return e};var U=(e,t,n)=>(n=e!=null?eLo(rLo(e)):{},_wn(t||!e||!e.__esModule?lwe(n,"default",{value:e,enumerable:!0}):n,e)),Qc=e=>_wn(lwe({},"__esModule",{value:!0}),e);var Ru=(e,t,n)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&hwn("Object expected");var r,o;n&&(r=t[gwn("asyncDispose")]),r===void 0&&(r=t[gwn("dispose")],n&&(o=r)),typeof r!="function"&&hwn("Object not disposable"),o&&(r=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),e.push([n,r,t])}else n&&e.push([n]);return t},Iu=(e,t,n)=>{var r=typeof SuppressedError=="function"?SuppressedError:function(a,l,c,u){return u=Error(c),u.name="SuppressedError",u.error=a,u.suppressed=l,u},o=a=>t=n?new r(a,t,"An error was suppressed during disposal"):(n=!0,a),i=a=>{for(;a=e.pop();)try{var l=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(l).then(i,c=>(o(c),i()))}catch(c){o(c)}if(n)throw t};return i()};function sLo(){this.__data__=[],this.size=0}var ywn,bwn=S(()=>{s(sLo,"listCacheClear");ywn=sLo});function iLo(e,t){return e===t||e!==e&&t!==t}var Ff,cR=S(()=>{s(iLo,"eq");Ff=iLo});function aLo(e,t){for(var n=e.length;n--;)if(Ff(e[n][0],t))return n;return-1}var WY,cwe=S(()=>{cR();s(aLo,"assocIndexOf");WY=aLo});function uLo(e){var t=this.__data__,n=WY(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():cLo.call(t,n,1),--this.size,!0}var lLo,cLo,Swn,Ewn=S(()=>{cwe();lLo=Array.prototype,cLo=lLo.splice;s(uLo,"listCacheDelete");Swn=uLo});function dLo(e){var t=this.__data__,n=WY(t,e);return n<0?void 0:t[n][1]}var vwn,Twn=S(()=>{cwe();s(dLo,"listCacheGet");vwn=dLo});function ALo(e){return WY(this.__data__,e)>-1}var xwn,Cwn=S(()=>{cwe();s(ALo,"listCacheHas");xwn=ALo});function pLo(e,t){var n=this.__data__,r=WY(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var wwn,kwn=S(()=>{cwe();s(pLo,"listCacheSet");wwn=pLo});function bce(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var VY,uwe=S(()=>{bwn();Ewn();Twn();Cwn();kwn();s(bce,"ListCache");bce.prototype.clear=ywn;bce.prototype.delete=Swn;bce.prototype.get=vwn;bce.prototype.has=xwn;bce.prototype.set=wwn;VY=bce});function mLo(){this.__data__=new VY,this.size=0}var Rwn,Iwn=S(()=>{uwe();s(mLo,"stackClear");Rwn=mLo});function fLo(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Pwn,Own=S(()=>{s(fLo,"stackDelete");Pwn=fLo});function gLo(e){return this.__data__.get(e)}var Mwn,Dwn=S(()=>{s(gLo,"stackGet");Mwn=gLo});function hLo(e){return this.__data__.has(e)}var Nwn,Lwn=S(()=>{s(hLo,"stackHas");Nwn=hLo});var _Lo,FGe,J0t=S(()=>{_Lo=typeof global=="object"&&global&&global.Object===Object&&global,FGe=_Lo});var yLo,bLo,Pu,kb=S(()=>{J0t();yLo=typeof self=="object"&&self&&self.Object===Object&&self,bLo=FGe||yLo||Function("return this")(),Pu=bLo});var SLo,Uf,yq=S(()=>{kb();SLo=Pu.Symbol,Uf=SLo});function TLo(e){var t=ELo.call(e,dwe),n=e[dwe];try{e[dwe]=void 0;var r=!0}catch{}var o=vLo.call(e);return r&&(t?e[dwe]=n:delete e[dwe]),o}var Fwn,ELo,vLo,dwe,Uwn,Bwn=S(()=>{yq();Fwn=Object.prototype,ELo=Fwn.hasOwnProperty,vLo=Fwn.toString,dwe=Uf?Uf.toStringTag:void 0;s(TLo,"getRawTag");Uwn=TLo});function wLo(e){return CLo.call(e)}var xLo,CLo,$wn,Hwn=S(()=>{xLo=Object.prototype,CLo=xLo.toString;s(wLo,"objectToString");$wn=wLo});function ILo(e){return e==null?e===void 0?RLo:kLo:jwn&&jwn in Object(e)?Uwn(e):$wn(e)}var kLo,RLo,jwn,np,dw=S(()=>{yq();Bwn();Hwn();kLo="[object Null]",RLo="[object Undefined]",jwn=Uf?Uf.toStringTag:void 0;s(ILo,"baseGetTag");np=ILo});function PLo(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ga,Bf=S(()=>{s(PLo,"isObject");ga=PLo});function LLo(e){if(!ga(e))return!1;var t=np(e);return t==MLo||t==DLo||t==OLo||t==NLo}var OLo,MLo,DLo,NLo,xy,IM=S(()=>{dw();Bf();OLo="[object AsyncFunction]",MLo="[object Function]",DLo="[object GeneratorFunction]",NLo="[object Proxy]";s(LLo,"isFunction");xy=LLo});var FLo,Sce,Z0t=S(()=>{kb();FLo=Pu["__core-js_shared__"],Sce=FLo});function ULo(e){return!!zwn&&zwn in e}var zwn,qwn,Gwn=S(()=>{Z0t();zwn=(function(){var e=/[^.]+$/.exec(Sce&&Sce.keys&&Sce.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();s(ULo,"isMasked");qwn=ULo});function HLo(e){if(e!=null){try{return $Lo.call(e)}catch{}try{return e+""}catch{}}return""}var BLo,$Lo,bq,eOt=S(()=>{BLo=Function.prototype,$Lo=BLo.toString;s(HLo,"toSource");bq=HLo});function KLo(e){if(!ga(e)||qwn(e))return!1;var t=xy(e)?YLo:zLo;return t.test(bq(e))}var jLo,zLo,qLo,GLo,WLo,VLo,YLo,UGe,tOt=S(()=>{IM();Gwn();Bf();eOt();jLo=/[\\^$.*+?()[\]{}|]/g,zLo=/^\[object .+?Constructor\]$/,qLo=Function.prototype,GLo=Object.prototype,WLo=qLo.toString,VLo=GLo.hasOwnProperty,YLo=RegExp("^"+WLo.call(VLo).replace(jLo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");s(KLo,"baseIsNative");UGe=KLo});function QLo(e,t){return e?.[t]}var Wwn,Vwn=S(()=>{s(QLo,"getValue");Wwn=QLo});function XLo(e,t){var n=Wwn(e,t);return UGe(n)?n:void 0}var uR,YY=S(()=>{tOt();Vwn();s(XLo,"getNative");uR=XLo});var JLo,KY,BGe=S(()=>{YY();kb();JLo=uR(Pu,"Map"),KY=JLo});var ZLo,Sq,Awe=S(()=>{YY();ZLo=uR(Object,"create"),Sq=ZLo});function eFo(){this.__data__=Sq?Sq(null):{},this.size=0}var Ywn,Kwn=S(()=>{Awe();s(eFo,"hashClear");Ywn=eFo});function tFo(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Qwn,Xwn=S(()=>{s(tFo,"hashDelete");Qwn=tFo});function sFo(e){var t=this.__data__;if(Sq){var n=t[e];return n===nFo?void 0:n}return oFo.call(t,e)?t[e]:void 0}var nFo,rFo,oFo,Jwn,Zwn=S(()=>{Awe();nFo="__lodash_hash_undefined__",rFo=Object.prototype,oFo=rFo.hasOwnProperty;s(sFo,"hashGet");Jwn=sFo});function lFo(e){var t=this.__data__;return Sq?t[e]!==void 0:aFo.call(t,e)}var iFo,aFo,ekn,tkn=S(()=>{Awe();iFo=Object.prototype,aFo=iFo.hasOwnProperty;s(lFo,"hashHas");ekn=lFo});function uFo(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Sq&&t===void 0?cFo:t,this}var cFo,nkn,rkn=S(()=>{Awe();cFo="__lodash_hash_undefined__";s(uFo,"hashSet");nkn=uFo});function Ece(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var nOt,okn=S(()=>{Kwn();Xwn();Zwn();tkn();rkn();s(Ece,"Hash");Ece.prototype.clear=Ywn;Ece.prototype.delete=Qwn;Ece.prototype.get=Jwn;Ece.prototype.has=ekn;Ece.prototype.set=nkn;nOt=Ece});function dFo(){this.size=0,this.__data__={hash:new nOt,map:new(KY||VY),string:new nOt}}var skn,ikn=S(()=>{okn();uwe();BGe();s(dFo,"mapCacheClear");skn=dFo});function AFo(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var akn,lkn=S(()=>{s(AFo,"isKeyable");akn=AFo});function pFo(e,t){var n=e.__data__;return akn(t)?n[typeof t=="string"?"string":"hash"]:n.map}var QY,pwe=S(()=>{lkn();s(pFo,"getMapData");QY=pFo});function mFo(e){var t=QY(this,e).delete(e);return this.size-=t?1:0,t}var ckn,ukn=S(()=>{pwe();s(mFo,"mapCacheDelete");ckn=mFo});function fFo(e){return QY(this,e).get(e)}var dkn,Akn=S(()=>{pwe();s(fFo,"mapCacheGet");dkn=fFo});function gFo(e){return QY(this,e).has(e)}var pkn,mkn=S(()=>{pwe();s(gFo,"mapCacheHas");pkn=gFo});function hFo(e,t){var n=QY(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var fkn,gkn=S(()=>{pwe();s(hFo,"mapCacheSet");fkn=hFo});function vce(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}var lJ,$Ge=S(()=>{ikn();ukn();Akn();mkn();gkn();s(vce,"MapCache");vce.prototype.clear=skn;vce.prototype.delete=ckn;vce.prototype.get=dkn;vce.prototype.has=pkn;vce.prototype.set=fkn;lJ=vce});function yFo(e,t){var n=this.__data__;if(n instanceof VY){var r=n.__data__;if(!KY||r.length<_Fo-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new lJ(r)}return n.set(e,t),this.size=n.size,this}var _Fo,hkn,_kn=S(()=>{uwe();BGe();$Ge();_Fo=200;s(yFo,"stackSet");hkn=yFo});function Tce(e){var t=this.__data__=new VY(e);this.size=t.size}var s$,mwe=S(()=>{uwe();Iwn();Own();Dwn();Lwn();_kn();s(Tce,"Stack");Tce.prototype.clear=Rwn;Tce.prototype.delete=Pwn;Tce.prototype.get=Mwn;Tce.prototype.has=Nwn;Tce.prototype.set=hkn;s$=Tce});function SFo(e){return this.__data__.set(e,bFo),this}var bFo,ykn,bkn=S(()=>{bFo="__lodash_hash_undefined__";s(SFo,"setCacheAdd");ykn=SFo});function EFo(e){return this.__data__.has(e)}var Skn,Ekn=S(()=>{s(EFo,"setCacheHas");Skn=EFo});function HGe(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new lJ;++t<n;)this.add(e[t])}var XY,fwe=S(()=>{$Ge();bkn();Ekn();s(HGe,"SetCache");HGe.prototype.add=HGe.prototype.push=ykn;HGe.prototype.has=Skn;XY=HGe});function vFo(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var xce,jGe=S(()=>{s(vFo,"arraySome");xce=vFo});function TFo(e,t){return e.has(t)}var Eq,gwe=S(()=>{s(TFo,"cacheHas");Eq=TFo});function wFo(e,t,n,r,o,i){var a=n&xFo,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var A=-1,p=!0,m=n&CFo?new XY:void 0;for(i.set(e,t),i.set(t,e);++A<l;){var f=e[A],h=t[A];if(r)var b=a?r(h,f,A,t,e,i):r(f,h,A,e,t,i);if(b!==void 0){if(b)continue;p=!1;break}if(m){if(!xce(t,function(E,x){if(!Eq(m,x)&&(f===E||o(f,E,n,r,i)))return m.push(x)})){p=!1;break}}else if(!(f===h||o(f,h,n,r,i))){p=!1;break}}return i.delete(e),i.delete(t),p}var xFo,CFo,zGe,rOt=S(()=>{fwe();jGe();gwe();xFo=1,CFo=2;s(wFo,"equalArrays");zGe=wFo});var kFo,Cce,oOt=S(()=>{kb();kFo=Pu.Uint8Array,Cce=kFo});function RFo(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}var wce,qGe=S(()=>{s(RFo,"mapToArray");wce=RFo});function IFo(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var JY,hwe=S(()=>{s(IFo,"setToArray");JY=IFo});function qFo(e,t,n,r,o,i,a){switch(n){case zFo:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case jFo:return!(e.byteLength!=t.byteLength||!i(new Cce(e),new Cce(t)));case MFo:case DFo:case FFo:return Ff(+e,+t);case NFo:return e.name==t.name&&e.message==t.message;case UFo:case $Fo:return e==t+"";case LFo:var l=wce;case BFo:var c=r&PFo;if(l||(l=JY),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=OFo,a.set(e,t);var d=zGe(l(e),l(t),r,o,i,a);return a.delete(e),d;case HFo:if(sOt)return sOt.call(e)==sOt.call(t)}return!1}var PFo,OFo,MFo,DFo,NFo,LFo,FFo,UFo,BFo,$Fo,HFo,jFo,zFo,vkn,sOt,Tkn,xkn=S(()=>{yq();oOt();cR();rOt();qGe();hwe();PFo=1,OFo=2,MFo="[object Boolean]",DFo="[object Date]",NFo="[object Error]",LFo="[object Map]",FFo="[object Number]",UFo="[object RegExp]",BFo="[object Set]",$Fo="[object String]",HFo="[object Symbol]",jFo="[object ArrayBuffer]",zFo="[object DataView]",vkn=Uf?Uf.prototype:void 0,sOt=vkn?vkn.valueOf:void 0;s(qFo,"equalByTag");Tkn=qFo});function GFo(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var fx,vq=S(()=>{s(GFo,"arrayPush");fx=GFo});var WFo,ao,ec=S(()=>{WFo=Array.isArray,ao=WFo});function VFo(e,t,n){var r=t(e);return ao(e)?r:fx(r,n(e))}var GGe,iOt=S(()=>{vq();ec();s(VFo,"baseGetAllKeys");GGe=VFo});function YFo(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}var gx,Tq=S(()=>{s(YFo,"arrayFilter");gx=YFo});function KFo(){return[]}var ZY,kce=S(()=>{s(KFo,"stubArray");ZY=KFo});var QFo,XFo,Ckn,JFo,Rce,WGe=S(()=>{Tq();kce();QFo=Object.prototype,XFo=QFo.propertyIsEnumerable,Ckn=Object.getOwnPropertySymbols,JFo=Ckn?function(e){return e==null?[]:(e=Object(e),gx(Ckn(e),function(t){return XFo.call(e,t)}))}:ZY,Rce=JFo});function ZFo(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Ice,VGe=S(()=>{s(ZFo,"baseTimes");Ice=ZFo});function e1o(e){return e!=null&&typeof e=="object"}var Ka,$f=S(()=>{s(e1o,"isObjectLike");Ka=e1o});function n1o(e){return Ka(e)&&np(e)==t1o}var t1o,aOt,wkn=S(()=>{dw();$f();t1o="[object Arguments]";s(n1o,"baseIsArguments");aOt=n1o});var kkn,r1o,o1o,s1o,Aw,xq=S(()=>{wkn();$f();kkn=Object.prototype,r1o=kkn.hasOwnProperty,o1o=kkn.propertyIsEnumerable,s1o=aOt((function(){return arguments})())?aOt:function(e){return Ka(e)&&r1o.call(e,"callee")&&!o1o.call(e,"callee")},Aw=s1o});function i1o(){return!1}var eK,Pce=S(()=>{s(i1o,"stubFalse");eK=i1o});var Pkn,Rkn,a1o,Ikn,l1o,c1o,mv,i$=S(()=>{kb();Pce();Pkn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rkn=Pkn&&typeof module=="object"&&module&&!module.nodeType&&module,a1o=Rkn&&Rkn.exports===Pkn,Ikn=a1o?Pu.Buffer:void 0,l1o=Ikn?Ikn.isBuffer:void 0,c1o=l1o||eK,mv=c1o});function A1o(e,t){var n=typeof e;return t=t??u1o,!!t&&(n=="number"||n!="symbol"&&d1o.test(e))&&e>-1&&e%1==0&&e<t}var u1o,d1o,$S,a$=S(()=>{u1o=9007199254740991,d1o=/^(?:0|[1-9]\d*)$/;s(A1o,"isIndex");$S=A1o});function m1o(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=p1o}var p1o,l$,cJ=S(()=>{p1o=9007199254740991;s(m1o,"isLength");l$=m1o});function B1o(e){return Ka(e)&&l$(e.length)&&!!tf[np(e)]}var f1o,g1o,h1o,_1o,y1o,b1o,S1o,E1o,v1o,T1o,x1o,C1o,w1o,k1o,R1o,I1o,P1o,O1o,M1o,D1o,N1o,L1o,F1o,U1o,tf,Okn,Mkn=S(()=>{dw();cJ();$f();f1o="[object Arguments]",g1o="[object Array]",h1o="[object Boolean]",_1o="[object Date]",y1o="[object Error]",b1o="[object Function]",S1o="[object Map]",E1o="[object Number]",v1o="[object Object]",T1o="[object RegExp]",x1o="[object Set]",C1o="[object String]",w1o="[object WeakMap]",k1o="[object ArrayBuffer]",R1o="[object DataView]",I1o="[object Float32Array]",P1o="[object Float64Array]",O1o="[object Int8Array]",M1o="[object Int16Array]",D1o="[object Int32Array]",N1o="[object Uint8Array]",L1o="[object Uint8ClampedArray]",F1o="[object Uint16Array]",U1o="[object Uint32Array]",tf={};tf[I1o]=tf[P1o]=tf[O1o]=tf[M1o]=tf[D1o]=tf[N1o]=tf[L1o]=tf[F1o]=tf[U1o]=!0;tf[f1o]=tf[g1o]=tf[k1o]=tf[h1o]=tf[R1o]=tf[_1o]=tf[y1o]=tf[b1o]=tf[S1o]=tf[E1o]=tf[v1o]=tf[T1o]=tf[x1o]=tf[C1o]=tf[w1o]=!1;s(B1o,"baseIsTypedArray");Okn=B1o});function $1o(e){return function(t){return e(t)}}var nf,HP=S(()=>{s($1o,"baseUnary");nf=$1o});var Dkn,_we,H1o,lOt,j1o,HS,uJ=S(()=>{J0t();Dkn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_we=Dkn&&typeof module=="object"&&module&&!module.nodeType&&module,H1o=_we&&_we.exports===Dkn,lOt=H1o&&FGe.process,j1o=(function(){try{var e=_we&&_we.require&&_we.require("util").types;return e||lOt&&lOt.binding&&lOt.binding("util")}catch{}})(),HS=j1o});var Nkn,z1o,dR,Cq=S(()=>{Mkn();HP();uJ();Nkn=HS&&HS.isTypedArray,z1o=Nkn?nf(Nkn):Okn,dR=z1o});function W1o(e,t){var n=ao(e),r=!n&&Aw(e),o=!n&&!r&&mv(e),i=!n&&!r&&!o&&dR(e),a=n||r||o||i,l=a?Ice(e.length,String):[],c=l.length;for(var u in e)(t||G1o.call(e,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||$S(u,c)))&&l.push(u);return l}var q1o,G1o,YGe,cOt=S(()=>{VGe();xq();ec();i$();a$();Cq();q1o=Object.prototype,G1o=q1o.hasOwnProperty;s(W1o,"arrayLikeKeys");YGe=W1o});function Y1o(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||V1o;return e===n}var V1o,c$,Oce=S(()=>{V1o=Object.prototype;s(Y1o,"isPrototype");c$=Y1o});function K1o(e,t){return function(n){return e(t(n))}}var KGe,uOt=S(()=>{s(K1o,"overArg");KGe=K1o});var Q1o,Lkn,Fkn=S(()=>{uOt();Q1o=KGe(Object.keys,Object),Lkn=Q1o});function Z1o(e){if(!c$(e))return Lkn(e);var t=[];for(var n in Object(e))J1o.call(e,n)&&n!="constructor"&&t.push(n);return t}var X1o,J1o,Mce,QGe=S(()=>{Oce();Fkn();X1o=Object.prototype,J1o=X1o.hasOwnProperty;s(Z1o,"baseKeys");Mce=Z1o});function eUo(e){return e!=null&&l$(e.length)&&!xy(e)}var PA,fv=S(()=>{IM();cJ();s(eUo,"isArrayLike");PA=eUo});function tUo(e){return PA(e)?YGe(e):Mce(e)}var Nc,O_=S(()=>{cOt();QGe();fv();s(tUo,"keys");Nc=tUo});function nUo(e){return GGe(e,Nc,Rce)}var ywe,dOt=S(()=>{iOt();WGe();O_();s(nUo,"getAllKeys");ywe=nUo});function iUo(e,t,n,r,o,i){var a=n&rUo,l=ywe(e),c=l.length,u=ywe(t),d=u.length;if(c!=d&&!a)return!1;for(var A=c;A--;){var p=l[A];if(!(a?p in t:sUo.call(t,p)))return!1}var m=i.get(e),f=i.get(t);if(m&&f)return m==t&&f==e;var h=!0;i.set(e,t),i.set(t,e);for(var b=a;++A<c;){p=l[A];var E=e[p],x=t[p];if(r)var T=a?r(x,E,p,t,e,i):r(E,x,p,e,t,i);if(!(T===void 0?E===x||o(E,x,n,r,i):T)){h=!1;break}b||(b=p=="constructor")}if(h&&!b){var R=e.constructor,I=t.constructor;R!=I&&"constructor"in e&&"constructor"in t&&!(typeof R=="function"&&R instanceof R&&typeof I=="function"&&I instanceof I)&&(h=!1)}return i.delete(e),i.delete(t),h}var rUo,oUo,sUo,Ukn,Bkn=S(()=>{dOt();rUo=1,oUo=Object.prototype,sUo=oUo.hasOwnProperty;s(iUo,"equalObjects");Ukn=iUo});var aUo,XGe,$kn=S(()=>{YY();kb();aUo=uR(Pu,"DataView"),XGe=aUo});var lUo,JGe,Hkn=S(()=>{YY();kb();lUo=uR(Pu,"Promise"),JGe=lUo});var cUo,tK,AOt=S(()=>{YY();kb();cUo=uR(Pu,"Set"),tK=cUo});var uUo,dJ,pOt=S(()=>{YY();kb();uUo=uR(Pu,"WeakMap"),dJ=uUo});var jkn,dUo,zkn,qkn,Gkn,Wkn,AUo,pUo,mUo,fUo,gUo,AJ,Rb,u$=S(()=>{$kn();BGe();Hkn();AOt();pOt();dw();eOt();jkn="[object Map]",dUo="[object Object]",zkn="[object Promise]",qkn="[object Set]",Gkn="[object WeakMap]",Wkn="[object DataView]",AUo=bq(XGe),pUo=bq(KY),mUo=bq(JGe),fUo=bq(tK),gUo=bq(dJ),AJ=np;(XGe&&AJ(new XGe(new ArrayBuffer(1)))!=Wkn||KY&&AJ(new KY)!=jkn||JGe&&AJ(JGe.resolve())!=zkn||tK&&AJ(new tK)!=qkn||dJ&&AJ(new dJ)!=Gkn)&&(AJ=s(function(e){var t=np(e),n=t==dUo?e.constructor:void 0,r=n?bq(n):"";if(r)switch(r){case AUo:return Wkn;case pUo:return jkn;case mUo:return zkn;case fUo:return qkn;case gUo:return Gkn}return t},"getTag"));Rb=AJ});function yUo(e,t,n,r,o,i){var a=ao(e),l=ao(t),c=a?Ykn:Rb(e),u=l?Ykn:Rb(t);c=c==Vkn?ZGe:c,u=u==Vkn?ZGe:u;var d=c==ZGe,A=u==ZGe,p=c==u;if(p&&mv(e)){if(!mv(t))return!1;a=!0,d=!1}if(p&&!d)return i||(i=new s$),a||dR(e)?zGe(e,t,n,r,o,i):Tkn(e,t,c,n,r,o,i);if(!(n&hUo)){var m=d&&Kkn.call(e,"__wrapped__"),f=A&&Kkn.call(t,"__wrapped__");if(m||f){var h=m?e.value():e,b=f?t.value():t;return i||(i=new s$),o(h,b,n,r,i)}}return p?(i||(i=new s$),Ukn(e,t,n,r,o,i)):!1}var hUo,Vkn,Ykn,ZGe,_Uo,Kkn,Qkn,Xkn=S(()=>{mwe();rOt();xkn();Bkn();u$();ec();i$();Cq();hUo=1,Vkn="[object Arguments]",Ykn="[object Array]",ZGe="[object Object]",_Uo=Object.prototype,Kkn=_Uo.hasOwnProperty;s(yUo,"baseIsEqualDeep");Qkn=yUo});function Jkn(e,t,n,r,o){return e===t?!0:e==null||t==null||!Ka(e)&&!Ka(t)?e!==e&&t!==t:Qkn(e,t,n,r,Jkn,o)}var nK,bwe=S(()=>{Xkn();$f();s(Jkn,"baseIsEqual");nK=Jkn});function EUo(e,t,n,r){var o=n.length,i=o,a=!r;if(e==null)return!i;for(e=Object(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<i;){l=n[o];var c=l[0],u=e[c],d=l[1];if(a&&l[2]){if(u===void 0&&!(c in e))return!1}else{var A=new s$;if(r)var p=r(u,d,c,e,t,A);if(!(p===void 0?nK(d,u,bUo|SUo,r,A):p))return!1}}return!0}var bUo,SUo,Dce,eWe=S(()=>{mwe();bwe();bUo=1,SUo=2;s(EUo,"baseIsMatch");Dce=EUo});function vUo(e){return e===e&&!ga(e)}var tWe,mOt=S(()=>{Bf();s(vUo,"isStrictComparable");tWe=vUo});function TUo(e){for(var t=Nc(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,tWe(o)]}return t}var Nce,nWe=S(()=>{mOt();O_();s(TUo,"getMatchData");Nce=TUo});function xUo(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var rWe,fOt=S(()=>{s(xUo,"matchesStrictComparable");rWe=xUo});function CUo(e){var t=Nce(e);return t.length==1&&t[0][2]?rWe(t[0][0],t[0][1]):function(n){return n===e||Dce(n,e,t)}}var oWe,gOt=S(()=>{eWe();nWe();fOt();s(CUo,"baseMatches");oWe=CUo});function kUo(e){return typeof e=="symbol"||Ka(e)&&np(e)==wUo}var wUo,Em,AR=S(()=>{dw();$f();wUo="[object Symbol]";s(kUo,"isSymbol");Em=kUo});function PUo(e,t){if(ao(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Em(e)?!0:IUo.test(e)||!RUo.test(e)||t!=null&&e in Object(t)}var RUo,IUo,Lce,sWe=S(()=>{ec();AR();RUo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,IUo=/^\w*$/;s(PUo,"isKey");Lce=PUo});function hOt(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(OUo);var n=s(function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a},"memoized");return n.cache=new(hOt.Cache||lJ),n}var OUo,Yt,As=S(()=>{$Ge();OUo="Expected a function";s(hOt,"memoize");hOt.Cache=lJ;Yt=hOt});function DUo(e){var t=Yt(e,function(r){return n.size===MUo&&n.clear(),r}),n=t.cache;return t}var MUo,Zkn,eRn=S(()=>{As();MUo=500;s(DUo,"memoizeCapped");Zkn=DUo});var NUo,LUo,FUo,iWe,_Ot=S(()=>{eRn();NUo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,LUo=/\\(\\)?/g,FUo=Zkn(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(NUo,function(n,r,o,i){t.push(o?i.replace(LUo,"$1"):r||n)}),t}),iWe=FUo});function UUo(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var Qa,Dh=S(()=>{s(UUo,"arrayMap");Qa=UUo});function rRn(e){if(typeof e=="string")return e;if(ao(e))return Qa(e,rRn)+"";if(Em(e))return nRn?nRn.call(e):"";var t=e+"";return t=="0"&&1/e==-BUo?"-0":t}var BUo,tRn,nRn,Nh,EF=S(()=>{yq();Dh();ec();AR();BUo=1/0,tRn=Uf?Uf.prototype:void 0,nRn=tRn?tRn.toString:void 0;s(rRn,"baseToString");Nh=rRn});function $Uo(e){return e==null?"":Nh(e)}var Js,iA=S(()=>{EF();s($Uo,"toString");Js=$Uo});function HUo(e,t){return ao(e)?e:Lce(e,t)?[e]:iWe(Js(e))}var hx,wq=S(()=>{ec();sWe();_Ot();iA();s(HUo,"castPath");hx=HUo});function zUo(e){if(typeof e=="string"||Em(e))return e;var t=e+"";return t=="0"&&1/e==-jUo?"-0":t}var jUo,M_,vF=S(()=>{AR();jUo=1/0;s(zUo,"toKey");M_=zUo});function qUo(e,t){t=hx(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[M_(t[n++])];return n&&n==r?e:void 0}var pR,rK=S(()=>{wq();vF();s(qUo,"baseGet");pR=qUo});function GUo(e,t,n){var r=e==null?void 0:pR(e,t);return r===void 0?n:r}var oK,Fce=S(()=>{rK();s(GUo,"get");oK=GUo});function WUo(e,t){return e!=null&&t in Object(e)}var oRn,sRn=S(()=>{s(WUo,"baseHasIn");oRn=WUo});function VUo(e,t,n){t=hx(t,e);for(var r=-1,o=t.length,i=!1;++r<o;){var a=M_(t[r]);if(!(i=e!=null&&n(e,a)))break;e=e[a]}return i||++r!=o?i:(o=e==null?0:e.length,!!o&&l$(o)&&$S(a,o)&&(ao(e)||Aw(e)))}var aWe,yOt=S(()=>{wq();xq();ec();a$();cJ();vF();s(VUo,"hasPath");aWe=VUo});function YUo(e,t){return e!=null&&aWe(e,t,oRn)}var sK,Uce=S(()=>{sRn();yOt();s(YUo,"hasIn");sK=YUo});function XUo(e,t){return Lce(e)&&tWe(t)?rWe(M_(e),t):function(n){var r=oK(n,e);return r===void 0&&r===t?sK(n,e):nK(t,r,KUo|QUo)}}var KUo,QUo,lWe,bOt=S(()=>{bwe();Fce();Uce();sWe();mOt();fOt();vF();KUo=1,QUo=2;s(XUo,"baseMatchesProperty");lWe=XUo});function JUo(e){return e}var aA,gv=S(()=>{s(JUo,"identity");aA=JUo});function ZUo(e){return function(t){return t?.[e]}}var Bce,cWe=S(()=>{s(ZUo,"baseProperty");Bce=ZUo});function eBo(e){return function(t){return pR(t,e)}}var iRn,aRn=S(()=>{rK();s(eBo,"basePropertyDeep");iRn=eBo});function tBo(e){return Lce(e)?Bce(M_(e)):iRn(e)}var $ce,Swe=S(()=>{cWe();aRn();sWe();vF();s(tBo,"property");$ce=tBo});function nBo(e){return typeof e=="function"?e:e==null?aA:typeof e=="object"?ao(e)?lWe(e[0],e[1]):oWe(e):$ce(e)}var Zr,ul=S(()=>{gOt();bOt();gv();ec();Swe();s(nBo,"baseIteratee");Zr=nBo});function rBo(e,t){for(var n,r=-1,o=e.length;++r<o;){var i=t(e[r]);i!==void 0&&(n=n===void 0?i:n+i)}return n}var Hce,uWe=S(()=>{s(rBo,"baseSum");Hce=rBo});function oBo(e,t){return e&&e.length?Hce(e,Zr(t,2)):0}var iK,SOt=S(()=>{ul();uWe();s(oBo,"sumBy");iK=oBo});function uBo(e){return String(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dBo(e){return e.map(t=>({label:t,regex:new RegExp(`(?:^|\\s)${uBo(t).replace(/\\ /g,"\\s+")}(?=\\s|$)`,"i")}))}function ABo(e){return e.map(t=>({label:t,compactPhrase:t.replace(/\s+/g,"")}))}function pBo(e){return e.map(t=>({label:t,word:t}))}function mBo(e){return e.map(t=>t instanceof RegExp?{label:t.source,regex:t}:t)}function aK(e){return{exactMatches:e.exactMatches??null,englishPhrases:dBo(e.englishPhrases??[]),compactPhrases:ABo(e.compactPhrases??[]),englishWords:pBo(e.englishWords??[]),regexes:mBo(e.regexes??[])}}function fBo(e){return String(e||"").normalize("NFKC").replace(/[\u2018\u2019\u201B\u2032`]/g,"'").replace(/[,。!?;:、()【】〔〕[]{}「」『』《》〈〉“”"~!?,;:()[\]{}<>/\\|]+/g," ").replace(/[_=-]+/g," ").replace(/\s+/g," ").trim().toLowerCase()}function gBo(e){return e.replace(/\s+/g,"")}function hBo(e){return new Set(e.match(aBo)??[])}function _Bo(e){let t=[];return iBo.test(e)&&t.push("en"),sBo.test(e)&&t.push("zh"),t}function yBo(e,{rawInput:t,normalized:n,compact:r,words:o}){let i=lRn[e],a=[],l=0;function c(u,d){a.includes(u)||(a.push(u),l=Math.min(lBo,l+d))}s(c,"record"),i.exactMatches?.has(n)&&c(`exact:${n}`,10);for(let u of i.englishPhrases)u.regex.test(n)&&c(`phrase:${u.label}`,6);for(let u of i.compactPhrases)u.compactPhrase&&r.includes(u.compactPhrase)&&c(`phrase:${u.label}`,6);for(let u of i.englishWords)o.has(u.word)&&c(`word:${u.label}`,3);for(let u of i.regexes)(u.regex.test(t)||u.regex.test(n))&&c(`regex:${u.label}`,7);return{score:l,matches:a}}function uRn(e){let t=String(e||""),n=fBo(t),r=gBo(n),o=hBo(n),i=_Bo(t),a={},l={};for(let c of Object.keys(lRn)){let u=yBo(c,{rawInput:t,normalized:n,compact:r,words:o});a[c]=u.score,l[c]=u.matches}return{input:t,normalized:n,compact:r,languages:i,scoreBySignal:a,matchedSignals:l}}function bBo(e){let t=[["review",e.reviewIntent??0],["research",e.researchIntent??0],["investigate",e.diagnosticIntent??0]];return t.sort((n,r)=>r[1]-n[1]),t[0]?.[1]>0?t[0][0]:null}function dWe(e){return uRn(e).scoreBySignal.continuationIntent>=7}function SBo(e){return typeof e=="string"?e:Array.isArray(e)?e.filter(t=>t?.type==="text"&&typeof t.text=="string").map(t=>t.text).join(`
|
|
7
7
|
`):""}function EBo(e){if(!e||typeof e!="object")return!1;if(e.type==="user"&&typeof e.planContent=="string"&&e.planContent.trim())return!0;if(e.type==="attachment"){let t=e.attachment;if(!t||typeof t!="object")return!1;switch(t.type){case"plan_mode_exit":return t.planExists===!0;case"plan_mode_reentry":case"plan_file_reference":return!0;default:return!1}}return!1}function vBo(e){if(!e||typeof e!="object"||e.type!=="user"&&e.type!=="system")return!1;let t=SBo(e.message?.content).trim();return t?/##\s+Exited Plan Mode\b/i.test(t)||/##\s+Re-entering Plan Mode\b/i.test(t)||/A plan file exists from plan mode at:/i.test(t):!1}function AWe(e){return Array.isArray(e)?e.some(t=>EBo(t)||vBo(t)):!1}function Ewe(e,t={}){let n=uRn(e),r=n.scoreBySignal.continuationIntent??0,o=n.scoreBySignal.directExecutionIntent??0,i=n.scoreBySignal.implementationIntent??0,a=n.scoreBySignal.explicitPlanIntent??0,l=bBo(n.scoreBySignal),c=r>=7,u=o>=7,d=i>=3,A=a>=7,p=(n.scoreBySignal.planRevisionIntent??0)>=7,m=(n.scoreBySignal.reviewIntent??0)>=5,f=(n.scoreBySignal.researchIntent??0)>=5,h=(n.scoreBySignal.diagnosticIntent??0)>=5,E=!!t?.hasPlanContext&&!A&&!p&&!m&&!f&&!h,x="general",T="reply_normally",R=!1;return u||c?(x="execute",T="execute_now"):A||p?(x="plan",T="plan_first",R=d||o>0):l&&!d?(x=l,T="inspect_first"):(d||E)&&(x="execute",T="execute_now"),{input:n.input,normalized:n.normalized,compactNormalized:n.compact,languages:n.languages,primaryIntent:x,executionMode:T,isContinuation:c,wantsExecutionAfterPlan:R,shouldEnterPlanMode:T==="plan_first",shouldBlockPlanMode:T==="inspect_first",usesExistingPlanExecutionDefault:E,signals:{continuationIntent:c,directExecutionIntent:u,implementationIntent:d,explicitPlanIntent:A,planRevisionIntent:p,diagnosticIntent:h,researchIntent:f,reviewIntent:m},scores:n.scoreBySignal,matchedSignals:n.matchedSignals}}function dRn(e){return!!e?.shouldBlockPlanMode}function ARn({input:e,intent:t,hasPlanContext:n=!1}={}){let r=t??Ewe(e,{hasPlanContext:n});if(!r||r.executionMode==="reply_normally")return null;if(r.executionMode==="execute_now")return["User intent for this turn: execute now.",r.usesExistingPlanExecutionDefault?"A plan already exists for this session. Unless the user explicitly asks to revise the plan or document, treat the next turn as implementation rather than another planning cycle.":r.isContinuation?"This is a continuation request. Resume the active repository task instead of restarting discovery.":"The user wants implementation progress rather than a plan-only response.","Use tools to inspect, edit, or run the next concrete reversible step. Keep planning brief and subordinate to execution.","Do not consume the turn with a status-only promise when execution is already possible."].join(`
|
|
@@ -4919,7 +4919,7 @@ ${c3(n)}
|
|
|
4919
4919
|
**Environment Info**
|
|
4920
4920
|
- Platform: ${Hn.platform}
|
|
4921
4921
|
- Terminal: ${Hn.terminal}
|
|
4922
|
-
- Version: 8.8.
|
|
4922
|
+
- Version: 8.8.64
|
|
4923
4923
|
- Feedback ID: ${e}
|
|
4924
4924
|
|
|
4925
4925
|
**Errors**
|
|
@@ -5990,7 +5990,7 @@ At the end of each completed round, briefly state:
|
|
|
5990
5990
|
`)}function u$i(e){if(!e||typeof e!="object")return typeof e=="string"?e:"";let t=e;if(typeof t.stdout=="string"){let r=typeof t.stderr=="string"?t.stderr:"";return t.stdout+(r?`
|
|
5991
5991
|
`+r:"")}if(t.file&&typeof t.file=="object"&&typeof t.file.content=="string")return t.file.content;let n=[];for(let r of["content","output","result","text","message"]){let o=t[r];typeof o=="string"&&n.push(o)}for(let r of["filenames","lines","results"]){let o=t[r];Array.isArray(o)&&o.every(i=>typeof i=="string")&&n.push(o.join(`
|
|
5992
5992
|
`))}return n.join(`
|
|
5993
|
-
`)}var Tao,xao,Cao,Yhn=S(()=>{Ln();Tao="</system-reminder>",xao=new Set([e9,Jv]),Cao=new WeakMap;s(nwt,"renderableSearchText");s(l$i,"computeSearchText");s(c$i,"toolUseSearchText");s(u$i,"toolResultSearchText")});function A$i(e){let t=process.env.DEMO_VERSION?"/code/claude":Ki(e?.isRemoteMode&&e.remoteCwd?e.remoteCwd:_t()),n=OOt();return n?`${t} in ${n.replace(/^https?:\/\//,"")}`:t}function kao(e){return e>=70?"horizontal":"compact"}function Rao(e,t,n){if(t==="horizontal"){let o=n,i=Khn+owt+rwt+o,a=e-i,l=Math.max(30,a),c=Math.min(o+l+rwt+owt,e-Khn);return c<o+l+rwt+owt&&(l=c-o-rwt-owt),{leftWidth:o,rightWidth:l,totalWidth:c}}let r=Math.min(e-Khn,wao+20);return{leftWidth:r,rightWidth:r,totalWidth:r}}function Iao(e,t,n){let r=Math.max(en(e),en(Trt),en(t),en(n),20);return Math.min(r+4,wao)}function iwt(e){return!e||e.length>d$i?"\u51C6\u5907\u597D\u4E86\u5C31\u5F00\u59CB\u3002":`\u6B22\u8FCE\u56DE\u6765\uFF0C${e}\u3002`}function uje(e,t){if(en(e)<=t)return e;let n="/",r="\u2026",o=1,i=1,a=e.split(n),l=a[0]||"",c=a[a.length-1]||"",u=en(l),d=en(c);if(a.length===1)return Ws(e,t);if(l===""&&o+i+d>=t)return`${n}${Ws(c,Math.max(1,t-i))}`;if(l!==""&&o*2+i+d>=t)return`${r}${n}${Ws(c,Math.max(1,t-o-i))}`;if(a.length===2){let m=t-o-i-d;return`${$J(l,m)}${r}${n}${c}`}let A=t-u-d-o-2*i;if(A<=0){let m=Math.max(0,t-d-o-2*i);return`${$J(l,m)}${n}${r}${n}${c}`}let p=[];for(let m=a.length-2;m>0;m--){let f=a[m];if(f&&en(f)+i<=A)p.unshift(f),A-=en(f)+i;else break}return p.length===0?`${l}${n}${r}${n}${c}`:`${l}${n}${r}${n}${p.join(n)}${n}${c}`}async function Pao(){if(swt)return swt;let e=Et();return swt=dSe(10).then(t=>(cje=t.filter(n=>{if(n.isSidechain||n.sessionId===e||n.summary?.includes("I apologize"))return!1;let r=n.summary&&n.summary!=="No prompt",o=n.firstPrompt&&n.firstPrompt!=="No prompt";return r||o}).slice(0,3),cje)).catch(()=>(cje=[],cje)),swt}function Oao(){return cje}function awt(e){let t=process.env.DEMO_VERSION??bD,n=A$i(e),r=to()?Rst():"Usage-based API billing",o=yr().agent;return{version:t,cwd:n,billingType:r,agentName:o}}function Mao(e){return e?.isRemoteMode&&e.remoteCwd?e.remoteCwd:_t()}function Dao(e,t,n){return en(e)+3+en(t)>n?{shouldSplit:!0,truncatedModel:ka(e,n),truncatedBilling:ka(t,n)}:{shouldSplit:!1,truncatedModel:ka(e,Math.max(n-en(t)-3,10)),truncatedBilling:t}}function Nao(e){if(process.env.USER_TYPE==="ant")return[];let t=qCt();if(!t)return[];let n;try{n=GCt(t)}catch{return[]}let r=[],o=Object.keys(n).sort((i,a)=>Kw(i,a)?-1:1).slice(0,3);for(let i of o){let a=n[i];a&&r.push(...a)}return r.slice(0,e)}var wao,d$i,Khn,rwt,owt,cje,swt,dje=S(()=>{St();K5();Vi();Cr();xr();oi();kr();wTe();Qw();ys();Mn();wao=50,d$i=20,Khn=4,rwt=1,owt=2;s(A$i,"getRemoteAwareDisplayPath");s(kao,"getLayoutMode");s(Rao,"calculateLayoutDimensions");s(Iao,"calculateOptimalLeftWidth");s(iwt,"formatWelcomeMessage");s(uje,"truncatePath");cje=[],swt=null;s(Pao,"getRecentActivity");s(Oao,"getRecentActivitySync");s(awt,"getLogoDisplayData");s(Mao,"getStatusLineDisplayCwd");s(Dao,"formatModelAndBilling");s(Nao,"getRecentReleaseNotesSync")});function $ie({pose:e="default"}={}){let t=p$i[e];return(0,IL.jsxs)(O,{flexDirection:"column",children:[(0,IL.jsx)(_,{color:"clawd_body",children:t.top}),(0,IL.jsxs)(_,{children:[(0,IL.jsx)(_,{color:"clawd_body",children:t.middle.left}),(0,IL.jsx)(_,{color:"clawd_background",backgroundColor:"clawd_body",children:t.middle.center}),(0,IL.jsx)(_,{color:"clawd_body",children:t.middle.right})]}),(0,IL.jsxs)(_,{children:[(0,IL.jsx)(_,{color:"clawd_body",children:t.bottom.left}),(0,IL.jsx)(_,{backgroundColor:"clawd_body",children:" ".repeat(5)}),(0,IL.jsx)(_,{color:"clawd_body",children:t.bottom.right})]})]})}var IL,p$i,lwt=S(()=>{Xe();IL=U(Z()),p$i={default:{top:" /\\_/\\ ",middle:{left:"(",center:" o.o ",right:")"},bottom:{left:"/",right:"\\"}},"look-left":{top:" /\\_/\\ ",middle:{left:"(",center:" O.o ",right:")"},bottom:{left:"/",right:"\\"}},"look-right":{top:" /\\_/\\ ",middle:{left:"(",center:" o.O ",right:")"},bottom:{left:"/",right:"\\"}},"arms-up":{top:" /\\_/\\ ",middle:{left:"\\",center:" o.o ",right:"/"},bottom:{left:"/",right:"\\"}}};s($ie,"Clawd")});function Lao(e){let{title:t,lines:n,footer:r,emptyMessage:o,customContent:i}=e,a=en(t);if(i!==void 0)a=Math.max(a,i.width);else if(n.length===0&&o)a=Math.max(a,en(o));else{let c=Math.max(0,...n.map(u=>u.timestamp?en(u.timestamp):0));for(let u of n){let d=c>0?c:0,A=en(u.text)+(d>0?d+2:0);a=Math.max(a,A)}}return r&&(a=Math.max(a,en(r))),a}function Fao({config:e,actualWidth:t}){let{title:n,lines:r,footer:o,emptyMessage:i,customContent:a}=e,l=" ",c=Math.max(0,...r.map(u=>u.timestamp?en(u.timestamp):0));return(0,UT.jsxs)(O,{flexDirection:"column",width:t,children:[(0,UT.jsx)(_,{bold:!0,color:"claude",children:n}),a?(0,UT.jsxs)(UT.Fragment,{children:[a.content,o&&(0,UT.jsx)(_,{dimColor:!0,italic:!0,children:ka(o,t)})]}):r.length===0&&i?(0,UT.jsx)(_,{dimColor:!0,children:ka(i,t)}):(0,UT.jsxs)(UT.Fragment,{children:[r.map((u,d)=>{let A=Math.max(10,t-(c>0?c+l.length:0));return(0,UT.jsxs)(_,{children:[c>0&&(0,UT.jsxs)(UT.Fragment,{children:[(0,UT.jsx)(_,{dimColor:!0,children:(u.timestamp||"").padEnd(c)}),l]}),(0,UT.jsx)(_,{children:ka(u.text,A)})]},d)}),o&&(0,UT.jsx)(_,{dimColor:!0,italic:!0,children:ka(o,t)})]})]})}var UT,Uao=S(()=>{Vi();Xe();kr();UT=U(Z());s(Lao,"calculateFeedWidth");s(Fao,"Feed")});function $ao({feeds:e,maxWidth:t}){let n=e.map(i=>Lao(i)),r=Math.max(...n),o=Math.min(r,t);return(0,ITe.jsx)(O,{flexDirection:"column",children:e.map((i,a)=>(0,ITe.jsxs)(Bao.Fragment,{children:[(0,ITe.jsx)(Fao,{config:i,actualWidth:o}),a<e.length-1&&(0,ITe.jsx)(jd,{color:"claude",width:o})]},a))})}var Bao,ITe,Hao=S(()=>{Bao=U(et());Xe();IN();Uao();ITe=U(Z());s($ao,"FeedColumn")});async function m$i(e="claude_code_guest_pass"){let{accessToken:t,orgUUID:n}=await dS(),r={...mp(t),"x-organization-uuid":n},o=`${Kr().BASE_API_URL}/api/oauth/organizations/${n}/referral/eligibility`;return(await dn.get(o,{headers:r,params:{campaign:e},timeout:5e3})).data}async function qao(e="claude_code_guest_pass"){let{accessToken:t,orgUUID:n}=await dS(),r={...mp(t),"x-organization-uuid":n},o=`${Kr().BASE_API_URL}/api/oauth/organizations/${n}/referral/redemptions`;return(await dn.get(o,{headers:r,params:{campaign:e},timeout:1e4})).data}function Gao(){return!!(Au()?.organizationUuid&&to()&&Ei()==="max")}function PTe(){if(!Gao())return{eligible:!1,needsRefresh:!1,hasCache:!1};let e=Au()?.organizationUuid;if(!e)return{eligible:!1,needsRefresh:!1,hasCache:!1};let n=rt().passesEligibilityCache?.[e];if(!n)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:r,timestamp:o}=n,a=Date.now()-o>zao;return{eligible:r,needsRefresh:a,hasCache:!0}}function L7(e){let t=f$i[e.currency]??`${e.currency} `,n=e.amount_minor_units/100,r=n%1===0?n.toString():n.toFixed(2);return`${t}${r}`}function F7(){let e=Au()?.organizationUuid;return e?rt().passesEligibilityCache?.[e]?.referrer_reward??null:null}function cwt(){let e=Au()?.organizationUuid;return e?rt().passesEligibilityCache?.[e]?.remaining_passes??null:null}async function jao(){if(Aje)return v("Passes: Reusing in-flight eligibility fetch"),Aje;let e=Au()?.organizationUuid;return e?(Aje=(async()=>{try{let t=await m$i(),n={...t,timestamp:Date.now()};return kt(r=>({...r,passesEligibilityCache:{...r.passesEligibilityCache,[e]:n}})),v(`Passes eligibility cached for org ${e}: ${t.eligible}`),t}catch(t){return v("Failed to fetch and cache passes eligibility"),ne(t),null}finally{Aje=null}})(),Aje):null}async function Qhn(){if(!Gao())return null;let e=Au()?.organizationUuid;if(!e)return null;let n=rt().passesEligibilityCache?.[e],r=Date.now();if(!n)return v("Passes: No cache, fetching eligibility in background (command unavailable this session)"),jao(),null;if(r-n.timestamp>zao){v("Passes: Cache stale, returning cached data and refreshing in background"),jao();let{timestamp:a,...l}=n;return l}v("Passes: Using fresh cached eligibility data");let{timestamp:o,...i}=n;return i}async function Wao(){NA()||Qhn()}var zao,Aje,f$i,U7=S(()=>{Fi();yl();Cr();mn();it();wt();wv();Jy();zao=1440*60*1e3,Aje=null;s(m$i,"fetchReferralEligibility");s(qao,"fetchReferralRedemptions");s(Gao,"shouldCheckForPasses");s(PTe,"checkCachedPassesEligibility");f$i={USD:"$",EUR:"\u20AC",GBP:"\xA3",BRL:"R$",CAD:"CA$",AUD:"A$",NZD:"NZ$",SGD:"S$"};s(L7,"formatCreditAmount");s(F7,"getCachedReferrerReward");s(cwt,"getCachedRemainingPasses");s(jao,"fetchAndStorePassesEligibility");s(Qhn,"getCachedOrFetchPassesEligibility");s(Wao,"prefetchPassesEligibility")});import{homedir as g$i}from"os";function pje(e){let t=e.map(n=>{let r=BF(n.modified);return{text:(n.summary&&n.summary!=="No prompt"?n.summary:n.firstPrompt)||"",timestamp:r}});return{title:"Recent activity",lines:t,footer:t.length>0?"/resume for more":void 0,emptyMessage:"No recent activity"}}function Vao(e){let t=e.map(r=>({text:r}));return{title:"What's new",lines:t,footer:t.length>0?"/release-notes for more":void 0,emptyMessage:"Check the Claude Code changelog for updates"}}function Yao(e){let n=e.filter(({isEnabled:o})=>o).sort((o,i)=>Number(o.isComplete)-Number(i.isComplete)).map(({text:o,isComplete:i})=>({text:`${i?`${Ze.tick} `:""}${o}`})),r=_t()===g$i()?"Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.":void 0;return r&&n.push({text:r}),{title:"Tips for getting started",lines:n}}function Kao(){let e=F7(),t=e?`Share Claude Code and earn ${L7(e)} of extra usage`:"Share Claude Code with friends";return{title:"3 guest passes",lines:[],customContent:{content:(0,B7.jsxs)(B7.Fragment,{children:[(0,B7.jsx)(O,{marginY:1,children:(0,B7.jsx)(_,{color:"claude",children:"[\u273B] [\u273B] [\u273B]"})}),(0,B7.jsx)(_,{dimColor:!0,children:t})]}),width:48},footer:"/passes"}}var B7,Qao=S(()=>{oo();Xe();U7();xr();kr();B7=U(Z());s(pje,"createRecentActivityFeed");s(Vao,"createWhatsNewFeed");s(Yao,"createProjectOnboardingFeed");s(Kao,"createGuestPassesFeed")});function E3(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Zao(){let{pose:e,bounceOffset:t,onClick:n}=E$i();return(0,uwt.jsx)(O,{height:S$i,flexDirection:"column",onClick:n,children:(0,uwt.jsx)(O,{marginTop:t,flexShrink:0,children:(0,uwt.jsx)($ie,{pose:e})})})}function E$i(){let[e]=(0,Hie.useState)(()=>yr().prefersReducedMotion??!1),[t,n]=(0,Hie.useState)(-1),r=(0,Hie.useRef)(Jao),o=s(()=>{e||t!==-1||(r.current=Xao[Math.floor(Math.random()*Xao.length)],n(0))},"onClick");(0,Hie.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let l=setTimeout(n,y$i,b$i);return()=>clearTimeout(l)},[t]);let i=r.current,a=t>=0&&t<i.length?i[t]:_$i;return{pose:a.pose,bounceOffset:a.offset,onClick:o}}var Hie,uwt,Jao,h$i,Xao,_$i,y$i,b$i,S$i,elo=S(()=>{Hie=U(et());Xe();Mn();lwt();uwt=U(Z());s(E3,"hold");Jao=[...E3("default",1,2),...E3("arms-up",0,3),...E3("default",0,1),...E3("default",1,2),...E3("arms-up",0,3),...E3("default",0,1)],h$i=[...E3("look-right",0,5),...E3("look-left",0,5),...E3("default",0,1)],Xao=[Jao,h$i],_$i={pose:"default",offset:0},y$i=60,b$i=s(e=>e+1,"incrementFrame"),S$i=3;s(Zao,"AnimatedClawd");s(E$i,"useClawdAnimation")});function tlo({version:e,welcomeMessage:t,align:n="left",showVersion:r=!0}){return(0,v3.jsxs)(O,{flexDirection:"column",alignItems:n==="center"?"center":"flex-start",children:[(0,v3.jsxs)(_,{children:[(0,v3.jsx)(_,{color:"inactive",children:"/"}),(0,v3.jsx)(_,{color:"claude",bold:!0,children:fee}),r&&e?(0,v3.jsx)(_,{dimColor:!0,children:` v${e}`}):null]}),(0,v3.jsx)(_,{color:"claude",children:Trt}),t?(0,v3.jsx)(_,{dimColor:!0,children:t}):null]})}var v3,nlo=S(()=>{Xe();K5();v3=U(Z());s(tlo,"BrandWordmark")});function v$i(){let e=cwt();if(e==null||e<=0)return;let n=rt().passesLastSeenRemaining??0;e>n&&kt(r=>({...r,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function T$i(){let{eligible:e,hasCache:t}=PTe();if(!e||!t)return!1;v$i();let n=rt();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function dwt(){let[e]=(0,rlo.useState)(()=>T$i());return e}function Awt(){let e=0;kt(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),q("tengu_guest_passes_upsell_shown",{seen_count:e})}function olo(){let e=F7();return(0,OTe.jsxs)(_,{dimColor:!0,children:[(0,OTe.jsx)(_,{color:"claude",children:"[\u273B]"})," ",(0,OTe.jsx)(_,{color:"claude",children:"[\u273B]"})," ",(0,OTe.jsx)(_,{color:"claude",children:"[\u273B]"})," \xB7"," ",e?`Share Claude Code and earn ${L7(e)} of extra usage \xB7 /passes`:"3 guest passes at /passes"]})}var rlo,OTe,Xhn=S(()=>{rlo=U(et());Xe();vt();U7();mn();OTe=U(Z());s(v$i,"resetIfPassesRefreshed");s(T$i,"shouldShowGuestPassesUpsell");s(dwt,"useShowGuestPassesUpsell");s(Awt,"incrementGuestPassesSeenCount");s(olo,"GuestPassesUpsell")});function slo(){let{columns:e}=jn(),t=gt(M=>M.agent),n=gt(M=>M.effortValue),r=gt(M=>M.remoteCwd),o=vE(),i=W0e(o),{version:a,cwd:l,billingType:c,agentName:u}=awt({isRemoteMode:ri(),remoteCwd:r}),d=t??u,A=dwt(),p=jxt();(0,Jhn.useEffect)(()=>{A&&Awt()},[A]),(0,Jhn.useEffect)(()=>{p&&!A&&zxt()},[p,A]);let m=Math.max(e-15,20),f=ka(a,Math.max(m-13,6)),h=mhe(o,n),{shouldSplit:b,truncatedModel:E,truncatedBilling:x}=Dao(i+h,c,m),T=d?m-1-en(d)-3:m,R=uje(l,Math.max(T,10)),I=d?`@${d} \xB7 ${R}`:R;return(0,BT.jsx)(fT,{children:(0,BT.jsxs)(O,{flexDirection:"row",gap:2,alignItems:"center",children:[cs()?(0,BT.jsx)(Zao,{}):(0,BT.jsx)($ie,{}),(0,BT.jsxs)(O,{flexDirection:"column",children:[(0,BT.jsx)(tlo,{version:f}),b?(0,BT.jsxs)(BT.Fragment,{children:[(0,BT.jsx)(_,{dimColor:!0,children:E}),(0,BT.jsx)(_,{dimColor:!0,children:x})]}):(0,BT.jsxs)(_,{dimColor:!0,children:[E," \xB7 ",x]}),(0,BT.jsx)(_,{dimColor:!0,children:I}),A&&(0,BT.jsx)(olo,{}),!A&&p&&(0,BT.jsx)(qxt,{maxWidth:m,twoLine:!0})]})]})})}var Jhn,BT,ilo=S(()=>{Jhn=U(et());St();q2();xs();Vi();Xe();fr();Kv();kr();j_();dje();To();sQ();elo();nlo();lwt();Xhn();k2e();BT=U(Z());s(slo,"CondensedLogo")});function e_n(){let e=(0,mje.useMemo)(w$i,[]),t=(0,mje.useMemo)(()=>rt().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,mje.useEffect)(()=>{n&&kt(r=>r.lastShownEmergencyTip===e.tip?r:{...r,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,Zhn.jsx)(O,{paddingLeft:2,flexDirection:"column",children:(0,Zhn.jsx)(_,{...e.color==="warning"?{color:"warning"}:e.color==="error"?{color:"error"}:{dimColor:!0},children:e.tip})}):null}function w$i(){return LD(x$i,C$i)}var mje,Zhn,x$i,C$i,alo=S(()=>{mje=U(et());Xe();Yn();mn();Zhn=U(Z()),x$i="tengu-top-of-feed-tip";s(e_n,"EmergencyTip");C$i={tip:"",color:"dim"};s(w$i,"getTipOfFeed")});function t_n({char:e=A0}){let[t]=(0,jie.useState)(()=>yr().prefersReducedMotion??!1),[n,r]=(0,jie.useState)(t),o=(0,jie.useRef)(null),[i,a]=Xb(n?null:50);if((0,jie.useEffect)(()=>{if(n)return;let u=setTimeout(r,R$i,!0);return()=>clearTimeout(u)},[n]),n)return(0,fje.jsx)(O,{ref:i,children:(0,fje.jsx)(_,{color:I$i,children:e})});o.current===null&&(o.current=a);let c=(a-o.current)/llo*360%360;return(0,fje.jsx)(O,{ref:i,children:(0,fje.jsx)(_,{color:KN(f_t(c)),children:e})})}var jie,fje,llo,k$i,R$i,I$i,n_n=S(()=>{jie=U(et());du();Xe();Mn();m4();fje=U(Z()),llo=1500,k$i=2,R$i=llo*k$i,I$i=KN({r:153,g:153,b:153});s(t_n,"AnimatedAsterisk")});function clo(){return qh()&&(rt().opus1mMergeNoticeSeenCount??0)<P$i}function mwt(){let[e]=(0,pwt.useState)(clo);return(0,pwt.useEffect)(()=>{if(!e)return;let t=(rt().opus1mMergeNoticeSeenCount??0)+1;kt(n=>(n.opus1mMergeNoticeSeenCount??0)>=t?n:{...n,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,gje.jsxs)(O,{paddingLeft:2,children:[(0,gje.jsx)(t_n,{char:wnt}),(0,gje.jsxs)(_,{dimColor:!0,children:[" ","Clavue Opus now includes a 1M context window"]})]}):null}var pwt,gje,P$i,r_n=S(()=>{pwt=U(et());du();Xe();mn();To();n_n();gje=U(Z()),P$i=6;s(clo,"shouldShowOpus1mMergeNotice");s(mwt,"Opus1mMergeNotice")});function fwt(){return null}var ulo,dlo,Alo=S(()=>{ulo=U(et());Xe();mn();Mn();DEt();n_n();r_n();dlo=U(Z());s(fwt,"VoiceModeNotice")});function plo(){let e=Oao(),t=rt().oauthAccount?.displayName??"",{columns:n}=jn(),r=kXr(),o=tr.isSandboxingEnabled(),i=dwt(),a=jxt(),l=gt(ae=>ae.agent),c=gt(ae=>ae.effortValue),u=gt(ae=>ae.remoteCwd),d=gt(ae=>ae.remoteSessionUrl),A=rt(),p;try{p=Nao(3)}catch{p=[]}let[m]=(0,DTe.useState)(()=>{let ae=yr().companyAnnouncements;if(!(!ae||ae.length===0))return A.numStartups===1?ae[0]:ae[Math.floor(Math.random()*ae.length)]}),{hasReleaseNotes:f}=Nio(A.lastReleaseNotesSeen);(0,DTe.useEffect)(()=>{rt().lastReleaseNotesSeen!=="8.8.62"&&(kt(Se=>Se.lastReleaseNotesSeen==="8.8.62"?Se:{...Se,lastReleaseNotesSeen:"8.8.62"}),r&&RXr())},[A,r]);let h=!f&&!r&&!qe(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,DTe.useEffect)(()=>{i&&!r&&!h&&Awt()},[i,r,h]),(0,DTe.useEffect)(()=>{a&&!r&&!i&&!h&&zxt()},[a,r,i,h]);let b=vE(),E=W0e(b),{version:x,cwd:T,billingType:R,agentName:I}=awt({isRemoteMode:ri(),remoteCwd:u}),M=l??I,N=mhe(b,c),F=ka(E+N,o_n-20);if(!f&&!r&&!qe(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,Us.jsxs)(Us.Fragment,{children:[(0,Us.jsx)(slo,{}),(0,Us.jsx)(fwt,{}),(0,Us.jsx)(mwt,{}),MTe&&(0,Us.jsx)(MTe.ChannelsNotice,{}),hw()&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[(0,Us.jsx)(_,{color:"warning",children:"Debug mode enabled"}),(0,Us.jsxs)(_,{dimColor:!0,children:["Logging to: ",UF()?"stderr":BJ()]})]}),(0,Us.jsx)(e_n,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[(0,Us.jsxs)(_,{dimColor:!0,children:["tmux session: ",process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,Us.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[!process.env.IS_DEMO&&A.oauthAccount?.organizationName&&(0,Us.jsxs)(_,{dimColor:!0,children:["Message from ",A.oauthAccount.organizationName,":"]}),(0,Us.jsx)(_,{children:m})]}),!1,!1,!1,!1]});let D=kao(n),L=FH(rt().theme),B=` ${Ar("claude",L)("Claude Code")} ${Ar("inactive",L)(`v${x}`)} `,z=Ar("claude",L)(" Claude Code ");if(D==="compact"){let Se=iwt(t);en(Se)>n-4&&(Se=iwt(null));let Ie=M?n-4-"@".length-en(M)-" \xB7 ".length:n-4,xe=uje(T,Math.max(Ie,10));return(0,Us.jsxs)(Us.Fragment,{children:[(0,Us.jsx)(fT,{children:(0,Us.jsxs)(O,{flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:{content:z,position:"top",align:"start",offset:1},paddingX:1,paddingY:1,alignItems:"center",width:n,children:[(0,Us.jsx)(_,{bold:!0,children:Se}),(0,Us.jsx)(O,{marginY:1,children:(0,Us.jsx)($ie,{})}),(0,Us.jsx)(_,{dimColor:!0,children:F}),(0,Us.jsx)(_,{dimColor:!0,children:R}),(0,Us.jsx)(_,{dimColor:!0,children:M?`@${M} \xB7 ${xe}`:xe})]})}),(0,Us.jsx)(fwt,{}),(0,Us.jsx)(mwt,{}),MTe&&(0,Us.jsx)(MTe.ChannelsNotice,{}),o&&(0,Us.jsx)(O,{marginTop:1,flexDirection:"column",children:(0,Us.jsx)(_,{color:"warning",children:"Your bash commands will be sandboxed. Disable with /sandbox."})}),!1,!1]})}let G=iwt(t),H=!process.env.IS_DEMO&&A.oauthAccount?.organizationName?`${F} \xB7 ${R} \xB7 ${A.oauthAccount.organizationName}`:`${F} \xB7 ${R}`,K=M?o_n-"@".length-en(M)-" \xB7 ".length:o_n,ee=uje(T,Math.max(K,10)),ge=M?`@${M} \xB7 ${ee}`:ee,fe=Iao(G,ge,H),{leftWidth:de,rightWidth:oe}=Rao(n,D,fe);return(0,Us.jsxs)(Us.Fragment,{children:[(0,Us.jsx)(fT,{children:(0,Us.jsx)(O,{flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:{content:B,position:"top",align:"start",offset:3},children:(0,Us.jsxs)(O,{flexDirection:D==="horizontal"?"row":"column",paddingX:1,gap:1,children:[(0,Us.jsxs)(O,{flexDirection:"column",width:de,justifyContent:"space-between",alignItems:"center",minHeight:9,children:[(0,Us.jsx)(O,{marginTop:1,children:(0,Us.jsx)(_,{bold:!0,children:G})}),(0,Us.jsx)($ie,{}),(0,Us.jsxs)(O,{flexDirection:"column",alignItems:"center",children:[(0,Us.jsx)(_,{dimColor:!0,children:H}),(0,Us.jsx)(_,{dimColor:!0,children:ge})]})]}),D==="horizontal"&&(0,Us.jsx)(O,{height:"100%",borderStyle:"single",borderColor:"claude",borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),D==="horizontal"&&(0,Us.jsx)($ao,{feeds:r?[Yao(Cmn()),pje(e)]:i?[pje(e),Kao()]:a?[pje(e),keo()]:[pje(e),Vao(p)],maxWidth:oe})]})})}),(0,Us.jsx)(fwt,{}),(0,Us.jsx)(mwt,{}),MTe&&(0,Us.jsx)(MTe.ChannelsNotice,{}),hw()&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[(0,Us.jsx)(_,{color:"warning",children:"Debug mode enabled"}),(0,Us.jsxs)(_,{dimColor:!0,children:["Logging to: ",UF()?"stderr":BJ()]})]}),(0,Us.jsx)(e_n,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[(0,Us.jsxs)(_,{dimColor:!0,children:["tmux session: ",process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,Us.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[!process.env.IS_DEMO&&A.oauthAccount?.organizationName&&(0,Us.jsxs)(_,{dimColor:!0,children:["Message from ",A.oauthAccount.organizationName,":"]}),(0,Us.jsx)(_,{children:m})]}),o&&(0,Us.jsx)(O,{paddingLeft:2,flexDirection:"column",children:(0,Us.jsx)(_,{color:"warning",children:"Your bash commands will be sandboxed. Disable with /sandbox."})}),!1,!1,!1,!1]})}var DTe,Us,MTe,o_n,mlo=S(()=>{Xe();xs();Vi();dje();kr();oi();lwt();Hao();Qao();mn();Ufe();Mn();it();DTe=U(et());d2e();ilo();sQ();wTe();sV();Ot();HF();alo();Alo();r_n();St();Td();Xhn();k2e();fr();Kv();q2();To();Us=U(Z()),MTe=null,o_n=50;s(plo,"LogoV2")});function flo({message:e,isTranscriptMode:t}){return t&&e.type==="assistant"&&e.message.model&&e.message.content.some(r=>r.type==="text")?(0,s_n.jsx)(O,{minWidth:en(e.message.model)+8,children:(0,s_n.jsx)(_,{dimColor:!0,children:e.message.model})}):null}var s_n,glo=S(()=>{Vi();Xe();s_n=U(Z());s(flo,"MessageModel")});function hlo({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type==="assistant"&&e.message.content.some(o=>o.type==="text")))return null;let r=new Date(e.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0});return(0,i_n.jsx)(O,{minWidth:en(r),children:(0,i_n.jsx)(_,{dimColor:!0,children:r})})}var i_n,_lo=S(()=>{Vi();Xe();i_n=U(Z());s(hlo,"MessageTimestamp")});function blo(e,t,n,r){for(let o=t+1;o<e.length;o++){let i=e[o];if(i?.type==="assistant"){let a=i.message.content[0];if(a?.type==="thinking"||a?.type==="redacted_thinking"||a?.type==="tool_use"&&(Bse(a.name,a.input,n).isCollapsible||r.has(a.id)))continue;return!0}if(!(i?.type==="system"||i?.type==="attachment")&&!(i?.type==="user"&&i.message.content[0]?.type==="tool_result")){if(i?.type==="grouped_tool_use"){let a=i.messages[0]?.message.content[0]?.input;if(Bse(i.toolName,a,n).isCollapsible)continue}return!0}}return!1}function O$i({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:o,verbose:i,inProgressToolUseIDs:a,streamingToolUseIDs:l,screen:c,canAnimate:u,onOpenRateLimitOptions:d,lastThinkingBlockId:A,latestBashOutputUUID:p,columns:m,isLoading:f,lookups:h}){let b=c==="transcript",E=e.type==="grouped_tool_use",x=e.type==="collapsed_read_search",T=x&&(ddn(e,a)||f&&!n),R=E?e.displayMessage:x?WKr(e):e,I=E||x?[]:T7r(e,h),M=E||x?OTt:v7r(e,h),N=vlo(e,l,a,M,c,h),F=!1;if(u)if(E)F=e.messages.some(B=>{let z=B.message.content[0];return z?.type==="tool_use"&&a.has(z.id)});else if(x)F=ddn(e,a);else{let B=n3(e);F=!B||a.has(B)}let D=b&&R.type==="assistant"&&R.message.content.some(B=>B.type==="text")&&(R.timestamp||R.message.model),L=(0,T3.jsx)(qN,{message:e,lookups:h,addMargin:!D,containerWidth:D?void 0:m,tools:r,commands:o,verbose:i,inProgressToolUseIDs:a,progressMessagesForMessage:I,shouldAnimate:F,shouldShowDot:!0,isTranscriptMode:b,isStatic:N,onOpenRateLimitOptions:d,isActiveCollapsedGroup:T,isUserContinuation:t,lastThinkingBlockId:A,latestBashOutputUUID:p});return D?(0,T3.jsx)(fT,{children:(0,T3.jsxs)(O,{width:m,flexDirection:"column",children:[(0,T3.jsxs)(O,{flexDirection:"row",justifyContent:"flex-end",gap:1,marginTop:1,children:[(0,T3.jsx)(hlo,{message:R,isTranscriptMode:b}),(0,T3.jsx)(flo,{message:R,isTranscriptMode:b})]}),L]})}):(0,T3.jsx)(fT,{children:L})}function M$i(e,t){if(e.type==="grouped_tool_use")return e.messages.some(r=>{let o=r.message.content[0];return o?.type==="tool_use"&&t.has(o.id)});if(e.type==="collapsed_read_search")return gbe(e).some(o=>t.has(o));let n=n3(e);return!!n&&t.has(n)}function D$i(e,t){if(e.type==="grouped_tool_use")return e.messages.every(r=>{let o=r.message.content[0];return o?.type==="tool_use"&&t.has(o.id)});if(e.type==="collapsed_read_search")return gbe(e).every(o=>t.has(o));if(e.type==="assistant"){let r=e.message.content[0];if(r?.type==="server_tool_use")return t.has(r.id)}let n=n3(e);return!n||t.has(n)}function N$i(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type==="collapsed_read_search"&&t.screen!=="transcript"||e.columns!==t.columns)return!1;let n=e.latestBashOutputUUID===e.message.uuid,r=t.latestBashOutputUUID===t.message.uuid;if(n!==r||e.lastThinkingBlockId!==t.lastThinkingBlockId&&znn(t.message))return!1;let o=M$i(e.message,e.streamingToolUseIDs),i=D$i(e.message,e.lookups.resolvedToolUseIDs);return!(o||!i)}var ylo,T3,Slo,Elo=S(()=>{ylo=U(et());Xe();n4();Ln();ybe();glo();hje();_lo();sQ();T3=U(Z());s(blo,"hasContentAfterIndex");s(O$i,"MessageRowImpl");s(M$i,"isMessageStreaming");s(D$i,"allToolsResolved");s(N$i,"areMessageRowPropsEqual");Slo=ylo.memo(O$i,N$i)});function gwt(e){return e.type==="attachment"&&F$i.has(e.attachment.type)}var L$i,F$i,a_n=S(()=>{L$i=["hook_success","hook_additional_context","hook_cancelled","command_permissions","agent_mention","budget_usd","critical_system_reminder","edited_image_file","edited_text_file","opened_file_in_ide","output_style","plan_mode","plan_mode_exit","plan_mode_reentry","structured_output","team_context","todo_reminder","context_efficiency","deferred_tools_delta","mcp_instructions_delta","companion_intro","token_usage","ultrathink_effort","max_turns_reached","task_reminder","auto_mode","auto_mode_exit","output_token_usage","pen_mode_enter","pen_mode_exit","verify_plan_reminder","current_session_memory","project_knowledge","project_knowledge_page","compaction_reminder","date_change"],F$i=new Set(L$i);s(gwt,"isNullRenderingAttachment")});import{relative as U$i}from"path";function Tlo(e){return G$i.filter(t=>t.isActive(e))}var Vd,B$i,$$i,H$i,j$i,z$i,q$i,G$i,xlo=S(()=>{Xe();Gy();oo();xr();kr();Cr();ngn();gf();qZt();Vd=U(Z()),B$i={id:"large-memory-files",type:"warning",isActive:s(e=>mne(e.memoryFiles).length>0,"isActive"),render:s(e=>{let t=mne(e.memoryFiles);return(0,Vd.jsx)(Vd.Fragment,{children:t.map(n=>{let r=n.path.startsWith(_t())?U$i(_t(),n.path):n.path;return(0,Vd.jsxs)(O,{flexDirection:"row",children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Large ",(0,Vd.jsx)(_,{bold:!0,children:r})," will impact performance (",hi(n.content.length)," chars >"," ",hi(rV),")",(0,Vd.jsx)(_,{dimColor:!0,children:" \xB7 /memory to edit"})]})]},n.path)})})},"render")},$$i={id:"claude-ai-external-token",type:"warning",isActive:s(()=>{let e=mD();return to()&&(e.source==="ANTHROPIC_AUTH_TOKEN"||e.source==="apiKeyHelper")},"isActive"),render:s(()=>{let e=mD();return(0,Vd.jsxs)(O,{flexDirection:"row",marginTop:1,children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Auth conflict: Using ",e.source," instead of Claude account subscription token. Either unset ",e.source,", or run `claude /logout`."]})]})},"render")},H$i={id:"api-key-conflict",type:"warning",isActive:s(()=>{let{source:e}=Wp({skipRetrievingKeyFromApiKeyHelper:!0});return!!mfe()&&(e==="ANTHROPIC_API_KEY"||e==="apiKeyHelper")},"isActive"),render:s(()=>{let{source:e}=Wp({skipRetrievingKeyFromApiKeyHelper:!0});return(0,Vd.jsxs)(O,{flexDirection:"row",marginTop:1,children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Auth conflict: Using ",e," instead of Anthropic Console key. Either unset ",e,", or run `claude /logout`."]})]})},"render")},j$i={id:"both-auth-methods",type:"warning",isActive:s(()=>{let{source:e}=Wp({skipRetrievingKeyFromApiKeyHelper:!0}),t=mD();return e!=="none"&&t.source!=="none"&&!(e==="apiKeyHelper"&&t.source==="apiKeyHelper")},"isActive"),render:s(()=>{let{source:e}=Wp({skipRetrievingKeyFromApiKeyHelper:!0}),t=mD();return(0,Vd.jsxs)(O,{flexDirection:"column",marginTop:1,children:[(0,Vd.jsxs)(O,{flexDirection:"row",children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Auth conflict: Both a token (",t.source,") and an API key (",e,") are set. This may lead to unexpected behavior."]})]}),(0,Vd.jsxs)(O,{flexDirection:"column",marginLeft:3,children:[(0,Vd.jsxs)(_,{color:"warning",children:["\xB7 Trying to use"," ",t.source==="claude.ai"?"claude.ai":t.source,"?"," ",e==="ANTHROPIC_API_KEY"?'Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.':e==="apiKeyHelper"?"Unset the apiKeyHelper setting.":"claude /logout"]}),(0,Vd.jsxs)(_,{color:"warning",children:["\xB7 Trying to use ",e,"?"," ",t.source==="claude.ai"?"claude /logout to sign out of claude.ai.":`Unset the ${t.source} environment variable.`]})]})]})},"render")},z$i={id:"large-agent-descriptions",type:"warning",isActive:s(e=>D2e(e.agentDefinitions)>bie,"isActive"),render:s(e=>{let t=D2e(e.agentDefinitions);return(0,Vd.jsxs)(O,{flexDirection:"row",children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Large cumulative agent descriptions will impact performance (~",hi(t)," tokens >"," ",hi(bie),")",(0,Vd.jsx)(_,{dimColor:!0,children:" \xB7 /agents to manage"})]})]})},"render")},q$i={id:"jetbrains-plugin-install",type:"info",isActive:s(e=>{if(!fye()||!(e.config.autoInstallIdeExtension??!0))return!1;let n=pye();return n!==null&&!nRr(n)},"isActive"),render:s(()=>{let e=pye(),t=mg(e);return(0,Vd.jsxs)(O,{flexDirection:"row",gap:1,marginLeft:1,children:[(0,Vd.jsx)(_,{color:"ide",children:Ze.arrowUp}),(0,Vd.jsxs)(_,{children:["Install the ",(0,Vd.jsx)(_,{color:"ide",children:t})," plugin from the JetBrains Marketplace:"," ",(0,Vd.jsx)(_,{bold:!0,children:"https://docs.\u0063laude.com/s/claude-code-jetbrains"})]})]})},"render")},G$i=[B$i,z$i,$$i,H$i,j$i,q$i];s(Tlo,"getActiveNotices")});function klo({agentDefinitions:e}={}){let t={config:rt(),agentDefinitions:e,memoryFiles:(0,wlo.use)(Xh())},n=Tlo(t);return n.length===0?null:(0,l_n.jsx)(O,{flexDirection:"column",paddingLeft:1,children:n.map(r=>(0,l_n.jsx)(Clo.Fragment,{children:r.render(t)},r.id))})}var Clo,wlo,l_n,Rlo=S(()=>{Clo=U(et()),wlo=U(et());Xe();Gy();mn();xlo();l_n=U(Z());s(klo,"StatusNotices")});function Ilo(e,t,n){let r=(0,WA.useRef)(new Map),o=(0,WA.useRef)(0),i=(0,WA.useRef)(0),a=(0,WA.useRef)({arr:new Float64Array(0),version:-1,n:-1}),l=(0,WA.useRef)(new Map),c=(0,WA.useRef)(new Map),u=(0,WA.useRef)(n),d=(0,WA.useRef)(!1),A=(0,WA.useRef)(null),p=(0,WA.useRef)(0);if(u.current!==n){let Se=u.current/n;u.current=n;for(let[Me,Te]of r.current)r.current.set(Me,Math.max(1,Math.round(Te*Se)));o.current++,d.current=!0,p.current=2}let m=p.current>0?A.current:null,f=(0,WA.useRef)(0),h=(0,WA.useRef)(null),b=(0,WA.useCallback)(Se=>e.current?.subscribe(Se)??K$i,[e]);(0,WA.useSyncExternalStore)(b,()=>{let Se=e.current;if(!Se)return NaN;let Me=Se.getScrollTop()+Se.getPendingDelta(),Te=Math.floor(Me/Y$i);return Se.isSticky()?~Te:Te});let E=e.current?.getScrollTop()??-1,x=e.current?.getPendingDelta()??0,T=e.current?.getViewportHeight()??0,R=e.current?.isSticky()??!0;(0,WA.useMemo)(()=>{let Se=new Set(t),Me=!1;for(let Te of r.current.keys())Se.has(Te)||(r.current.delete(Te),Me=!0);for(let Te of c.current.keys())Se.has(Te)||c.current.delete(Te);Me&&o.current++},[t]);let I=t.length;if(a.current.version!==o.current||a.current.n!==I){let Se=a.current.arr.length>=I+1?a.current.arr:new Float64Array(I+1);Se[0]=0;for(let Me=0;Me<I;Me++)Se[Me+1]=Se[Me]+(r.current.get(t[Me])??W$i);a.current={arr:Se,version:o.current,n:I}}let M=a.current.arr,N=M[I],F,D;if(m)[F,D]=m,F=Math.min(F,I),D=Math.min(D,I);else if(T===0||E<0)F=Math.max(0,I-V$i),D=I;else{if(R){let re=T+NTe;for(F=I;F>0&&N-M[F-1]<re;)F--;D=I}else{let re=f.current,te=T*3,ue=Math.min(E,E+x),Ae=Math.max(E,E+x),ie=Ae-ue,be=ie>te&&x<0?Ae-te:ue,Pe=be+Math.min(ie,te),Re=Math.max(0,be-re),Ue=Pe-re,Ee=Re-NTe;{let Ne=0,nt=I;for(;Ne<nt;){let ct=Ne+nt>>1;M[ct+1]<=Ee?Ne=ct+1:nt=ct}F=Ne}{let Ne=A.current;if(Ne&&Ne[0]<F)for(let nt=Ne[0];nt<Math.min(F,Ne[1]);nt++){let ct=t[nt];if(l.current.has(ct)&&!r.current.has(ct)){F=nt;break}}}let De=T+2*NTe,ke=Math.min(I,F+_je),tt=0;for(D=F;D<ke&&(tt<De||M[D]<Ue+T+NTe);)tt+=r.current.get(t[D])??c_n,D++}let Se=T+2*NTe,Me=Math.max(0,D-_je),Te=0;for(let re=F;re<D;re++)Te+=r.current.get(t[re])??c_n;for(;F>Me&&Te<Se;)F--,Te+=r.current.get(t[F])??c_n;let Ie=A.current,xe=Math.abs(E-i.current)+Math.abs(x);if(Ie&&xe>T*2){let[re,te]=Ie;F<re-yje&&(F=re-yje),D>te+yje&&(D=te+yje),F>D&&(D=Math.min(F+yje,I))}i.current=E}p.current>0?p.current--:A.current=[F,D];let L=(0,WA.useDeferredValue)(F),B=(0,WA.useDeferredValue)(D),z=F<L?L:F,G=D>B?B:D;if((z>G||R)&&(z=F,G=D),x>0&&(G=D),G-z>_je){let Se=(M[z]+M[G])/2;E-f.current<Se?G=z+_je:z=G-_je}let H=f.current,W=M[z],Y=z===0?0:W+H,K=G===I?1/0:Math.max(W,M[G]-T)+H;(0,WA.useLayoutEffect)(()=>{R?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(Y,K)}),(0,WA.useLayoutEffect)(()=>{let Se=h.current?.yogaNode;if(Se&&Se.getComputedWidth()>0&&(f.current=Se.getComputedTop()),d.current){d.current=!1;return}let Me=!1;for(let[Te,Ie]of l.current){let xe=Ie.yogaNode;if(!xe)continue;let re=xe.getComputedHeight(),te=r.current.get(Te);re>0?te!==re&&(r.current.set(Te,re),Me=!0):xe.getComputedWidth()>0&&te!==0&&(r.current.set(Te,0),Me=!0)}Me&&o.current++});let ee=(0,WA.useCallback)(Se=>{let Me=c.current.get(Se);return Me||(Me=s(Te=>{if(Te)l.current.set(Se,Te);else{let Ie=l.current.get(Se)?.yogaNode;if(Ie&&!d.current){let xe=Ie.getComputedHeight();(xe>0||Ie.getComputedWidth()>0)&&r.current.get(Se)!==xe&&(r.current.set(Se,xe),o.current++)}l.current.delete(Se)}},"fn"),c.current.set(Se,Me)),Me},[]),ge=(0,WA.useCallback)(Se=>{let Me=l.current.get(t[Se])?.yogaNode;return!Me||Me.getComputedWidth()===0?-1:Me.getComputedTop()},[t]),fe=(0,WA.useCallback)(Se=>l.current.get(t[Se])??null,[t]),de=(0,WA.useCallback)(Se=>r.current.get(t[Se]),[t]),oe=(0,WA.useCallback)(Se=>{let Me=a.current;Se<0||Se>=Me.n||e.current?.scrollTo(Me.arr[Se]+f.current)},[e]),ae=N-M[G];return{range:[z,G],topSpacer:W,bottomSpacer:ae,measureRef:ee,spacerRef:h,offsets:M,getItemTop:ge,getItemElement:fe,getItemHeight:de,scrollToIndex:oe}}var WA,W$i,NTe,V$i,Y$i,c_n,_je,yje,K$i,Plo=S(()=>{WA=U(et()),W$i=3,NTe=80,V$i=30,Y$i=NTe>>1,c_n=1,_je=300,yje=25,K$i=s(()=>{},"NOOP_UNSUB");s(Ilo,"useVirtualScroll")});function Llo({children:e}){let[t,n]=(0,UC.useState)(null),[r,o]=(0,UC.useState)(null);return(0,bje.jsx)(Mlo.Provider,{value:n,children:(0,bje.jsx)(Nlo.Provider,{value:o,children:(0,bje.jsx)(Olo.Provider,{value:t,children:(0,bje.jsx)(Dlo.Provider,{value:r,children:e})})})})}function Flo(){return(0,UC.useContext)(Olo)}function Ulo(){return(0,UC.useContext)(Dlo)}function Blo(e){let t=(0,UC.useContext)(Mlo);(0,UC.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function $lo(e){let t=(0,UC.useContext)(Nlo);(0,UC.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var UC,bje,Olo,Mlo,Dlo,Nlo,hwt=S(()=>{UC=U(et()),bje=U(Z()),Olo=(0,UC.createContext)(null),Mlo=(0,UC.createContext)(null),Dlo=(0,UC.createContext)(null),Nlo=(0,UC.createContext)(null);s(Llo,"PromptOverlayProvider");s(Flo,"usePromptOverlay");s(Ulo,"usePromptOverlayDialog");s(Blo,"useSetPromptOverlay");s($lo,"useSetPromptOverlayDialog")});import{fileURLToPath as Q$i}from"url";function jlo(e){let[t,n]=(0,Eg.useState)(null),r=(0,Eg.useRef)(e);r.current=e;let o=(0,Eg.useRef)(null),i=(0,Eg.useCallback)(()=>{n(null)},[]),a=(0,Eg.useCallback)(u=>{let d=Math.max(0,u.getScrollHeight()-u.getViewportHeight());u.getScrollTop()+u.getPendingDelta()>=d||o.current===null&&(o.current=u.getScrollHeight(),n(r.current))},[]),l=(0,Eg.useCallback)(u=>{u&&u.scrollToBottom()},[]);(0,Eg.useEffect)(()=>{t===null?o.current=null:e<t&&(o.current=null,n(null))},[e,t]);let c=(0,Eg.useCallback)((u,d)=>{n(A=>A===null?null:A+u),o.current!==null&&(o.current+=d)},[]);return{dividerIndex:t,dividerYRef:o,onScrollAway:a,onRepin:i,jumpToNew:l,shiftDivider:c}}function X$i(e,t){let n=0,r=!1;for(let o=t;o<e.length;o++){let i=e[o];if(i.type==="progress"||i.type==="assistant"&&!J$i(i))continue;let a=i.type==="assistant";a&&!r&&n++,r=a}return n}function J$i(e){if(e.type!=="assistant")return!1;for(let t of e.message.content)if(t.type==="text"&&t.text.trim()!=="")return!0;return!1}function zlo(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type==="progress"||gwt(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let o=X$i(e,t);return{firstUnseenUuid:r,count:Math.max(1,o)}}function d_n({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:o,modalScrollRef:i,scrollRef:a,dividerYRef:l,hidePill:c=!1,hideSticky:u=!1,newMessageCount:d=0,onPillClick:A}){let{rows:p,columns:m}=jn(),[f,h]=(0,Eg.useState)(null),b=(0,Eg.useMemo)(()=>({setStickyPrompt:h}),[]),E=(0,Eg.useCallback)(T=>a?.current?.subscribe(T)??(()=>{}),[a]),x=(0,Eg.useSyncExternalStore)(E,()=>{let T=a?.current,R=l?.current;return!T||R==null?!1:T.getScrollTop()+T.getPendingDelta()+T.getViewportHeight()<R});if((0,Eg.useLayoutEffect)(()=>{if(!cs())return;let T=UA.get(process.stdout);if(T)return T.onHyperlinkClick=R=>{if(R.startsWith("file:"))try{Y_e(Q$i(R))}catch{}else Al(R)},()=>{T.onHyperlinkClick=void 0}},[]),cs()){let T=u?null:f,R=T!=null&&T!=="clicked"&&n==null?T:null,I=T!=null&&n==null;return(0,hp.jsxs)(Llo,{children:[(0,hp.jsxs)(O,{flexGrow:1,flexDirection:"column",overflow:"hidden",children:[R&&(0,hp.jsx)(eHi,{text:R.text,onClick:R.scrollTo}),(0,hp.jsxs)(Gve,{ref:a,flexGrow:1,flexDirection:"column",paddingTop:I?0:1,stickyScroll:!0,children:[(0,hp.jsx)(u_n,{value:b,children:e}),n]}),!c&&x&&n==null&&(0,hp.jsx)(Z$i,{count:d,onClick:A}),r!=null&&(0,hp.jsx)(O,{position:"absolute",bottom:0,right:0,opaque:!0,children:r})]}),(0,hp.jsxs)(O,{flexDirection:"column",flexShrink:0,width:"100%",maxHeight:"50%",children:[(0,hp.jsx)(tHi,{}),(0,hp.jsx)(nHi,{}),(0,hp.jsx)(O,{flexDirection:"column",width:"100%",flexGrow:1,overflowY:"hidden",children:t})]}),o!=null&&(0,hp.jsx)(t1e,{value:{rows:p-Hlo-1,columns:m-4,scrollRef:i??null},children:(0,hp.jsxs)(O,{position:"absolute",bottom:0,left:0,right:0,maxHeight:p-Hlo,flexDirection:"column",overflow:"hidden",opaque:!0,children:[(0,hp.jsx)(O,{flexShrink:0,children:(0,hp.jsx)(_,{color:"permission",children:"\u2594".repeat(m)})}),(0,hp.jsx)(O,{flexDirection:"column",paddingX:2,flexShrink:0,overflow:"hidden",children:o})]})})]})}return(0,hp.jsxs)(hp.Fragment,{children:[e,t,n,o]})}function Z$i({count:e,onClick:t}){let[n,r]=(0,Eg.useState)(!1);return(0,hp.jsx)(O,{position:"absolute",bottom:0,left:0,right:0,justifyContent:"center",children:(0,hp.jsx)(O,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,hp.jsxs)(_,{backgroundColor:n?"userMessageBackgroundHover":"userMessageBackground",dimColor:!0,children:[" ",e>0?`${e} new ${Qn(e,"message")}`:"Jump to bottom"," ",Ze.arrowDown," "]})})})}function eHi({text:e,onClick:t}){let[n,r]=(0,Eg.useState)(!1);return(0,hp.jsx)(O,{flexShrink:0,width:"100%",height:1,paddingRight:1,backgroundColor:n?"userMessageBackgroundHover":"userMessageBackground",onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,hp.jsxs)(_,{color:"subtle",wrap:"truncate-end",children:[Ze.pointer," ",e]})})}function tHi(){let e=Flo();return!e||e.suggestions.length===0?null:(0,hp.jsx)(O,{position:"absolute",bottom:"100%",left:0,right:0,paddingX:2,paddingTop:1,flexDirection:"column",opaque:!0,children:(0,hp.jsx)(TJr,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function nHi(){let e=Ulo();return e?(0,hp.jsx)(O,{position:"absolute",bottom:"100%",left:0,right:0,opaque:!0,children:e}):null}var Eg,hp,Hlo,u_n,A_n=S(()=>{oo();Eg=U(et());M2();hwt();xs();gxt();GR();Xe();e_();j_();Do();a_n();fxt();hp=U(Z()),Hlo=2,u_n=(0,Eg.createContext)({setStickyPrompt:s(()=>{},"setStickyPrompt")});s(jlo,"useUnseenDivider");s(X$i,"countUnseenAssistantTurns");s(J$i,"assistantHasVisibleText");s(zlo,"computeUnseenDivider");s(d_n,"FullscreenLayout");s(Z$i,"NewMessagesPill");s(eHi,"StickyPromptHeader");s(tHi,"SuggestionsOverlay");s(nHi,"DialogOverlay")});function rHi(e){let t=qlo.get(e);if(t!==void 0)return t;let n=nwt(e);return qlo.set(e,n),n}function sHi(e){let t=Glo.get(e);if(t!==void 0)return t;let n=iHi(e);return Glo.set(e,n),n}function iHi(e){let t=null;if(e.type==="user"){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let r=e.message.content[0];if(r?.type!=="text")return null;t=r.text}else if(e.type==="attachment"&&e.attachment.type==="queued_command"&&e.attachment.commandMode!=="task-notification"&&!e.attachment.isMeta){let r=e.attachment.prompt;t=typeof r=="string"?r:r.flatMap(o=>o.type==="text"?[o.text]:[]).join(`
|
|
5993
|
+
`)}var Tao,xao,Cao,Yhn=S(()=>{Ln();Tao="</system-reminder>",xao=new Set([e9,Jv]),Cao=new WeakMap;s(nwt,"renderableSearchText");s(l$i,"computeSearchText");s(c$i,"toolUseSearchText");s(u$i,"toolResultSearchText")});function A$i(e){let t=process.env.DEMO_VERSION?"/code/claude":Ki(e?.isRemoteMode&&e.remoteCwd?e.remoteCwd:_t()),n=OOt();return n?`${t} in ${n.replace(/^https?:\/\//,"")}`:t}function kao(e){return e>=70?"horizontal":"compact"}function Rao(e,t,n){if(t==="horizontal"){let o=n,i=Khn+owt+rwt+o,a=e-i,l=Math.max(30,a),c=Math.min(o+l+rwt+owt,e-Khn);return c<o+l+rwt+owt&&(l=c-o-rwt-owt),{leftWidth:o,rightWidth:l,totalWidth:c}}let r=Math.min(e-Khn,wao+20);return{leftWidth:r,rightWidth:r,totalWidth:r}}function Iao(e,t,n){let r=Math.max(en(e),en(Trt),en(t),en(n),20);return Math.min(r+4,wao)}function iwt(e){return!e||e.length>d$i?"\u51C6\u5907\u597D\u4E86\u5C31\u5F00\u59CB\u3002":`\u6B22\u8FCE\u56DE\u6765\uFF0C${e}\u3002`}function uje(e,t){if(en(e)<=t)return e;let n="/",r="\u2026",o=1,i=1,a=e.split(n),l=a[0]||"",c=a[a.length-1]||"",u=en(l),d=en(c);if(a.length===1)return Ws(e,t);if(l===""&&o+i+d>=t)return`${n}${Ws(c,Math.max(1,t-i))}`;if(l!==""&&o*2+i+d>=t)return`${r}${n}${Ws(c,Math.max(1,t-o-i))}`;if(a.length===2){let m=t-o-i-d;return`${$J(l,m)}${r}${n}${c}`}let A=t-u-d-o-2*i;if(A<=0){let m=Math.max(0,t-d-o-2*i);return`${$J(l,m)}${n}${r}${n}${c}`}let p=[];for(let m=a.length-2;m>0;m--){let f=a[m];if(f&&en(f)+i<=A)p.unshift(f),A-=en(f)+i;else break}return p.length===0?`${l}${n}${r}${n}${c}`:`${l}${n}${r}${n}${p.join(n)}${n}${c}`}async function Pao(){if(swt)return swt;let e=Et();return swt=dSe(10).then(t=>(cje=t.filter(n=>{if(n.isSidechain||n.sessionId===e||n.summary?.includes("I apologize"))return!1;let r=n.summary&&n.summary!=="No prompt",o=n.firstPrompt&&n.firstPrompt!=="No prompt";return r||o}).slice(0,3),cje)).catch(()=>(cje=[],cje)),swt}function Oao(){return cje}function awt(e){let t=process.env.DEMO_VERSION??bD,n=A$i(e),r=to()?Rst():"Usage-based API billing",o=yr().agent;return{version:t,cwd:n,billingType:r,agentName:o}}function Mao(e){return e?.isRemoteMode&&e.remoteCwd?e.remoteCwd:_t()}function Dao(e,t,n){return en(e)+3+en(t)>n?{shouldSplit:!0,truncatedModel:ka(e,n),truncatedBilling:ka(t,n)}:{shouldSplit:!1,truncatedModel:ka(e,Math.max(n-en(t)-3,10)),truncatedBilling:t}}function Nao(e){if(process.env.USER_TYPE==="ant")return[];let t=qCt();if(!t)return[];let n;try{n=GCt(t)}catch{return[]}let r=[],o=Object.keys(n).sort((i,a)=>Kw(i,a)?-1:1).slice(0,3);for(let i of o){let a=n[i];a&&r.push(...a)}return r.slice(0,e)}var wao,d$i,Khn,rwt,owt,cje,swt,dje=S(()=>{St();K5();Vi();Cr();xr();oi();kr();wTe();Qw();ys();Mn();wao=50,d$i=20,Khn=4,rwt=1,owt=2;s(A$i,"getRemoteAwareDisplayPath");s(kao,"getLayoutMode");s(Rao,"calculateLayoutDimensions");s(Iao,"calculateOptimalLeftWidth");s(iwt,"formatWelcomeMessage");s(uje,"truncatePath");cje=[],swt=null;s(Pao,"getRecentActivity");s(Oao,"getRecentActivitySync");s(awt,"getLogoDisplayData");s(Mao,"getStatusLineDisplayCwd");s(Dao,"formatModelAndBilling");s(Nao,"getRecentReleaseNotesSync")});function $ie({pose:e="default"}={}){let t=p$i[e];return(0,IL.jsxs)(O,{flexDirection:"column",children:[(0,IL.jsx)(_,{color:"clawd_body",children:t.top}),(0,IL.jsxs)(_,{children:[(0,IL.jsx)(_,{color:"clawd_body",children:t.middle.left}),(0,IL.jsx)(_,{color:"clawd_background",backgroundColor:"clawd_body",children:t.middle.center}),(0,IL.jsx)(_,{color:"clawd_body",children:t.middle.right})]}),(0,IL.jsxs)(_,{children:[(0,IL.jsx)(_,{color:"clawd_body",children:t.bottom.left}),(0,IL.jsx)(_,{backgroundColor:"clawd_body",children:" ".repeat(5)}),(0,IL.jsx)(_,{color:"clawd_body",children:t.bottom.right})]})]})}var IL,p$i,lwt=S(()=>{Xe();IL=U(Z()),p$i={default:{top:" /\\_/\\ ",middle:{left:"(",center:" o.o ",right:")"},bottom:{left:"/",right:"\\"}},"look-left":{top:" /\\_/\\ ",middle:{left:"(",center:" O.o ",right:")"},bottom:{left:"/",right:"\\"}},"look-right":{top:" /\\_/\\ ",middle:{left:"(",center:" o.O ",right:")"},bottom:{left:"/",right:"\\"}},"arms-up":{top:" /\\_/\\ ",middle:{left:"\\",center:" o.o ",right:"/"},bottom:{left:"/",right:"\\"}}};s($ie,"Clawd")});function Lao(e){let{title:t,lines:n,footer:r,emptyMessage:o,customContent:i}=e,a=en(t);if(i!==void 0)a=Math.max(a,i.width);else if(n.length===0&&o)a=Math.max(a,en(o));else{let c=Math.max(0,...n.map(u=>u.timestamp?en(u.timestamp):0));for(let u of n){let d=c>0?c:0,A=en(u.text)+(d>0?d+2:0);a=Math.max(a,A)}}return r&&(a=Math.max(a,en(r))),a}function Fao({config:e,actualWidth:t}){let{title:n,lines:r,footer:o,emptyMessage:i,customContent:a}=e,l=" ",c=Math.max(0,...r.map(u=>u.timestamp?en(u.timestamp):0));return(0,UT.jsxs)(O,{flexDirection:"column",width:t,children:[(0,UT.jsx)(_,{bold:!0,color:"claude",children:n}),a?(0,UT.jsxs)(UT.Fragment,{children:[a.content,o&&(0,UT.jsx)(_,{dimColor:!0,italic:!0,children:ka(o,t)})]}):r.length===0&&i?(0,UT.jsx)(_,{dimColor:!0,children:ka(i,t)}):(0,UT.jsxs)(UT.Fragment,{children:[r.map((u,d)=>{let A=Math.max(10,t-(c>0?c+l.length:0));return(0,UT.jsxs)(_,{children:[c>0&&(0,UT.jsxs)(UT.Fragment,{children:[(0,UT.jsx)(_,{dimColor:!0,children:(u.timestamp||"").padEnd(c)}),l]}),(0,UT.jsx)(_,{children:ka(u.text,A)})]},d)}),o&&(0,UT.jsx)(_,{dimColor:!0,italic:!0,children:ka(o,t)})]})]})}var UT,Uao=S(()=>{Vi();Xe();kr();UT=U(Z());s(Lao,"calculateFeedWidth");s(Fao,"Feed")});function $ao({feeds:e,maxWidth:t}){let n=e.map(i=>Lao(i)),r=Math.max(...n),o=Math.min(r,t);return(0,ITe.jsx)(O,{flexDirection:"column",children:e.map((i,a)=>(0,ITe.jsxs)(Bao.Fragment,{children:[(0,ITe.jsx)(Fao,{config:i,actualWidth:o}),a<e.length-1&&(0,ITe.jsx)(jd,{color:"claude",width:o})]},a))})}var Bao,ITe,Hao=S(()=>{Bao=U(et());Xe();IN();Uao();ITe=U(Z());s($ao,"FeedColumn")});async function m$i(e="claude_code_guest_pass"){let{accessToken:t,orgUUID:n}=await dS(),r={...mp(t),"x-organization-uuid":n},o=`${Kr().BASE_API_URL}/api/oauth/organizations/${n}/referral/eligibility`;return(await dn.get(o,{headers:r,params:{campaign:e},timeout:5e3})).data}async function qao(e="claude_code_guest_pass"){let{accessToken:t,orgUUID:n}=await dS(),r={...mp(t),"x-organization-uuid":n},o=`${Kr().BASE_API_URL}/api/oauth/organizations/${n}/referral/redemptions`;return(await dn.get(o,{headers:r,params:{campaign:e},timeout:1e4})).data}function Gao(){return!!(Au()?.organizationUuid&&to()&&Ei()==="max")}function PTe(){if(!Gao())return{eligible:!1,needsRefresh:!1,hasCache:!1};let e=Au()?.organizationUuid;if(!e)return{eligible:!1,needsRefresh:!1,hasCache:!1};let n=rt().passesEligibilityCache?.[e];if(!n)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:r,timestamp:o}=n,a=Date.now()-o>zao;return{eligible:r,needsRefresh:a,hasCache:!0}}function L7(e){let t=f$i[e.currency]??`${e.currency} `,n=e.amount_minor_units/100,r=n%1===0?n.toString():n.toFixed(2);return`${t}${r}`}function F7(){let e=Au()?.organizationUuid;return e?rt().passesEligibilityCache?.[e]?.referrer_reward??null:null}function cwt(){let e=Au()?.organizationUuid;return e?rt().passesEligibilityCache?.[e]?.remaining_passes??null:null}async function jao(){if(Aje)return v("Passes: Reusing in-flight eligibility fetch"),Aje;let e=Au()?.organizationUuid;return e?(Aje=(async()=>{try{let t=await m$i(),n={...t,timestamp:Date.now()};return kt(r=>({...r,passesEligibilityCache:{...r.passesEligibilityCache,[e]:n}})),v(`Passes eligibility cached for org ${e}: ${t.eligible}`),t}catch(t){return v("Failed to fetch and cache passes eligibility"),ne(t),null}finally{Aje=null}})(),Aje):null}async function Qhn(){if(!Gao())return null;let e=Au()?.organizationUuid;if(!e)return null;let n=rt().passesEligibilityCache?.[e],r=Date.now();if(!n)return v("Passes: No cache, fetching eligibility in background (command unavailable this session)"),jao(),null;if(r-n.timestamp>zao){v("Passes: Cache stale, returning cached data and refreshing in background"),jao();let{timestamp:a,...l}=n;return l}v("Passes: Using fresh cached eligibility data");let{timestamp:o,...i}=n;return i}async function Wao(){NA()||Qhn()}var zao,Aje,f$i,U7=S(()=>{Fi();yl();Cr();mn();it();wt();wv();Jy();zao=1440*60*1e3,Aje=null;s(m$i,"fetchReferralEligibility");s(qao,"fetchReferralRedemptions");s(Gao,"shouldCheckForPasses");s(PTe,"checkCachedPassesEligibility");f$i={USD:"$",EUR:"\u20AC",GBP:"\xA3",BRL:"R$",CAD:"CA$",AUD:"A$",NZD:"NZ$",SGD:"S$"};s(L7,"formatCreditAmount");s(F7,"getCachedReferrerReward");s(cwt,"getCachedRemainingPasses");s(jao,"fetchAndStorePassesEligibility");s(Qhn,"getCachedOrFetchPassesEligibility");s(Wao,"prefetchPassesEligibility")});import{homedir as g$i}from"os";function pje(e){let t=e.map(n=>{let r=BF(n.modified);return{text:(n.summary&&n.summary!=="No prompt"?n.summary:n.firstPrompt)||"",timestamp:r}});return{title:"Recent activity",lines:t,footer:t.length>0?"/resume for more":void 0,emptyMessage:"No recent activity"}}function Vao(e){let t=e.map(r=>({text:r}));return{title:"What's new",lines:t,footer:t.length>0?"/release-notes for more":void 0,emptyMessage:"Check the Claude Code changelog for updates"}}function Yao(e){let n=e.filter(({isEnabled:o})=>o).sort((o,i)=>Number(o.isComplete)-Number(i.isComplete)).map(({text:o,isComplete:i})=>({text:`${i?`${Ze.tick} `:""}${o}`})),r=_t()===g$i()?"Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.":void 0;return r&&n.push({text:r}),{title:"Tips for getting started",lines:n}}function Kao(){let e=F7(),t=e?`Share Claude Code and earn ${L7(e)} of extra usage`:"Share Claude Code with friends";return{title:"3 guest passes",lines:[],customContent:{content:(0,B7.jsxs)(B7.Fragment,{children:[(0,B7.jsx)(O,{marginY:1,children:(0,B7.jsx)(_,{color:"claude",children:"[\u273B] [\u273B] [\u273B]"})}),(0,B7.jsx)(_,{dimColor:!0,children:t})]}),width:48},footer:"/passes"}}var B7,Qao=S(()=>{oo();Xe();U7();xr();kr();B7=U(Z());s(pje,"createRecentActivityFeed");s(Vao,"createWhatsNewFeed");s(Yao,"createProjectOnboardingFeed");s(Kao,"createGuestPassesFeed")});function E3(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Zao(){let{pose:e,bounceOffset:t,onClick:n}=E$i();return(0,uwt.jsx)(O,{height:S$i,flexDirection:"column",onClick:n,children:(0,uwt.jsx)(O,{marginTop:t,flexShrink:0,children:(0,uwt.jsx)($ie,{pose:e})})})}function E$i(){let[e]=(0,Hie.useState)(()=>yr().prefersReducedMotion??!1),[t,n]=(0,Hie.useState)(-1),r=(0,Hie.useRef)(Jao),o=s(()=>{e||t!==-1||(r.current=Xao[Math.floor(Math.random()*Xao.length)],n(0))},"onClick");(0,Hie.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let l=setTimeout(n,y$i,b$i);return()=>clearTimeout(l)},[t]);let i=r.current,a=t>=0&&t<i.length?i[t]:_$i;return{pose:a.pose,bounceOffset:a.offset,onClick:o}}var Hie,uwt,Jao,h$i,Xao,_$i,y$i,b$i,S$i,elo=S(()=>{Hie=U(et());Xe();Mn();lwt();uwt=U(Z());s(E3,"hold");Jao=[...E3("default",1,2),...E3("arms-up",0,3),...E3("default",0,1),...E3("default",1,2),...E3("arms-up",0,3),...E3("default",0,1)],h$i=[...E3("look-right",0,5),...E3("look-left",0,5),...E3("default",0,1)],Xao=[Jao,h$i],_$i={pose:"default",offset:0},y$i=60,b$i=s(e=>e+1,"incrementFrame"),S$i=3;s(Zao,"AnimatedClawd");s(E$i,"useClawdAnimation")});function tlo({version:e,welcomeMessage:t,align:n="left",showVersion:r=!0}){return(0,v3.jsxs)(O,{flexDirection:"column",alignItems:n==="center"?"center":"flex-start",children:[(0,v3.jsxs)(_,{children:[(0,v3.jsx)(_,{color:"inactive",children:"/"}),(0,v3.jsx)(_,{color:"claude",bold:!0,children:fee}),r&&e?(0,v3.jsx)(_,{dimColor:!0,children:` v${e}`}):null]}),(0,v3.jsx)(_,{color:"claude",children:Trt}),t?(0,v3.jsx)(_,{dimColor:!0,children:t}):null]})}var v3,nlo=S(()=>{Xe();K5();v3=U(Z());s(tlo,"BrandWordmark")});function v$i(){let e=cwt();if(e==null||e<=0)return;let n=rt().passesLastSeenRemaining??0;e>n&&kt(r=>({...r,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function T$i(){let{eligible:e,hasCache:t}=PTe();if(!e||!t)return!1;v$i();let n=rt();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function dwt(){let[e]=(0,rlo.useState)(()=>T$i());return e}function Awt(){let e=0;kt(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),q("tengu_guest_passes_upsell_shown",{seen_count:e})}function olo(){let e=F7();return(0,OTe.jsxs)(_,{dimColor:!0,children:[(0,OTe.jsx)(_,{color:"claude",children:"[\u273B]"})," ",(0,OTe.jsx)(_,{color:"claude",children:"[\u273B]"})," ",(0,OTe.jsx)(_,{color:"claude",children:"[\u273B]"})," \xB7"," ",e?`Share Claude Code and earn ${L7(e)} of extra usage \xB7 /passes`:"3 guest passes at /passes"]})}var rlo,OTe,Xhn=S(()=>{rlo=U(et());Xe();vt();U7();mn();OTe=U(Z());s(v$i,"resetIfPassesRefreshed");s(T$i,"shouldShowGuestPassesUpsell");s(dwt,"useShowGuestPassesUpsell");s(Awt,"incrementGuestPassesSeenCount");s(olo,"GuestPassesUpsell")});function slo(){let{columns:e}=jn(),t=gt(M=>M.agent),n=gt(M=>M.effortValue),r=gt(M=>M.remoteCwd),o=vE(),i=W0e(o),{version:a,cwd:l,billingType:c,agentName:u}=awt({isRemoteMode:ri(),remoteCwd:r}),d=t??u,A=dwt(),p=jxt();(0,Jhn.useEffect)(()=>{A&&Awt()},[A]),(0,Jhn.useEffect)(()=>{p&&!A&&zxt()},[p,A]);let m=Math.max(e-15,20),f=ka(a,Math.max(m-13,6)),h=mhe(o,n),{shouldSplit:b,truncatedModel:E,truncatedBilling:x}=Dao(i+h,c,m),T=d?m-1-en(d)-3:m,R=uje(l,Math.max(T,10)),I=d?`@${d} \xB7 ${R}`:R;return(0,BT.jsx)(fT,{children:(0,BT.jsxs)(O,{flexDirection:"row",gap:2,alignItems:"center",children:[cs()?(0,BT.jsx)(Zao,{}):(0,BT.jsx)($ie,{}),(0,BT.jsxs)(O,{flexDirection:"column",children:[(0,BT.jsx)(tlo,{version:f}),b?(0,BT.jsxs)(BT.Fragment,{children:[(0,BT.jsx)(_,{dimColor:!0,children:E}),(0,BT.jsx)(_,{dimColor:!0,children:x})]}):(0,BT.jsxs)(_,{dimColor:!0,children:[E," \xB7 ",x]}),(0,BT.jsx)(_,{dimColor:!0,children:I}),A&&(0,BT.jsx)(olo,{}),!A&&p&&(0,BT.jsx)(qxt,{maxWidth:m,twoLine:!0})]})]})})}var Jhn,BT,ilo=S(()=>{Jhn=U(et());St();q2();xs();Vi();Xe();fr();Kv();kr();j_();dje();To();sQ();elo();nlo();lwt();Xhn();k2e();BT=U(Z());s(slo,"CondensedLogo")});function e_n(){let e=(0,mje.useMemo)(w$i,[]),t=(0,mje.useMemo)(()=>rt().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,mje.useEffect)(()=>{n&&kt(r=>r.lastShownEmergencyTip===e.tip?r:{...r,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,Zhn.jsx)(O,{paddingLeft:2,flexDirection:"column",children:(0,Zhn.jsx)(_,{...e.color==="warning"?{color:"warning"}:e.color==="error"?{color:"error"}:{dimColor:!0},children:e.tip})}):null}function w$i(){return LD(x$i,C$i)}var mje,Zhn,x$i,C$i,alo=S(()=>{mje=U(et());Xe();Yn();mn();Zhn=U(Z()),x$i="tengu-top-of-feed-tip";s(e_n,"EmergencyTip");C$i={tip:"",color:"dim"};s(w$i,"getTipOfFeed")});function t_n({char:e=A0}){let[t]=(0,jie.useState)(()=>yr().prefersReducedMotion??!1),[n,r]=(0,jie.useState)(t),o=(0,jie.useRef)(null),[i,a]=Xb(n?null:50);if((0,jie.useEffect)(()=>{if(n)return;let u=setTimeout(r,R$i,!0);return()=>clearTimeout(u)},[n]),n)return(0,fje.jsx)(O,{ref:i,children:(0,fje.jsx)(_,{color:I$i,children:e})});o.current===null&&(o.current=a);let c=(a-o.current)/llo*360%360;return(0,fje.jsx)(O,{ref:i,children:(0,fje.jsx)(_,{color:KN(f_t(c)),children:e})})}var jie,fje,llo,k$i,R$i,I$i,n_n=S(()=>{jie=U(et());du();Xe();Mn();m4();fje=U(Z()),llo=1500,k$i=2,R$i=llo*k$i,I$i=KN({r:153,g:153,b:153});s(t_n,"AnimatedAsterisk")});function clo(){return qh()&&(rt().opus1mMergeNoticeSeenCount??0)<P$i}function mwt(){let[e]=(0,pwt.useState)(clo);return(0,pwt.useEffect)(()=>{if(!e)return;let t=(rt().opus1mMergeNoticeSeenCount??0)+1;kt(n=>(n.opus1mMergeNoticeSeenCount??0)>=t?n:{...n,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,gje.jsxs)(O,{paddingLeft:2,children:[(0,gje.jsx)(t_n,{char:wnt}),(0,gje.jsxs)(_,{dimColor:!0,children:[" ","Clavue Opus now includes a 1M context window"]})]}):null}var pwt,gje,P$i,r_n=S(()=>{pwt=U(et());du();Xe();mn();To();n_n();gje=U(Z()),P$i=6;s(clo,"shouldShowOpus1mMergeNotice");s(mwt,"Opus1mMergeNotice")});function fwt(){return null}var ulo,dlo,Alo=S(()=>{ulo=U(et());Xe();mn();Mn();DEt();n_n();r_n();dlo=U(Z());s(fwt,"VoiceModeNotice")});function plo(){let e=Oao(),t=rt().oauthAccount?.displayName??"",{columns:n}=jn(),r=kXr(),o=tr.isSandboxingEnabled(),i=dwt(),a=jxt(),l=gt(ae=>ae.agent),c=gt(ae=>ae.effortValue),u=gt(ae=>ae.remoteCwd),d=gt(ae=>ae.remoteSessionUrl),A=rt(),p;try{p=Nao(3)}catch{p=[]}let[m]=(0,DTe.useState)(()=>{let ae=yr().companyAnnouncements;if(!(!ae||ae.length===0))return A.numStartups===1?ae[0]:ae[Math.floor(Math.random()*ae.length)]}),{hasReleaseNotes:f}=Nio(A.lastReleaseNotesSeen);(0,DTe.useEffect)(()=>{rt().lastReleaseNotesSeen!=="8.8.62"&&(kt(Se=>Se.lastReleaseNotesSeen==="8.8.62"?Se:{...Se,lastReleaseNotesSeen:"8.8.62"}),r&&RXr())},[A,r]);let h=!f&&!r&&!qe(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,DTe.useEffect)(()=>{i&&!r&&!h&&Awt()},[i,r,h]),(0,DTe.useEffect)(()=>{a&&!r&&!i&&!h&&zxt()},[a,r,i,h]);let b=vE(),E=W0e(b),{version:x,cwd:T,billingType:R,agentName:I}=awt({isRemoteMode:ri(),remoteCwd:u}),M=l??I,N=mhe(b,c),F=ka(E+N,o_n-20);if(!f&&!r&&!qe(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,Us.jsxs)(Us.Fragment,{children:[(0,Us.jsx)(slo,{}),(0,Us.jsx)(fwt,{}),(0,Us.jsx)(mwt,{}),MTe&&(0,Us.jsx)(MTe.ChannelsNotice,{}),hw()&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[(0,Us.jsx)(_,{color:"warning",children:"Debug mode enabled"}),(0,Us.jsxs)(_,{dimColor:!0,children:["Logging to: ",UF()?"stderr":BJ()]})]}),(0,Us.jsx)(e_n,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[(0,Us.jsxs)(_,{dimColor:!0,children:["tmux session: ",process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,Us.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[!process.env.IS_DEMO&&A.oauthAccount?.organizationName&&(0,Us.jsxs)(_,{dimColor:!0,children:["Message from ",A.oauthAccount.organizationName,":"]}),(0,Us.jsx)(_,{children:m})]}),!1,!1,!1,!1]});let D=kao(n),L=FH(rt().theme),B=` ${Ar("claude",L)("Clavue")} ${Ar("inactive",L)(`v${x}`)} `,z=Ar("claude",L)(" Clavue ");if(D==="compact"){let Se=iwt(t);en(Se)>n-4&&(Se=iwt(null));let Ie=M?n-4-"@".length-en(M)-" \xB7 ".length:n-4,xe=uje(T,Math.max(Ie,10));return(0,Us.jsxs)(Us.Fragment,{children:[(0,Us.jsx)(fT,{children:(0,Us.jsxs)(O,{flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:{content:z,position:"top",align:"start",offset:1},paddingX:1,paddingY:1,alignItems:"center",width:n,children:[(0,Us.jsx)(_,{bold:!0,children:Se}),(0,Us.jsx)(O,{marginY:1,children:(0,Us.jsx)($ie,{})}),(0,Us.jsx)(_,{dimColor:!0,children:F}),(0,Us.jsx)(_,{dimColor:!0,children:R}),(0,Us.jsx)(_,{dimColor:!0,children:M?`@${M} \xB7 ${xe}`:xe})]})}),(0,Us.jsx)(fwt,{}),(0,Us.jsx)(mwt,{}),MTe&&(0,Us.jsx)(MTe.ChannelsNotice,{}),o&&(0,Us.jsx)(O,{marginTop:1,flexDirection:"column",children:(0,Us.jsx)(_,{color:"warning",children:"Your bash commands will be sandboxed. Disable with /sandbox."})}),!1,!1]})}let G=iwt(t),H=!process.env.IS_DEMO&&A.oauthAccount?.organizationName?`${F} \xB7 ${R} \xB7 ${A.oauthAccount.organizationName}`:`${F} \xB7 ${R}`,K=M?o_n-"@".length-en(M)-" \xB7 ".length:o_n,ee=uje(T,Math.max(K,10)),ge=M?`@${M} \xB7 ${ee}`:ee,fe=Iao(G,ge,H),{leftWidth:de,rightWidth:oe}=Rao(n,D,fe);return(0,Us.jsxs)(Us.Fragment,{children:[(0,Us.jsx)(fT,{children:(0,Us.jsx)(O,{flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:{content:B,position:"top",align:"start",offset:3},children:(0,Us.jsxs)(O,{flexDirection:D==="horizontal"?"row":"column",paddingX:1,gap:1,children:[(0,Us.jsxs)(O,{flexDirection:"column",width:de,justifyContent:"space-between",alignItems:"center",minHeight:9,children:[(0,Us.jsx)(O,{marginTop:1,children:(0,Us.jsx)(_,{bold:!0,children:G})}),(0,Us.jsx)($ie,{}),(0,Us.jsxs)(O,{flexDirection:"column",alignItems:"center",children:[(0,Us.jsx)(_,{dimColor:!0,children:H}),(0,Us.jsx)(_,{dimColor:!0,children:ge})]})]}),D==="horizontal"&&(0,Us.jsx)(O,{height:"100%",borderStyle:"single",borderColor:"claude",borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),D==="horizontal"&&(0,Us.jsx)($ao,{feeds:r?[Yao(Cmn()),pje(e)]:i?[pje(e),Kao()]:a?[pje(e),keo()]:[pje(e),Vao(p)],maxWidth:oe})]})})}),(0,Us.jsx)(fwt,{}),(0,Us.jsx)(mwt,{}),MTe&&(0,Us.jsx)(MTe.ChannelsNotice,{}),hw()&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[(0,Us.jsx)(_,{color:"warning",children:"Debug mode enabled"}),(0,Us.jsxs)(_,{dimColor:!0,children:["Logging to: ",UF()?"stderr":BJ()]})]}),(0,Us.jsx)(e_n,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[(0,Us.jsxs)(_,{dimColor:!0,children:["tmux session: ",process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,Us.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,Us.jsxs)(O,{paddingLeft:2,flexDirection:"column",children:[!process.env.IS_DEMO&&A.oauthAccount?.organizationName&&(0,Us.jsxs)(_,{dimColor:!0,children:["Message from ",A.oauthAccount.organizationName,":"]}),(0,Us.jsx)(_,{children:m})]}),o&&(0,Us.jsx)(O,{paddingLeft:2,flexDirection:"column",children:(0,Us.jsx)(_,{color:"warning",children:"Your bash commands will be sandboxed. Disable with /sandbox."})}),!1,!1,!1,!1]})}var DTe,Us,MTe,o_n,mlo=S(()=>{Xe();xs();Vi();dje();kr();oi();lwt();Hao();Qao();mn();Ufe();Mn();it();DTe=U(et());d2e();ilo();sQ();wTe();sV();Ot();HF();alo();Alo();r_n();St();Td();Xhn();k2e();fr();Kv();q2();To();Us=U(Z()),MTe=null,o_n=50;s(plo,"LogoV2")});function flo({message:e,isTranscriptMode:t}){return t&&e.type==="assistant"&&e.message.model&&e.message.content.some(r=>r.type==="text")?(0,s_n.jsx)(O,{minWidth:en(e.message.model)+8,children:(0,s_n.jsx)(_,{dimColor:!0,children:e.message.model})}):null}var s_n,glo=S(()=>{Vi();Xe();s_n=U(Z());s(flo,"MessageModel")});function hlo({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type==="assistant"&&e.message.content.some(o=>o.type==="text")))return null;let r=new Date(e.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0});return(0,i_n.jsx)(O,{minWidth:en(r),children:(0,i_n.jsx)(_,{dimColor:!0,children:r})})}var i_n,_lo=S(()=>{Vi();Xe();i_n=U(Z());s(hlo,"MessageTimestamp")});function blo(e,t,n,r){for(let o=t+1;o<e.length;o++){let i=e[o];if(i?.type==="assistant"){let a=i.message.content[0];if(a?.type==="thinking"||a?.type==="redacted_thinking"||a?.type==="tool_use"&&(Bse(a.name,a.input,n).isCollapsible||r.has(a.id)))continue;return!0}if(!(i?.type==="system"||i?.type==="attachment")&&!(i?.type==="user"&&i.message.content[0]?.type==="tool_result")){if(i?.type==="grouped_tool_use"){let a=i.messages[0]?.message.content[0]?.input;if(Bse(i.toolName,a,n).isCollapsible)continue}return!0}}return!1}function O$i({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:o,verbose:i,inProgressToolUseIDs:a,streamingToolUseIDs:l,screen:c,canAnimate:u,onOpenRateLimitOptions:d,lastThinkingBlockId:A,latestBashOutputUUID:p,columns:m,isLoading:f,lookups:h}){let b=c==="transcript",E=e.type==="grouped_tool_use",x=e.type==="collapsed_read_search",T=x&&(ddn(e,a)||f&&!n),R=E?e.displayMessage:x?WKr(e):e,I=E||x?[]:T7r(e,h),M=E||x?OTt:v7r(e,h),N=vlo(e,l,a,M,c,h),F=!1;if(u)if(E)F=e.messages.some(B=>{let z=B.message.content[0];return z?.type==="tool_use"&&a.has(z.id)});else if(x)F=ddn(e,a);else{let B=n3(e);F=!B||a.has(B)}let D=b&&R.type==="assistant"&&R.message.content.some(B=>B.type==="text")&&(R.timestamp||R.message.model),L=(0,T3.jsx)(qN,{message:e,lookups:h,addMargin:!D,containerWidth:D?void 0:m,tools:r,commands:o,verbose:i,inProgressToolUseIDs:a,progressMessagesForMessage:I,shouldAnimate:F,shouldShowDot:!0,isTranscriptMode:b,isStatic:N,onOpenRateLimitOptions:d,isActiveCollapsedGroup:T,isUserContinuation:t,lastThinkingBlockId:A,latestBashOutputUUID:p});return D?(0,T3.jsx)(fT,{children:(0,T3.jsxs)(O,{width:m,flexDirection:"column",children:[(0,T3.jsxs)(O,{flexDirection:"row",justifyContent:"flex-end",gap:1,marginTop:1,children:[(0,T3.jsx)(hlo,{message:R,isTranscriptMode:b}),(0,T3.jsx)(flo,{message:R,isTranscriptMode:b})]}),L]})}):(0,T3.jsx)(fT,{children:L})}function M$i(e,t){if(e.type==="grouped_tool_use")return e.messages.some(r=>{let o=r.message.content[0];return o?.type==="tool_use"&&t.has(o.id)});if(e.type==="collapsed_read_search")return gbe(e).some(o=>t.has(o));let n=n3(e);return!!n&&t.has(n)}function D$i(e,t){if(e.type==="grouped_tool_use")return e.messages.every(r=>{let o=r.message.content[0];return o?.type==="tool_use"&&t.has(o.id)});if(e.type==="collapsed_read_search")return gbe(e).every(o=>t.has(o));if(e.type==="assistant"){let r=e.message.content[0];if(r?.type==="server_tool_use")return t.has(r.id)}let n=n3(e);return!n||t.has(n)}function N$i(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type==="collapsed_read_search"&&t.screen!=="transcript"||e.columns!==t.columns)return!1;let n=e.latestBashOutputUUID===e.message.uuid,r=t.latestBashOutputUUID===t.message.uuid;if(n!==r||e.lastThinkingBlockId!==t.lastThinkingBlockId&&znn(t.message))return!1;let o=M$i(e.message,e.streamingToolUseIDs),i=D$i(e.message,e.lookups.resolvedToolUseIDs);return!(o||!i)}var ylo,T3,Slo,Elo=S(()=>{ylo=U(et());Xe();n4();Ln();ybe();glo();hje();_lo();sQ();T3=U(Z());s(blo,"hasContentAfterIndex");s(O$i,"MessageRowImpl");s(M$i,"isMessageStreaming");s(D$i,"allToolsResolved");s(N$i,"areMessageRowPropsEqual");Slo=ylo.memo(O$i,N$i)});function gwt(e){return e.type==="attachment"&&F$i.has(e.attachment.type)}var L$i,F$i,a_n=S(()=>{L$i=["hook_success","hook_additional_context","hook_cancelled","command_permissions","agent_mention","budget_usd","critical_system_reminder","edited_image_file","edited_text_file","opened_file_in_ide","output_style","plan_mode","plan_mode_exit","plan_mode_reentry","structured_output","team_context","todo_reminder","context_efficiency","deferred_tools_delta","mcp_instructions_delta","companion_intro","token_usage","ultrathink_effort","max_turns_reached","task_reminder","auto_mode","auto_mode_exit","output_token_usage","pen_mode_enter","pen_mode_exit","verify_plan_reminder","current_session_memory","project_knowledge","project_knowledge_page","compaction_reminder","date_change"],F$i=new Set(L$i);s(gwt,"isNullRenderingAttachment")});import{relative as U$i}from"path";function Tlo(e){return G$i.filter(t=>t.isActive(e))}var Vd,B$i,$$i,H$i,j$i,z$i,q$i,G$i,xlo=S(()=>{Xe();Gy();oo();xr();kr();Cr();ngn();gf();qZt();Vd=U(Z()),B$i={id:"large-memory-files",type:"warning",isActive:s(e=>mne(e.memoryFiles).length>0,"isActive"),render:s(e=>{let t=mne(e.memoryFiles);return(0,Vd.jsx)(Vd.Fragment,{children:t.map(n=>{let r=n.path.startsWith(_t())?U$i(_t(),n.path):n.path;return(0,Vd.jsxs)(O,{flexDirection:"row",children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Large ",(0,Vd.jsx)(_,{bold:!0,children:r})," will impact performance (",hi(n.content.length)," chars >"," ",hi(rV),")",(0,Vd.jsx)(_,{dimColor:!0,children:" \xB7 /memory to edit"})]})]},n.path)})})},"render")},$$i={id:"claude-ai-external-token",type:"warning",isActive:s(()=>{let e=mD();return to()&&(e.source==="ANTHROPIC_AUTH_TOKEN"||e.source==="apiKeyHelper")},"isActive"),render:s(()=>{let e=mD();return(0,Vd.jsxs)(O,{flexDirection:"row",marginTop:1,children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Auth conflict: Using ",e.source," instead of Claude account subscription token. Either unset ",e.source,", or run `claude /logout`."]})]})},"render")},H$i={id:"api-key-conflict",type:"warning",isActive:s(()=>{let{source:e}=Wp({skipRetrievingKeyFromApiKeyHelper:!0});return!!mfe()&&(e==="ANTHROPIC_API_KEY"||e==="apiKeyHelper")},"isActive"),render:s(()=>{let{source:e}=Wp({skipRetrievingKeyFromApiKeyHelper:!0});return(0,Vd.jsxs)(O,{flexDirection:"row",marginTop:1,children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Auth conflict: Using ",e," instead of Anthropic Console key. Either unset ",e,", or run `claude /logout`."]})]})},"render")},j$i={id:"both-auth-methods",type:"warning",isActive:s(()=>{let{source:e}=Wp({skipRetrievingKeyFromApiKeyHelper:!0}),t=mD();return e!=="none"&&t.source!=="none"&&!(e==="apiKeyHelper"&&t.source==="apiKeyHelper")},"isActive"),render:s(()=>{let{source:e}=Wp({skipRetrievingKeyFromApiKeyHelper:!0}),t=mD();return(0,Vd.jsxs)(O,{flexDirection:"column",marginTop:1,children:[(0,Vd.jsxs)(O,{flexDirection:"row",children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Auth conflict: Both a token (",t.source,") and an API key (",e,") are set. This may lead to unexpected behavior."]})]}),(0,Vd.jsxs)(O,{flexDirection:"column",marginLeft:3,children:[(0,Vd.jsxs)(_,{color:"warning",children:["\xB7 Trying to use"," ",t.source==="claude.ai"?"claude.ai":t.source,"?"," ",e==="ANTHROPIC_API_KEY"?'Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.':e==="apiKeyHelper"?"Unset the apiKeyHelper setting.":"claude /logout"]}),(0,Vd.jsxs)(_,{color:"warning",children:["\xB7 Trying to use ",e,"?"," ",t.source==="claude.ai"?"claude /logout to sign out of claude.ai.":`Unset the ${t.source} environment variable.`]})]})]})},"render")},z$i={id:"large-agent-descriptions",type:"warning",isActive:s(e=>D2e(e.agentDefinitions)>bie,"isActive"),render:s(e=>{let t=D2e(e.agentDefinitions);return(0,Vd.jsxs)(O,{flexDirection:"row",children:[(0,Vd.jsx)(_,{color:"warning",children:Ze.warning}),(0,Vd.jsxs)(_,{color:"warning",children:["Large cumulative agent descriptions will impact performance (~",hi(t)," tokens >"," ",hi(bie),")",(0,Vd.jsx)(_,{dimColor:!0,children:" \xB7 /agents to manage"})]})]})},"render")},q$i={id:"jetbrains-plugin-install",type:"info",isActive:s(e=>{if(!fye()||!(e.config.autoInstallIdeExtension??!0))return!1;let n=pye();return n!==null&&!nRr(n)},"isActive"),render:s(()=>{let e=pye(),t=mg(e);return(0,Vd.jsxs)(O,{flexDirection:"row",gap:1,marginLeft:1,children:[(0,Vd.jsx)(_,{color:"ide",children:Ze.arrowUp}),(0,Vd.jsxs)(_,{children:["Install the ",(0,Vd.jsx)(_,{color:"ide",children:t})," plugin from the JetBrains Marketplace:"," ",(0,Vd.jsx)(_,{bold:!0,children:"https://docs.\u0063laude.com/s/claude-code-jetbrains"})]})]})},"render")},G$i=[B$i,z$i,$$i,H$i,j$i,q$i];s(Tlo,"getActiveNotices")});function klo({agentDefinitions:e}={}){let t={config:rt(),agentDefinitions:e,memoryFiles:(0,wlo.use)(Xh())},n=Tlo(t);return n.length===0?null:(0,l_n.jsx)(O,{flexDirection:"column",paddingLeft:1,children:n.map(r=>(0,l_n.jsx)(Clo.Fragment,{children:r.render(t)},r.id))})}var Clo,wlo,l_n,Rlo=S(()=>{Clo=U(et()),wlo=U(et());Xe();Gy();mn();xlo();l_n=U(Z());s(klo,"StatusNotices")});function Ilo(e,t,n){let r=(0,WA.useRef)(new Map),o=(0,WA.useRef)(0),i=(0,WA.useRef)(0),a=(0,WA.useRef)({arr:new Float64Array(0),version:-1,n:-1}),l=(0,WA.useRef)(new Map),c=(0,WA.useRef)(new Map),u=(0,WA.useRef)(n),d=(0,WA.useRef)(!1),A=(0,WA.useRef)(null),p=(0,WA.useRef)(0);if(u.current!==n){let Se=u.current/n;u.current=n;for(let[Me,Te]of r.current)r.current.set(Me,Math.max(1,Math.round(Te*Se)));o.current++,d.current=!0,p.current=2}let m=p.current>0?A.current:null,f=(0,WA.useRef)(0),h=(0,WA.useRef)(null),b=(0,WA.useCallback)(Se=>e.current?.subscribe(Se)??K$i,[e]);(0,WA.useSyncExternalStore)(b,()=>{let Se=e.current;if(!Se)return NaN;let Me=Se.getScrollTop()+Se.getPendingDelta(),Te=Math.floor(Me/Y$i);return Se.isSticky()?~Te:Te});let E=e.current?.getScrollTop()??-1,x=e.current?.getPendingDelta()??0,T=e.current?.getViewportHeight()??0,R=e.current?.isSticky()??!0;(0,WA.useMemo)(()=>{let Se=new Set(t),Me=!1;for(let Te of r.current.keys())Se.has(Te)||(r.current.delete(Te),Me=!0);for(let Te of c.current.keys())Se.has(Te)||c.current.delete(Te);Me&&o.current++},[t]);let I=t.length;if(a.current.version!==o.current||a.current.n!==I){let Se=a.current.arr.length>=I+1?a.current.arr:new Float64Array(I+1);Se[0]=0;for(let Me=0;Me<I;Me++)Se[Me+1]=Se[Me]+(r.current.get(t[Me])??W$i);a.current={arr:Se,version:o.current,n:I}}let M=a.current.arr,N=M[I],F,D;if(m)[F,D]=m,F=Math.min(F,I),D=Math.min(D,I);else if(T===0||E<0)F=Math.max(0,I-V$i),D=I;else{if(R){let re=T+NTe;for(F=I;F>0&&N-M[F-1]<re;)F--;D=I}else{let re=f.current,te=T*3,ue=Math.min(E,E+x),Ae=Math.max(E,E+x),ie=Ae-ue,be=ie>te&&x<0?Ae-te:ue,Pe=be+Math.min(ie,te),Re=Math.max(0,be-re),Ue=Pe-re,Ee=Re-NTe;{let Ne=0,nt=I;for(;Ne<nt;){let ct=Ne+nt>>1;M[ct+1]<=Ee?Ne=ct+1:nt=ct}F=Ne}{let Ne=A.current;if(Ne&&Ne[0]<F)for(let nt=Ne[0];nt<Math.min(F,Ne[1]);nt++){let ct=t[nt];if(l.current.has(ct)&&!r.current.has(ct)){F=nt;break}}}let De=T+2*NTe,ke=Math.min(I,F+_je),tt=0;for(D=F;D<ke&&(tt<De||M[D]<Ue+T+NTe);)tt+=r.current.get(t[D])??c_n,D++}let Se=T+2*NTe,Me=Math.max(0,D-_je),Te=0;for(let re=F;re<D;re++)Te+=r.current.get(t[re])??c_n;for(;F>Me&&Te<Se;)F--,Te+=r.current.get(t[F])??c_n;let Ie=A.current,xe=Math.abs(E-i.current)+Math.abs(x);if(Ie&&xe>T*2){let[re,te]=Ie;F<re-yje&&(F=re-yje),D>te+yje&&(D=te+yje),F>D&&(D=Math.min(F+yje,I))}i.current=E}p.current>0?p.current--:A.current=[F,D];let L=(0,WA.useDeferredValue)(F),B=(0,WA.useDeferredValue)(D),z=F<L?L:F,G=D>B?B:D;if((z>G||R)&&(z=F,G=D),x>0&&(G=D),G-z>_je){let Se=(M[z]+M[G])/2;E-f.current<Se?G=z+_je:z=G-_je}let H=f.current,W=M[z],Y=z===0?0:W+H,K=G===I?1/0:Math.max(W,M[G]-T)+H;(0,WA.useLayoutEffect)(()=>{R?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(Y,K)}),(0,WA.useLayoutEffect)(()=>{let Se=h.current?.yogaNode;if(Se&&Se.getComputedWidth()>0&&(f.current=Se.getComputedTop()),d.current){d.current=!1;return}let Me=!1;for(let[Te,Ie]of l.current){let xe=Ie.yogaNode;if(!xe)continue;let re=xe.getComputedHeight(),te=r.current.get(Te);re>0?te!==re&&(r.current.set(Te,re),Me=!0):xe.getComputedWidth()>0&&te!==0&&(r.current.set(Te,0),Me=!0)}Me&&o.current++});let ee=(0,WA.useCallback)(Se=>{let Me=c.current.get(Se);return Me||(Me=s(Te=>{if(Te)l.current.set(Se,Te);else{let Ie=l.current.get(Se)?.yogaNode;if(Ie&&!d.current){let xe=Ie.getComputedHeight();(xe>0||Ie.getComputedWidth()>0)&&r.current.get(Se)!==xe&&(r.current.set(Se,xe),o.current++)}l.current.delete(Se)}},"fn"),c.current.set(Se,Me)),Me},[]),ge=(0,WA.useCallback)(Se=>{let Me=l.current.get(t[Se])?.yogaNode;return!Me||Me.getComputedWidth()===0?-1:Me.getComputedTop()},[t]),fe=(0,WA.useCallback)(Se=>l.current.get(t[Se])??null,[t]),de=(0,WA.useCallback)(Se=>r.current.get(t[Se]),[t]),oe=(0,WA.useCallback)(Se=>{let Me=a.current;Se<0||Se>=Me.n||e.current?.scrollTo(Me.arr[Se]+f.current)},[e]),ae=N-M[G];return{range:[z,G],topSpacer:W,bottomSpacer:ae,measureRef:ee,spacerRef:h,offsets:M,getItemTop:ge,getItemElement:fe,getItemHeight:de,scrollToIndex:oe}}var WA,W$i,NTe,V$i,Y$i,c_n,_je,yje,K$i,Plo=S(()=>{WA=U(et()),W$i=3,NTe=80,V$i=30,Y$i=NTe>>1,c_n=1,_je=300,yje=25,K$i=s(()=>{},"NOOP_UNSUB");s(Ilo,"useVirtualScroll")});function Llo({children:e}){let[t,n]=(0,UC.useState)(null),[r,o]=(0,UC.useState)(null);return(0,bje.jsx)(Mlo.Provider,{value:n,children:(0,bje.jsx)(Nlo.Provider,{value:o,children:(0,bje.jsx)(Olo.Provider,{value:t,children:(0,bje.jsx)(Dlo.Provider,{value:r,children:e})})})})}function Flo(){return(0,UC.useContext)(Olo)}function Ulo(){return(0,UC.useContext)(Dlo)}function Blo(e){let t=(0,UC.useContext)(Mlo);(0,UC.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function $lo(e){let t=(0,UC.useContext)(Nlo);(0,UC.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var UC,bje,Olo,Mlo,Dlo,Nlo,hwt=S(()=>{UC=U(et()),bje=U(Z()),Olo=(0,UC.createContext)(null),Mlo=(0,UC.createContext)(null),Dlo=(0,UC.createContext)(null),Nlo=(0,UC.createContext)(null);s(Llo,"PromptOverlayProvider");s(Flo,"usePromptOverlay");s(Ulo,"usePromptOverlayDialog");s(Blo,"useSetPromptOverlay");s($lo,"useSetPromptOverlayDialog")});import{fileURLToPath as Q$i}from"url";function jlo(e){let[t,n]=(0,Eg.useState)(null),r=(0,Eg.useRef)(e);r.current=e;let o=(0,Eg.useRef)(null),i=(0,Eg.useCallback)(()=>{n(null)},[]),a=(0,Eg.useCallback)(u=>{let d=Math.max(0,u.getScrollHeight()-u.getViewportHeight());u.getScrollTop()+u.getPendingDelta()>=d||o.current===null&&(o.current=u.getScrollHeight(),n(r.current))},[]),l=(0,Eg.useCallback)(u=>{u&&u.scrollToBottom()},[]);(0,Eg.useEffect)(()=>{t===null?o.current=null:e<t&&(o.current=null,n(null))},[e,t]);let c=(0,Eg.useCallback)((u,d)=>{n(A=>A===null?null:A+u),o.current!==null&&(o.current+=d)},[]);return{dividerIndex:t,dividerYRef:o,onScrollAway:a,onRepin:i,jumpToNew:l,shiftDivider:c}}function X$i(e,t){let n=0,r=!1;for(let o=t;o<e.length;o++){let i=e[o];if(i.type==="progress"||i.type==="assistant"&&!J$i(i))continue;let a=i.type==="assistant";a&&!r&&n++,r=a}return n}function J$i(e){if(e.type!=="assistant")return!1;for(let t of e.message.content)if(t.type==="text"&&t.text.trim()!=="")return!0;return!1}function zlo(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type==="progress"||gwt(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let o=X$i(e,t);return{firstUnseenUuid:r,count:Math.max(1,o)}}function d_n({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:o,modalScrollRef:i,scrollRef:a,dividerYRef:l,hidePill:c=!1,hideSticky:u=!1,newMessageCount:d=0,onPillClick:A}){let{rows:p,columns:m}=jn(),[f,h]=(0,Eg.useState)(null),b=(0,Eg.useMemo)(()=>({setStickyPrompt:h}),[]),E=(0,Eg.useCallback)(T=>a?.current?.subscribe(T)??(()=>{}),[a]),x=(0,Eg.useSyncExternalStore)(E,()=>{let T=a?.current,R=l?.current;return!T||R==null?!1:T.getScrollTop()+T.getPendingDelta()+T.getViewportHeight()<R});if((0,Eg.useLayoutEffect)(()=>{if(!cs())return;let T=UA.get(process.stdout);if(T)return T.onHyperlinkClick=R=>{if(R.startsWith("file:"))try{Y_e(Q$i(R))}catch{}else Al(R)},()=>{T.onHyperlinkClick=void 0}},[]),cs()){let T=u?null:f,R=T!=null&&T!=="clicked"&&n==null?T:null,I=T!=null&&n==null;return(0,hp.jsxs)(Llo,{children:[(0,hp.jsxs)(O,{flexGrow:1,flexDirection:"column",overflow:"hidden",children:[R&&(0,hp.jsx)(eHi,{text:R.text,onClick:R.scrollTo}),(0,hp.jsxs)(Gve,{ref:a,flexGrow:1,flexDirection:"column",paddingTop:I?0:1,stickyScroll:!0,children:[(0,hp.jsx)(u_n,{value:b,children:e}),n]}),!c&&x&&n==null&&(0,hp.jsx)(Z$i,{count:d,onClick:A}),r!=null&&(0,hp.jsx)(O,{position:"absolute",bottom:0,right:0,opaque:!0,children:r})]}),(0,hp.jsxs)(O,{flexDirection:"column",flexShrink:0,width:"100%",maxHeight:"50%",children:[(0,hp.jsx)(tHi,{}),(0,hp.jsx)(nHi,{}),(0,hp.jsx)(O,{flexDirection:"column",width:"100%",flexGrow:1,overflowY:"hidden",children:t})]}),o!=null&&(0,hp.jsx)(t1e,{value:{rows:p-Hlo-1,columns:m-4,scrollRef:i??null},children:(0,hp.jsxs)(O,{position:"absolute",bottom:0,left:0,right:0,maxHeight:p-Hlo,flexDirection:"column",overflow:"hidden",opaque:!0,children:[(0,hp.jsx)(O,{flexShrink:0,children:(0,hp.jsx)(_,{color:"permission",children:"\u2594".repeat(m)})}),(0,hp.jsx)(O,{flexDirection:"column",paddingX:2,flexShrink:0,overflow:"hidden",children:o})]})})]})}return(0,hp.jsxs)(hp.Fragment,{children:[e,t,n,o]})}function Z$i({count:e,onClick:t}){let[n,r]=(0,Eg.useState)(!1);return(0,hp.jsx)(O,{position:"absolute",bottom:0,left:0,right:0,justifyContent:"center",children:(0,hp.jsx)(O,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,hp.jsxs)(_,{backgroundColor:n?"userMessageBackgroundHover":"userMessageBackground",dimColor:!0,children:[" ",e>0?`${e} new ${Qn(e,"message")}`:"Jump to bottom"," ",Ze.arrowDown," "]})})})}function eHi({text:e,onClick:t}){let[n,r]=(0,Eg.useState)(!1);return(0,hp.jsx)(O,{flexShrink:0,width:"100%",height:1,paddingRight:1,backgroundColor:n?"userMessageBackgroundHover":"userMessageBackground",onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,hp.jsxs)(_,{color:"subtle",wrap:"truncate-end",children:[Ze.pointer," ",e]})})}function tHi(){let e=Flo();return!e||e.suggestions.length===0?null:(0,hp.jsx)(O,{position:"absolute",bottom:"100%",left:0,right:0,paddingX:2,paddingTop:1,flexDirection:"column",opaque:!0,children:(0,hp.jsx)(TJr,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function nHi(){let e=Ulo();return e?(0,hp.jsx)(O,{position:"absolute",bottom:"100%",left:0,right:0,opaque:!0,children:e}):null}var Eg,hp,Hlo,u_n,A_n=S(()=>{oo();Eg=U(et());M2();hwt();xs();gxt();GR();Xe();e_();j_();Do();a_n();fxt();hp=U(Z()),Hlo=2,u_n=(0,Eg.createContext)({setStickyPrompt:s(()=>{},"setStickyPrompt")});s(jlo,"useUnseenDivider");s(X$i,"countUnseenAssistantTurns");s(J$i,"assistantHasVisibleText");s(zlo,"computeUnseenDivider");s(d_n,"FullscreenLayout");s(Z$i,"NewMessagesPill");s(eHi,"StickyPromptHeader");s(tHi,"SuggestionsOverlay");s(nHi,"DialogOverlay")});function rHi(e){let t=qlo.get(e);if(t!==void 0)return t;let n=nwt(e);return qlo.set(e,n),n}function sHi(e){let t=Glo.get(e);if(t!==void 0)return t;let n=iHi(e);return Glo.set(e,n),n}function iHi(e){let t=null;if(e.type==="user"){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let r=e.message.content[0];if(r?.type!=="text")return null;t=r.text}else if(e.type==="attachment"&&e.attachment.type==="queued_command"&&e.attachment.commandMode!=="task-notification"&&!e.attachment.isMeta){let r=e.attachment.prompt;t=typeof r=="string"?r:r.flatMap(o=>o.type==="text"?[o.text]:[]).join(`
|
|
5994
5994
|
`)}if(t===null)return null;let n=wFe(t);return n.startsWith("<")||n===""?null:n}function aHi({itemKey:e,msg:t,idx:n,measureRef:r,expanded:o,hovered:i,clickable:a,onClickK:l,onEnterK:c,onLeaveK:u,renderItem:d}){return(0,fB.jsx)(O,{ref:r(e),flexDirection:"column",backgroundColor:o?"userMessageBackgroundHover":void 0,paddingBottom:o?1:void 0,onClick:a?A=>l(t,A.cellIsBlank):void 0,onMouseEnter:a?()=>c(e):void 0,onMouseLeave:a?()=>u(e):void 0,children:(0,fB.jsx)(c5t.Provider,{value:i&&!o?"text":void 0,children:d(t,n)})})}function Wlo({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:o,onItemClick:i,isItemClickable:a,isItemExpanded:l,extractSearchText:c=rHi,trackStickyPrompt:u,selectedIndex:d,cursorNavRef:A,setCursor:p,jumpRef:m,onSearchMatchesChange:f,scanElement:h,setPositions:b}){let E=(0,dc.useRef)([]),x=(0,dc.useRef)(e),T=(0,dc.useRef)(r);if(T.current!==r||e.length<E.current.length||e[0]!==x.current[0])E.current=e.map(Ne=>r(Ne));else for(let Ne=E.current.length;Ne<e.length;Ne++)E.current.push(r(e[Ne]));x.current=e,T.current=r;let R=E.current,{range:I,topSpacer:M,bottomSpacer:N,measureRef:F,spacerRef:D,offsets:L,getItemTop:B,getItemElement:z,getItemHeight:G,scrollToIndex:H}=Ilo(t,R,n),[W,Y]=I,K=(0,dc.useCallback)(Ne=>G(Ne)===0?!1:PCr(e[Ne]),[G,e]);(0,dc.useImperativeHandle)(A,()=>{let Ne=s($e=>p?.({uuid:$e.uuid,msgType:$e.type,expanded:!1,toolName:zpt($e)?.name}),"select"),nt=d??-1,ct=s(($e,Ge,pe=K)=>{for(let ve=$e;ve>=0&&ve<e.length;ve+=Ge)if(pe(ve))return Ne(e[ve]),!0;return!1},"scan"),Qe=s($e=>K($e)&&e[$e].type==="user","isUser");return{enterCursor:s(()=>ct(e.length-1,-1,Qe),"enterCursor"),navigatePrev:s(()=>ct(nt-1,-1),"navigatePrev"),navigateNext:s(()=>{ct(nt+1,1)||(t.current?.scrollToBottom(),p?.(null))},"navigateNext"),navigatePrevUser:s(()=>ct(nt-1,-1,Qe),"navigatePrevUser"),navigateNextUser:s(()=>ct(nt+1,1,Qe),"navigateNextUser"),navigateTop:s(()=>ct(0,1),"navigateTop"),navigateBottom:s(()=>ct(e.length-1,-1),"navigateBottom"),getSelected:s(()=>nt>=0?e[nt]??null:null,"getSelected")}},[e,d,p,K]);let ee=(0,dc.useRef)({offsets:L,start:W,getItemElement:z,getItemTop:B,messages:e,scrollToIndex:H});ee.current={offsets:L,start:W,getItemElement:z,getItemTop:B,messages:e,scrollToIndex:H},(0,dc.useEffect)(()=>{if(d===void 0)return;let Ne=ee.current,nt=Ne.getItemElement(d);nt?t.current?.scrollToElement(nt,1):Ne.scrollToIndex(d)},[d,t]);let ge=(0,dc.useRef)(null),fe=(0,dc.useRef)({msgIdx:-1,positions:[]}),de=(0,dc.useRef)(-1),oe=(0,dc.useRef)(0),ae=(0,dc.useRef)(0),Se=(0,dc.useRef)(()=>{}),Me=(0,dc.useRef)(()=>{}),Te=(0,dc.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),Ie=(0,dc.useRef)(-1),xe=(0,dc.useRef)(!1);function re(Ne){let nt=ee.current.getItemTop(Ne);return Math.max(0,nt-p_n)}s(re,"targetFor");function te(Ne){let nt=t.current,{msgIdx:ct,positions:Qe}=fe.current;if(!nt||Qe.length===0||ct<0){b?.(null);return}let $e=Math.max(0,Math.min(Ne,Qe.length-1)),Ge=Qe[$e],pe=ee.current.getItemTop(ct),ve=nt.getViewportTop(),Ce=pe-nt.getScrollTop(),Ve=nt.getViewportHeight(),Je=ve+Ce+Ge.row;(Je<ve||Je>=ve+Ve)&&(nt.scrollTo(Math.max(0,pe+Ge.row-p_n)),Ce=pe-nt.getScrollTop(),Je=ve+Ce+Ge.row),b?.({positions:Qe,rowOffset:ve+Ce,currentIdx:$e});let Ye=Te.current,ot=Ye.prefixSum.at(-1)??0,ft=(Ye.prefixSum[Ye.ptr]??0)+$e+1;f?.(ot,ft),v(`highlight(i=${ct}, ord=${$e}/${Qe.length}): pos={row:${Ge.row},col:${Ge.col}} lo=${Ce} screenRow=${Je} badge=${ft}/${ot}`)}s(te,"highlight"),Me.current=te;let[ue,Ae]=(0,dc.useState)(0),ie=(0,dc.useCallback)(()=>Ae(Ne=>Ne+1),[]);(0,dc.useEffect)(()=>{let Ne=ge.current;if(!Ne)return;let{idx:nt,wantLast:ct,tries:Qe}=Ne,$e=t.current;if(!$e)return;let{getItemElement:Ge,getItemTop:pe,scrollToIndex:ve}=ee.current,Ce=Ge(nt),Ve=Ce?.yogaNode?.getComputedHeight()??0;if(!Ce||Ve===0){if(Qe>1){ge.current=null,v(`seek(i=${nt}): no mount after scrollToIndex, skip`),Se.current(ct?-1:1);return}ge.current={idx:nt,wantLast:ct,tries:Qe+1},ve(nt),ie();return}ge.current=null,$e.scrollTo(Math.max(0,pe(nt)-p_n));let Je=h?.(Ce)??[];if(fe.current={msgIdx:nt,positions:Je},v(`seek(i=${nt} t=${Qe}): ${Je.length} positions`),Je.length===0){if(++oe.current>20){oe.current=0;return}Se.current(ct?-1:1);return}oe.current=0;let Ye=ct?Je.length-1:0;Te.current.screenOrd=Ye,de.current=-1,Me.current(Ye);let ot=ae.current;ot&&(ae.current=0,Se.current(ot))},[ue]);function be(Ne,nt){let ct=t.current;if(!ct)return;let Qe=ee.current,{getItemElement:$e,scrollToIndex:Ge}=Qe;if(Ne<0||Ne>=Qe.messages.length)return;b?.(null),fe.current={msgIdx:-1,positions:[]},ge.current={idx:Ne,wantLast:nt,tries:0};let pe=$e(Ne),ve=pe?.yogaNode?.getComputedHeight()??0;pe&&ve>0?ct.scrollTo(re(Ne)):Ge(Ne),ie()}s(be,"jump");function Pe(Ne){let nt=Te.current,{matches:ct,prefixSum:Qe}=nt,$e=Qe.at(-1)??0;if(ct.length===0)return;if(ge.current){ae.current=Ne;return}de.current<0&&(de.current=nt.ptr);let{positions:Ge}=fe.current,pe=nt.screenOrd+Ne;if(pe>=0&&pe<Ge.length){nt.screenOrd=pe,te(pe),de.current=-1;return}let ve=(nt.ptr+Ne+ct.length)%ct.length;if(ve===de.current){b?.(null),de.current=-1,v(`step: wraparound at ptr=${ve}, all ${ct.length} msgs phantoms`);return}nt.ptr=ve,nt.screenOrd=0,be(ct[ve],Ne<0);let Ce=Ne<0?Qe[ve+1]??$e:Qe[ve]+1;f?.($e,Ce)}s(Pe,"step"),Se.current=Pe,(0,dc.useImperativeHandle)(m,()=>({jumpToIndex:s(Ne=>{let nt=t.current;nt&&nt.scrollTo(re(Ne))},"jumpToIndex"),setSearchQuery:s(Ne=>{ge.current=null,fe.current={msgIdx:-1,positions:[]},de.current=-1,b?.(null);let nt=Ne.toLowerCase(),ct=[],Qe=[0];if(nt){let ot=ee.current.messages;for(let ft=0;ft<ot.length;ft++){let ce=c(ot[ft]),je=ce.indexOf(nt),me=0;for(;je>=0;)me++,je=ce.indexOf(nt,je+nt.length);me>0&&(ct.push(ft),Qe.push(Qe.at(-1)+me))}}let $e=Qe.at(-1),Ge=0,pe=t.current,{offsets:ve,start:Ce,getItemTop:Ve}=ee.current,Je=Ve(Ce),Ye=Je>=0?Je-ve[Ce]:0;if(ct.length>0&&pe){let ot=Ie.current>=0?Ie.current:pe.getScrollTop(),ft=1/0;for(let ce=0;ce<ct.length;ce++){let je=Math.abs(Ye+ve[ct[ce]]-ot);je<=ft&&(ft=je,Ge=ce)}v(`setSearchQuery('${Ne}'): ${ct.length} msgs \xB7 ptr=${Ge} msgIdx=${ct[Ge]} curTop=${ot} origin=${Ye}`)}Te.current={matches:ct,ptr:Ge,screenOrd:0,prefixSum:Qe},ct.length>0?be(ct[Ge],!0):Ie.current>=0&&pe&&pe.scrollTo(Ie.current),f?.($e,ct.length>0?Qe[Ge+1]??$e:0)},"setSearchQuery"),nextMatch:s(()=>Pe(1),"nextMatch"),prevMatch:s(()=>Pe(-1),"prevMatch"),setAnchor:s(()=>{let Ne=t.current;Ne&&(Ie.current=Ne.getScrollTop())},"setAnchor"),disarmSearch:s(()=>{b?.(null),ge.current=null,fe.current={msgIdx:-1,positions:[]},de.current=-1},"disarmSearch"),warmSearchIndex:s(async()=>{if(xe.current)return 0;let Ne=ee.current.messages,nt=500,ct=0,Qe=performance.now();for(let Ge=0;Ge<Ne.length;Ge+=nt){await yo(0);let pe=performance.now(),ve=Math.min(Ge+nt,Ne.length);for(let Ce=Ge;Ce<ve;Ce++)c(Ne[Ce]);ct+=performance.now()-pe}let $e=Math.round(performance.now()-Qe);return v(`warmSearchIndex: ${Ne.length} msgs \xB7 work=${Math.round(ct)}ms wall=${$e}ms chunks=${Math.ceil(Ne.length/nt)}`),xe.current=!0,Math.round(ct)},"warmSearchIndex")}),[t]);let[Re,Ue]=(0,dc.useState)(null),Ee=(0,dc.useRef)({onItemClick:i,setHoveredKey:Ue});Ee.current={onItemClick:i,setHoveredKey:Ue};let De=(0,dc.useCallback)((Ne,nt)=>{let ct=Ee.current;!nt&&ct.onItemClick&&ct.onItemClick(Ne)},[]),ke=(0,dc.useCallback)(Ne=>{Ee.current.setHoveredKey(Ne)},[]),tt=(0,dc.useCallback)(Ne=>{Ee.current.setHoveredKey(nt=>nt===Ne?null:nt)},[]);return(0,fB.jsxs)(fB.Fragment,{children:[(0,fB.jsx)(O,{ref:D,height:M,flexShrink:0}),e.slice(W,Y).map((Ne,nt)=>{let ct=W+nt,Qe=R[ct],$e=!!i&&(a?.(Ne)??!0),Ge=$e&&Re===Qe,pe=l?.(Ne);return(0,fB.jsx)(aHi,{itemKey:Qe,msg:Ne,idx:ct,measureRef:F,expanded:pe,hovered:Ge,clickable:$e,onClickK:De,onEnterK:ke,onLeaveK:tt,renderItem:o},Qe)}),N>0&&(0,fB.jsx)(O,{height:N,flexShrink:0}),u&&(0,fB.jsx)(cHi,{messages:e,start:W,end:Y,offsets:L,getItemTop:B,getItemElement:z,scrollRef:t})]})}function cHi({messages:e,start:t,end:n,offsets:r,getItemTop:o,getItemElement:i,scrollRef:a}){let{setStickyPrompt:l}=(0,dc.useContext)(u_n),c=(0,dc.useCallback)(R=>a.current?.subscribe(R)??lHi,[a]);(0,dc.useSyncExternalStore)(c,()=>{let R=a.current;if(!R)return NaN;let I=R.getScrollTop()+R.getPendingDelta();return R.isSticky()?-1-I:I});let u=a.current?.isSticky()??!0,d=Math.max(0,(a.current?.getScrollTop()??0)+(a.current?.getPendingDelta()??0)),A=t,p=-1;for(let R=n-1;R>=t;R--){let I=o(R);if(I>=0){if(I<d)break;p=I}A=R}let m=-1,f=null;if(A>0&&!u)for(let R=A-1;R>=0;R--){let I=sHi(e[R]);if(I===null)continue;let M=o(R);if(!(M>=0&&M+1>=d)){m=R,f=I;break}}let h=p>=0?p-r[A]:0,b=m>=0?Math.max(0,h+r[m]):-1,E=(0,dc.useRef)({idx:-1,tries:0}),x=(0,dc.useRef)("none"),T=(0,dc.useRef)(-1);return(0,dc.useEffect)(()=>{if(E.current.idx>=0)return;if(x.current==="armed"){x.current="force";return}let R=x.current==="force";if(x.current="none",!R&&T.current===m)return;if(T.current=m,f===null){l(null);return}let I=f.trimStart(),M=I.search(/\n\s*\n/),N=(M>=0?I.slice(0,M):I).slice(0,oHi).replace(/\s+/g," ").trim();if(N===""){l(null);return}let F=m,D=b;l({text:N,scrollTo:s(()=>{l("clicked"),x.current="armed";let L=i(F);L?a.current?.scrollToElement(L,1):(a.current?.scrollTo(D),E.current={idx:F,tries:0})},"scrollTo")})}),(0,dc.useEffect)(()=>{if(E.current.idx<0)return;let R=i(E.current.idx);R?(a.current?.scrollToElement(R,1),E.current={idx:-1,tries:0}):++E.current.tries>5&&(E.current={idx:-1,tries:0})}),null}var dc,fB,p_n,qlo,oHi,Glo,lHi,Vlo=S(()=>{dc=U(et());Plo();Xe();xte();A_n();it();ud();Yhn();fI();fB=U(Z()),p_n=3,qlo=new WeakMap;s(rHi,"defaultExtractSearchText");oHi=500,Glo=new WeakMap;s(sHi,"stickyPromptText");s(iHi,"computeStickyPromptText");s(aHi,"VirtualItem");s(Wlo,"VirtualMessageList");lHi=s(()=>{},"NOOP_UNSUB");s(cHi,"StickyTracker")});function pHi(e,t){let n=new Set(t),r=new Set;return e.filter(o=>{if(o.type==="system")return o.subtype!=="api_metrics";let i=o.message?.content[0];if(o.type==="assistant")return o.isApiErrorMessage?!0:i?.type==="tool_use"&&i.name&&n.has(i.name)?("id"in i&&r.add(i.id),!0):!1;if(o.type==="user")return i?.type==="tool_result"?i.tool_use_id!==void 0&&r.has(i.tool_use_id):!o.isMeta;if(o.type==="attachment"){let a=o.attachment;return a?.type==="queued_command"&&a.commandMode==="prompt"&&!a.isMeta&&a.origin===void 0}return!1})}function mHi(e,t){let n=new Set(t),r=new Set,o=[],i=0;for(let a=0;a<e.length;a++){let l=e[a],c=l.message?.content[0];if(l.type==="user"&&c?.type!=="tool_result"&&!l.isMeta){i++;continue}l.type==="assistant"&&(c?.type==="text"?o[a]=i:c?.type==="tool_use"&&c.name&&n.has(c.name)&&r.add(i))}return r.size===0?e:e.filter((a,l)=>{let c=o[l];return c===void 0||!r.has(c)})}function hHi(e,t,n=fHi,r=gHi){let o=t.current,i=o?e.findIndex(c=>c.uuid===o.uuid):-1,a=i>=0?i:o?Math.min(o.idx,Math.max(0,e.length-n)):0;e.length-a>n+r&&(a=e.length-n);let l=e[a];return l&&(o?.uuid!==l.uuid||o.idx!==a)?t.current={uuid:l.uuid,idx:a}:!l&&o&&(t.current=null),a}function Klo(e){return(e.type==="assistant"||e.type==="user"?n3(e):null)??e.uuid}function yHi(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function vlo(e,t,n,r,o,i){if(o==="transcript")return!0;switch(e.type){case"attachment":case"user":case"assistant":{if(e.type==="assistant"){let l=e.message.content[0];if(l?.type==="server_tool_use")return i.resolvedToolUseIDs.has(l.id)}let a=n3(e);return a?t.has(a)||n.has(a)||x7r(a,"PostToolUse",i)?!1:uao(r,i.resolvedToolUseIDs):!0}case"system":return e.subtype!=="api_error";case"grouped_tool_use":return e.messages.every(l=>{let c=l.message.content[0];return c?.type==="tool_use"&&i.resolvedToolUseIDs.has(c.id)});case"collapsed_read_search":return!1}}var Sje,VA,am,uHi,dHi,Ylo,AHi,m_n,fHi,gHi,_Hi,zie,hje=S(()=>{Ia();Sje=U(et()),VA=U(et());dao();St();du();xs();MW();Xe();Yy();Ro();H9();mao();hao();n4();bao();mn();Ot();j_();vao();Ln();Do();Yhn();IN();mlo();EI();Elo();fI();Xtn();a_n();sQ();Rlo();Vlo();am=U(Z()),uHi=Sje.memo(s(function({agentDefinitions:t}){return(0,am.jsx)(fT,{children:(0,am.jsxs)(O,{flexDirection:"column",gap:1,children:[(0,am.jsx)(plo,{}),(0,am.jsx)(Sje.Suspense,{fallback:null,children:(0,am.jsx)(klo,{agentDefinitions:t})})]})})},"LogoHeader")),dHi=null,Ylo=null,AHi=null;s(pHi,"filterForBriefTool");s(mHi,"dropTextInBriefTurns");m_n=30,fHi=200,gHi=50;s(hHi,"computeSliceStart");_Hi=s(({messages:e,tools:t,commands:n,verbose:r,toolJSX:o,toolUseConfirmQueue:i,inProgressToolUseIDs:a,isMessageSelectorVisible:l,conversationId:c,screen:u,streamingToolUses:d,showAllInTranscript:A=!1,agentDefinitions:p,onOpenRateLimitOptions:m,hideLogo:f=!1,isLoading:h,hidePastThinking:b=!1,streamingThinking:E,streamingText:x,isBriefOnly:T=!1,unseenDivider:R,scrollRef:I,trackStickyPrompt:M,jumpRef:N,onSearchMatchesChange:F,scanElement:D,setPositions:L,disableRenderCap:B=!1,cursor:z=null,setCursor:G,cursorNavRef:H,renderRange:W})=>{let{columns:Y}=jn(),K=Xi("transcript:toggleShowAll","Transcript","Ctrl+E"),ee=(0,VA.useMemo)(()=>Wy(e).filter(ULe),[e]),ge=(0,VA.useMemo)(()=>E?E.isStreaming?!0:E.streamingEndedAt?Date.now()-E.streamingEndedAt<3e4:!1:!1,[E]),fe=(0,VA.useMemo)(()=>{if(!b)return null;if(ge)return"streaming";for(let Ye=ee.length-1;Ye>=0;Ye--){let ot=ee[Ye];if(ot?.type==="assistant"){let ft=ot.message.content;for(let ce=ft.length-1;ce>=0;ce--)if(ft[ce]?.type==="thinking")return`${ot.uuid}:${ce}`}else if(ot?.type==="user"&&!ot.message.content.some(ce=>ce.type==="tool_result"))return"no-thinking"}return null},[ee,b,ge]),de=(0,VA.useMemo)(()=>{for(let Ye=ee.length-1;Ye>=0;Ye--){let ot=ee[Ye];if(ot?.type==="user"){let ft=ot.message.content;for(let ce of ft)if(ce.type==="text"){let je=ce.text;if(je.startsWith("<bash-stdout")||je.startsWith("<bash-stderr"))return ot.uuid}}}return null},[ee]),oe=(0,VA.useMemo)(()=>C7r(ee),[ee]),ae=(0,VA.useMemo)(()=>d.filter(Ye=>!a.has(Ye.contentBlock.id)&&!oe.has(Ye.contentBlock.id)),[d,a,oe]),Se=(0,VA.useMemo)(()=>ae.flatMap(Ye=>{let ot=wE({content:[Ye.contentBlock]});return ot.uuid=s2e(Ye.contentBlock.id,0),Wy([ot])}),[ae]),Me=u==="transcript",Te=(0,VA.useMemo)(()=>qe(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),Ie=I!=null&&!Te,xe=Me&&!A&&!Ie,re=(0,VA.useRef)(null),{collapsed:te,lookups:ue,hasTruncatedMessages:Ae,hiddenMessageCount:ie}=(0,VA.useMemo)(()=>{let Ye=r||cs()?ee:Tf(ee,{includeSnipped:!0}),ot=S7r(Ye.filter(On=>On.type!=="progress").filter(On=>!gwt(On)).filter(On=>O7r(On,Me)),Se),ft=[Ylo,AHi].filter(On=>On!==null),ce=[Ylo].filter(On=>On!==null),je=ft.length>0&&!Me?T?pHi(ot,ft):ce.length>0?mHi(ot,ce):ot:ot,me=xe?je.slice(-m_n):je,we=xe&&je.length>m_n,{messages:Ke}=Eao(me,t,r),dt=pao(gao(yao(VKr(Ke,t))),r),Tt=E7r(ee,me),tn=ot.length-m_n;return{collapsed:dt,lookups:Tt,hasTruncatedMessages:we,hiddenMessageCount:tn}},[r,ee,Me,Se,xe,t,T]),be=(0,VA.useMemo)(()=>{let ot=!Ie&&!B?hHi(te,re):0;return W?te.slice(W[0],W[1]):ot>0?te.slice(ot):te},[te,W,Ie,B]),Pe=(0,VA.useMemo)(()=>new Set(d.map(Ye=>Ye.contentBlock.id)),[d]),Re=(0,VA.useMemo)(()=>{if(!R)return-1;let Ye=R.firstUnseenUuid.slice(0,24);return be.findIndex(ot=>ot.uuid.slice(0,24)===Ye)},[R,be]),Ue=(0,VA.useMemo)(()=>z?be.findIndex(Ye=>Ye.uuid===z.uuid):-1,[z,be]),[Ee,De]=(0,VA.useState)(()=>new Set),ke=(0,VA.useCallback)(Ye=>{let ot=Klo(Ye);De(ft=>{let ce=new Set(ft);return ce.has(ot)?ce.delete(ot):ce.add(ot),ce})},[]),tt=(0,VA.useCallback)(Ye=>Ee.size>0&&Ee.has(Klo(Ye)),[Ee]),Ne=(0,VA.useRef)(ue);Ne.current=ue;let nt=(0,VA.useCallback)(Ye=>{if(Ye.type==="collapsed_read_search")return!0;if(Ye.type==="assistant"){let je=Ye.message.content[0];return je!=null&&Iye(je)&&je.type==="advisor_tool_result"&&je.content.type==="advisor_result"}if(Ye.type!=="user")return!1;let ot=Ye.message.content[0];if(ot?.type!=="tool_result"||ot.is_error||!Ye.toolUseResult)return!1;let ft=Ne.current.toolUseByToolUseID.get(ot.tool_use_id)?.name;return(ft?qi(t,ft):void 0)?.isResultTruncated?.(Ye.toolUseResult)??!1},[t]),ct=(!o||!!o.shouldContinueAnimation)&&!i.length&&!l,Qe=a.size>0,{progress:$e}=t8(),Ge=(0,VA.useRef)(null),pe=rt().terminalProgressBarEnabled&&!ri()&&!(dHi?.isProactiveActive()??!1);(0,VA.useEffect)(()=>{let Ye=pe?Qe?"indeterminate":"completed":null;Ge.current!==Ye&&(Ge.current=Ye,$e(Ye))},[$e,pe,Qe]),(0,VA.useEffect)(()=>()=>$e(null),[$e]);let ve=(0,VA.useCallback)(Ye=>`${Ye.uuid}-${c}`,[c]),Ce=s((Ye,ot)=>{let ft=ot>0?be[ot-1]?.type:void 0,ce=Ye.type==="user"&&ft==="user",je=Ye.type==="collapsed_read_search"&&(!!x||blo(be,ot,t,Pe)),me=ve(Ye),we=(0,am.jsx)(Slo,{message:Ye,isUserContinuation:ce,hasContentAfter:je,tools:t,commands:n,verbose:r||tt(Ye)||z?.expanded===!0&&ot===Ue,inProgressToolUseIDs:a,streamingToolUseIDs:Pe,screen:u,canAnimate:ct,onOpenRateLimitOptions:m,lastThinkingBlockId:fe,latestBashOutputUUID:de,columns:Y,isLoading:h,lookups:ue},me),Ke=(0,am.jsx)(vV.Provider,{value:ot===Ue,children:we},me);return R&&ot===Re?[(0,am.jsx)(O,{marginTop:1,children:(0,am.jsx)(jd,{title:`${R.count} new ${Qn(R.count,"message")}`,width:Y,color:"inactive"})},"unseen-divider"),Ke]:Ke},"renderMessageRow"),Ve=(0,VA.useRef)(new WeakMap),Je=(0,VA.useCallback)(Ye=>{let ot=Ve.current.get(Ye);if(ot!==void 0)return ot;let ft=nwt(Ye);if(Ye.type==="user"&&Ye.toolUseResult&&Array.isArray(Ye.message.content)){let je=Ye.message.content.find(me=>me.type==="tool_result");if(je&&"tool_use_id"in je){let me=ue.toolUseByToolUseID.get(je.tool_use_id),Ke=(me&&qi(t,me.name))?.extractSearchText?.(Ye.toolUseResult);Ke!==void 0&&(ft=Ke)}}let ce=ft.toLowerCase();return Ve.current.set(Ye,ce),ce},[t,ue]);return(0,am.jsxs)(am.Fragment,{children:[!f&&!(W&&W[0]>0)&&(0,am.jsx)(uHi,{agentDefinitions:p}),Ae&&(0,am.jsx)(jd,{title:`${K} to show ${mt.bold(ie)} previous messages`,width:Y}),Me&&A&&ie>0&&!B&&(0,am.jsx)(jd,{title:`${K} to hide ${mt.bold(ie)} previous messages`,width:Y}),Ie?(0,am.jsx)(m9.Provider,{value:!0,children:(0,am.jsx)(Wlo,{messages:be,scrollRef:I,columns:Y,itemKey:ve,renderItem:Ce,onItemClick:ke,isItemClickable:nt,isItemExpanded:tt,trackStickyPrompt:M,selectedIndex:Ue>=0?Ue:void 0,cursorNavRef:H,setCursor:G,jumpRef:N,onSearchMatchesChange:F,scanElement:D,setPositions:L,extractSearchText:Je})}):be.flatMap(Ce),x&&!T&&(0,am.jsx)(O,{alignItems:"flex-start",flexDirection:"row",marginTop:1,width:"100%",children:(0,am.jsxs)(O,{flexDirection:"row",children:[(0,am.jsx)(O,{minWidth:2,children:(0,am.jsx)(_,{color:"text",children:rc})}),(0,am.jsx)(O,{flexDirection:"column",children:(0,am.jsx)(T0r,{children:x})})]})}),ge&&E&&!T&&(0,am.jsx)(O,{marginTop:1,children:(0,am.jsx)(kgt,{param:{type:"thinking",thinking:E.thinking},addMargin:!1,isTranscriptMode:!0,verbose:r,hideInTranscript:!1})})]})},"MessagesImpl");s(Klo,"expandKey");s(yHi,"setsEqual");zie=Sje.memo(_Hi,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(r==="onOpenRateLimitOptions"||r==="scrollRef"||r==="trackStickyPrompt"||r==="setCursor"||r==="cursorNavRef"||r==="jumpRef"||r==="onSearchMatchesChange"||r==="scanElement"||r==="setPositions")&&e[r]!==t[r]){if(r==="streamingToolUses"){let o=e.streamingToolUses,i=t.streamingToolUses;if(o.length===i.length&&o.every((a,l)=>a.contentBlock===i[l]?.contentBlock))continue}if(r==="inProgressToolUseIDs"&&yHi(e.inProgressToolUseIDs,t.inProgressToolUseIDs))continue;if(r==="unseenDivider"){let o=e.unseenDivider,i=t.unseenDivider;if(o?.firstUnseenUuid===i?.firstUnseenUuid&&o?.count===i?.count)continue}if(r==="tools"){let o=e.tools,i=t.tools;if(o.length===i.length&&o.every((a,l)=>a.name===i[l]?.name))continue}return!1}return!0});s(vlo,"shouldRenderStatically")});function Qlo({log:e,onExit:t,onSelect:n}){let[r,o]=Eje.default.useState(null);Eje.default.useEffect(()=>{o(null),mO(e)&&jU(e).then(o)},[e]);let i=mO(e)&&r===null,a=r??e,l=zA(a)||"",c=JQ();cn("confirm:no",t,{context:"Confirmation"});let u=(0,Eje.useCallback)(()=>{n(r??e)},[n,r,e]);return cn("confirm:yes",u,{context:"Confirmation"}),i?(0,Rk.jsxs)(O,{flexDirection:"column",padding:1,children:[(0,Rk.jsx)(d3,{message:"Loading session\u2026"}),(0,Rk.jsx)(_,{dimColor:!0,children:(0,Rk.jsx)(kn,{children:(0,Rk.jsx)(ln,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})})})]}):(0,Rk.jsxs)(O,{flexDirection:"column",children:[(0,Rk.jsx)(zie,{messages:a.messages,tools:c,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:l,screen:"transcript",streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,Rk.jsxs)(O,{flexShrink:0,flexDirection:"column",borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",paddingLeft:2,children:[(0,Rk.jsxs)(_,{children:[BF(a.modified)," \xB7"," ",a.messageCount," messages",a.gitBranch?` \xB7 ${a.gitBranch}`:""]}),(0,Rk.jsx)(_,{dimColor:!0,children:(0,Rk.jsxs)(kn,{children:[(0,Rk.jsx)(qt,{shortcut:"Enter",action:"resume"}),(0,Rk.jsx)(ln,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})})]})]})}var Eje,Rk,Xlo=S(()=>{Eje=U(et());Xe();Gr();FE();kr();ys();ia();Ai();Ti();Yve();hje();Rk=U(Z());s(Qlo,"SessionPreview")});function vHi(e,t){if(e===f_n)return f_n.length+vje;let n=en(e),r=t?Math.min(n,t-vje-g_n):n;return Math.max(0,r)+vje+g_n}function THi(e,t){let n=t-vje-g_n;return en(e)<=n?e:n<=1?e.charAt(0):Ws(e,n)}function rco({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let o=r?"Resume (All Projects)":"Resume",i=o.length+1,a=Math.max(SHi,EHi),l=n-i-a-2,c=Math.max(0,Math.min(t,e.length-1)),u=Math.max(20,Math.floor(l/2)),d=e.map(x=>vHi(x,u)),A=0,p=e.length;if(d.reduce((x,T,R)=>x+T+(R<d.length-1?1:0),0)>l){let x=l-bHi,T=d[c]??0;for(A=c,p=c+1;A>0||p<e.length;){let R=A>0,I=p<e.length;if(R){let M=(d[A-1]??0)+1;if(T+M<=x){A--,T+=M;continue}}if(I){let M=(d[p]??0)+1;if(T+M<=x){p++,T+=M;continue}}break}}let f=A,h=e.length-p,b=e.slice(A,p),E=b.map((x,T)=>A+T);return(0,$7.jsxs)(O,{flexDirection:"row",gap:1,children:[(0,$7.jsx)(_,{color:"suggestion",children:o}),f>0&&(0,$7.jsxs)(_,{dimColor:!0,children:[Jlo,f]}),b.map((x,T)=>{let I=E[T]===c,M=x===f_n?x:`#${THi(x,u-vje)}`;return(0,$7.jsxs)(_,{backgroundColor:I?"suggestion":void 0,color:I?"inverseText":void 0,bold:I,children:[" ",M," "]},x)}),h>0?(0,$7.jsxs)(_,{dimColor:!0,children:[Zlo,h,eco]}):(0,$7.jsx)(_,{dimColor:!0,children:tco})]})}var $7,f_n,vje,g_n,Jlo,Zlo,eco,tco,nco,bHi,SHi,EHi,oco=S(()=>{Vi();Xe();kr();$7=U(Z()),f_n="All",vje=2,g_n=1,Jlo="\u2190 ",Zlo="\u2192",eco=" (tab to cycle)",tco="(tab to cycle)",nco=2,bHi=Jlo.length+nco+1,SHi=Zlo.length+nco+eco.length,EHi=tco.length;s(vHi,"getTabWidth");s(THi,"truncateTag");s(rco,"TagTabs")});function sco({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:o,visibleOptionCount:i,layout:a="expanded",isDisabled:l=!1,hideIndexes:c=!1,isNodeExpanded:u,onExpand:d,onCollapse:A,getParentPrefix:p,getChildPrefix:m,onUpFromFirstItem:f}){let[h,b]=Ik.default.useState(new Set),E=Ik.default.useRef(!1),x=Ik.default.useRef(null),T=Ik.default.useCallback(K=>u?u(K):h.has(K),[u,h]),R=Ik.default.useMemo(()=>{let K=[];function ee(ge,fe,de){let oe=!!ge.children&&ge.children.length>0,ae=T(ge.id);if(K.push({node:ge,depth:fe,isExpanded:ae,hasChildren:oe,parentId:de}),oe&&ae&&ge.children)for(let Se of ge.children)ee(Se,fe+1,ge.id)}s(ee,"traverse");for(let ge of e)ee(ge,0);return K},[e,T]),I=Ik.default.useCallback(K=>K?"\u25BC ":"\u25B6 ",[]),M=Ik.default.useCallback(K=>" \u25B8 ",[]),N=p??I,F=m??M,D=Ik.default.useCallback(K=>{let ee="";return K.hasChildren?ee=N(K.isExpanded):K.depth>0&&(ee=F(K.depth)),ee+K.node.label},[N,F]),L=Ik.default.useMemo(()=>R.map(K=>({label:D(K),description:K.node.description,dimDescription:K.node.dimDescription??!0,value:K.node.id})),[R,D]),B=Ik.default.useMemo(()=>{let K=new Map;return R.forEach(ee=>K.set(ee.node.id,ee.node)),K},[R]),z=Ik.default.useCallback(K=>R.find(ee=>ee.node.id===K),[R]),G=Ik.default.useCallback((K,ee)=>{let ge=z(K);!ge||!ge.hasChildren||(ee?d?d(K):b(fe=>new Set(fe).add(K)):A?A(K):b(fe=>{let de=new Set(fe);return de.delete(K),de}))},[z,d,A]),H=s(K=>{if(!o||l)return;let ee=z(o);if(ee){if(K.key==="right"&&ee.hasChildren)K.preventDefault(),G(o,!0);else if(K.key==="left"){if(ee.hasChildren&&ee.isExpanded)K.preventDefault(),G(o,!1);else if(ee.parentId!==void 0&&(K.preventDefault(),E.current=!0,G(ee.parentId,!1),r)){let ge=B.get(ee.parentId);ge&&r(ge)}}}},"handleKeyDown"),W=Ik.default.useCallback(K=>{let ee=B.get(K);ee&&t(ee)},[B,t]),Y=Ik.default.useCallback(K=>{if(E.current){E.current=!1;return}if(x.current!==K&&(x.current=K,r)){let ee=B.get(K);ee&&r(ee)}},[r,B]);return(0,h_n.jsx)(O,{tabIndex:0,autoFocus:!0,onKeyDown:H,children:(0,h_n.jsx)(Jt,{options:L,onChange:W,onFocus:Y,onCancel:n,defaultFocusValue:o,visibleOptionCount:i,layout:a,isDisabled:l,hideIndexes:c,onUpFromFirstItem:f})})}var Ik,h_n,ico=S(()=>{Ik=U(et());Xe();va();h_n=U(Z());s(sco,"TreeSelect")});function cco(e,t){let n=e.replace(/\s+/g," ").trim();return Ws(n,t)}function __n({before:e,match:t,after:n},r){return mt.dim(e)+r(t)+mt.dim(n)}function PHi(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let o=r+t.length,i=Math.max(0,r-n),a=Math.min(e.length,o+n),l=e.slice(i,r),c=e.slice(r,o),u=e.slice(o,a);return{before:(i>0?"\u2026":"")+l.replace(/\s+/g," ").trimStart(),match:c.trim(),after:u.replace(/\s+/g," ").trimEnd()+(a<e.length?"\u2026":"")}}function y_n(e,t,n){let{isGroupHeader:r=!1,isChild:o=!1,forkCount:i=0}=n||{},a=r&&i>0?xHi:o?CHi:0,l=r&&i>0?` (+${i} other ${i===1?"session":"sessions"})`:"",c=e.isSidechain?" (sidechain)":"",u=t-a-c.length-l.length;return`${cco(S5(e),u)}${c}${l}`}function b_n(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},o=n?" ":"",i=Pke(e),a=r&&e.projectPath?` \xB7 ${e.projectPath}`:"";return o+i+a}function _wt({logs:e,maxHeight:t=1/0,forceWidth:n,onCancel:r,onSelect:o,onLogsChanged:i,onLoadMore:a,initialSearchQuery:l,showAllProjects:c=!1,onToggleAllProjects:u,onAgenticSearch:d}){let A=jn(),p=n===void 0?A.columns:n;ua(r,void 0,!1);let m=Pm(),f=x3(),h=!1,[b]=qr(),E=mE(b),x=xa.default.useMemo(()=>Dn=>_W(Dn,E.warning),[E.warning]),T=!1,[R,I]=xa.default.useState(null),[M,N]=xa.default.useState(!1),[F,D]=xa.default.useState(!1),[L,B]=xa.default.useState(!1),z=xa.default.useMemo(()=>Un(),[]),[G,H]=xa.default.useState(""),[W,Y]=xa.default.useState(0),[K,ee]=xa.default.useState(new Set),[ge,fe]=xa.default.useState(null),[de,oe]=xa.default.useState(1),[ae,Se]=xa.default.useState("list"),[Me,Te]=xa.default.useState(null),Ie=xa.default.useRef(null),[xe,re]=xa.default.useState(0),[te,ue]=xa.default.useState({status:"idle"}),[Ae,ie]=xa.default.useState(!1),be=xa.default.useRef(null),{query:Pe,setQuery:Re,cursorOffset:Ue}=PO({isActive:ae==="search"&&te.status!=="searching",onExit:s(()=>{Se("list"),q("tengu_session_search_toggled",{enabled:!1})},"onExit"),onExitUp:s(()=>{Se("list"),q("tengu_session_search_toggled",{enabled:!1})},"onExitUp"),passthroughCtrlKeys:["n"],initialQuery:l||""}),Ee=xa.default.useDeferredValue(Pe),[De,ke]=xa.default.useState("");xa.default.useEffect(()=>{if(!Ee){ke("");return}let Dn=setTimeout(ke,300,Ee);return()=>clearTimeout(Dn)},[Ee]);let[tt,Ne]=xa.default.useState(null),[nt,ct]=xa.default.useState(!1);xa.default.useEffect(()=>{eE().then(Dn=>I(Dn)),S3(z).then(Dn=>{B(Dn.length>1)})},[z]);let Qe=xa.default.useMemo(()=>new Map(e.map(Dn=>[Dn,MHi(Dn)])),[e]),$e=xa.default.useMemo(()=>{if(!h)return null;let Dn=e.map(Nn=>({log:Nn,searchableText:Qe.get(Nn)??""})).filter(Nn=>Nn.searchableText);return new kk(Dn,{keys:["searchableText"],threshold:kHi,ignoreLocation:!0,includeScore:!0})},[e,Qe,h]),Ge=xa.default.useMemo(()=>NHi(e),[e]),pe=Ge.length>0,ve=xa.default.useMemo(()=>pe?["All",...Ge]:[],[pe,Ge]),Ce=ve.length>0&&xe<ve.length?xe:0,Ve=ve[Ce],Je=Ve==="All"?void 0:Ve,Ye=pe?1:0,ot=xa.default.useMemo(()=>{let Dn=e;return f&&(Dn=e.filter(Nn=>{let So=Et(),Ls=zA(Nn);return!!(So&&Ls===So||Nn.customTitle||Tje(Nn.messages)||Nn.firstPrompt||Nn.customTitle)})),Je!==void 0&&(Dn=Dn.filter(Nn=>Nn.tag===Je)),M&&R&&(Dn=Dn.filter(Nn=>Nn.gitBranch===R)),L&&!F&&(Dn=Dn.filter(Nn=>Nn.projectPath===z)),Dn},[e,f,Je,M,R,L,F,z]),ft=xa.default.useMemo(()=>{if(!Pe)return ot;let Dn=Pe.toLowerCase();return ot.filter(Nn=>{let So=S5(Nn).toLowerCase(),Ls=(Nn.gitBranch||"").toLowerCase(),Co=(Nn.tag||"").toLowerCase(),Bs=Nn.prNumber?`pr #${Nn.prNumber} ${Nn.prRepository||""}`.toLowerCase():"";return So.includes(Dn)||Ls.includes(Dn)||Co.includes(Dn)||Bs.includes(Dn)})},[ot,Pe]);xa.default.useEffect(()=>{h&&Ee&&Ee!==De&&ct(!0)},[Ee,De,h]),xa.default.useEffect(()=>{if(!h||!De||!$e){Ne(null),ct(!1);return}let Dn=setTimeout((Nn,So,Ls,Co)=>{let Bs=Nn.search(So);Bs.sort((fi,vc)=>{let zo=new Date(fi.item.log.modified).getTime(),eu=new Date(vc.item.log.modified).getTime()-zo;return Math.abs(eu)>RHi?eu:(fi.score??1)-(vc.score??1)}),Ls({results:Bs.map(fi=>({log:fi.item.log,score:fi.score,searchableText:fi.item.searchableText})),query:So}),Co(!1)},0,$e,De,Ne,ct);return()=>{clearTimeout(Dn)}},[De,$e,h]);let{filteredLogs:ce,snippets:je}=xa.default.useMemo(()=>{let Dn=new Map,Nn=ft;if(tt&&De&&tt.query===De){for(let Co of tt.results)if(Co.searchableText){let Bs=PHi(Co.searchableText,De,IHi);Bs&&Dn.set(Co.log,Bs)}let So=new Set(Nn.map(Co=>Co.messages[0]?.uuid)),Ls=tt.results.map(Co=>Co.log).filter(Co=>!So.has(Co.messages[0]?.uuid));Nn=[...Nn,...Ls]}return{filteredLogs:Nn,snippets:Dn}},[ft,tt,De]),me=xa.default.useMemo(()=>te.status==="results"&&te.results.length>0?te.results:ce,[te,ce]),we=Math.max(30,p-4),Ke=xa.default.useMemo(()=>{if(!f)return[];let Dn=DHi(me);return Array.from(Dn.entries()).map(([Nn,So])=>{let Ls=So[0],Co=me.indexOf(Ls),Bs=je.get(Ls),fi=Bs?__n(Bs,x):null;if(So.length===1){let eu=b_n(Ls,{showProjectPath:c});return{id:`log:${Nn}:0`,value:{log:Ls,indexInFiltered:Co},label:y_n(Ls,we),description:fi?`${eu}
|
|
5995
5995
|
${fi}`:eu,dimDescription:!0}}let vc=So.length-1,zo=So.slice(1).map((eu,yp)=>{let Rr=me.indexOf(eu),ii=je.get(eu),kl=ii?__n(ii,x):null,Wr=b_n(eu,{isChild:!0,showProjectPath:c});return{id:`log:${Nn}:${yp+1}`,value:{log:eu,indexInFiltered:Rr},label:y_n(eu,we,{isChild:!0}),description:kl?`${Wr}
|
|
5996
5996
|
${kl}`:Wr,dimDescription:!0}}),Tc=b_n(Ls,{showProjectPath:c});return{id:`group:${Nn}`,value:{log:Ls,indexInFiltered:Co},label:y_n(Ls,we,{isGroupHeader:!0,forkCount:vc}),description:fi?`${Tc}
|
|
@@ -7764,7 +7764,7 @@ ${Ar("suggestion",e.theme)(`/plugin install frontend-design@${df}`)}`,"content")
|
|
|
7764
7764
|
${Ar("suggestion",e.theme)(`/plugin install vercel@${df}`)}`,"content"),cooldownSessions:3,isRelevant:s(async e=>bRo("vercel",e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:["vercel"]}),"isRelevant")},{id:"effort-high-nudge",content:s(async e=>{let n=Ar("suggestion",e.theme)("/effort high");return nn("tengu_tide_elm","off")==="copy_b"?`Use ${n} for better one-shot answers. Claude thinks it through first.`:`Working on something tricky? ${n} gives better first answers`},"content"),cooldownSessions:3,isRelevant:s(async()=>{if(!Uee()||!ZR(Ii())||An("policySettings")?.effortLevel!==void 0||Xte()!==void 0)return!1;let e=yr().effortLevel;return e==="high"||e==="max"?!1:nn("tengu_tide_elm","off")!=="off"},"isRelevant")},{id:"subagent-fanout-nudge",content:s(async e=>{let t=Ar("suggestion",e.theme);return nn("tengu_tern_alloy","off")==="copy_b"?`For big tasks, tell Claude to ${t("use subagents")}. They work in parallel and keep your main thread clean.`:`Say ${t('"fan out subagents"')} and Claude sends a team. Each one digs deep so nothing gets missed.`},"content"),cooldownSessions:3,isRelevant:s(async()=>Uee()?nn("tengu_tern_alloy","off")!=="off":!1,"isRelevant")},{id:"loop-command-nudge",content:s(async e=>{let t=Ar("suggestion",e.theme);return nn("tengu_timber_lark","off")==="copy_b"?`Use ${t("/loop 5m check the deploy")} to run any prompt on a schedule. Set it and forget it.`:`${t("/loop")} runs any prompt on a recurring schedule. Great for monitoring deploys, babysitting PRs, or polling status.`},"content"),cooldownSessions:3,isRelevant:s(async()=>!Uee()||!ZTr()?!1:nn("tengu_timber_lark","off")!=="off","isRelevant")},{id:"guest-passes",content:s(async e=>{let t=Ar("claude",e.theme),n=F7();return n?`Share Claude Code and earn ${t(L7(n))} of extra usage \xB7 ${t("/passes")}`:`You have free guest passes to share \xB7 ${t("/passes")}`},"content"),cooldownSessions:3,isRelevant:s(async()=>{if(rt().hasVisitedPasses)return!1;let{eligible:t}=PTe();return t},"isRelevant")},{id:"overage-credit",content:s(async e=>{let t=Ar("claude",e.theme),n=toe(),r=n?Qye(n):null;return r?`${t(`${r} in extra usage, on us`)} \xB7 third-party apps \xB7 ${t("/extra-usage")}`:""},"content"),cooldownSessions:3,isRelevant:s(async()=>Kfn(),"isRelevant")},{id:"feedback-command",content:s(async()=>"Use /feedback to help us improve!","content"),cooldownSessions:15,async isRelevant(){return process.env.USER_TYPE==="ant"?!1:rt().numStartups>5}}],sXi=process.env.USER_TYPE==="ant"?[{id:"important-claudemd",content:s(async()=>'[ANT-ONLY] Use "IMPORTANT:" prefix for must-follow \u0043LAUDE.md rules',"content"),cooldownSessions:30,isRelevant:s(async()=>!0,"isRelevant")},{id:"skillify",content:s(async()=>"[ANT-ONLY] Use /skillify at the end of a workflow to turn it into a reusable skill","content"),cooldownSessions:15,isRelevant:s(async()=>!0,"isRelevant")}]:[];s(iXi,"getCustomTips");s(ZIt,"getRelevantTips")});function aXi(e){if(e.length===0)return;if(e.length===1)return e[0];let t=e.map(n=>({tip:n,sessions:QIt(n.id)}));return t.sort((n,r)=>r.sessions-n.sessions),t[0]?.tip}async function SRo(e){if(nr().spinnerTipsEnabled===!1)return;let t=await ZIt(e);if(t.length!==0)return aXi(t)}function ERo(e){hRo(e.id),q("tengu_tip_shown",{tipIdLength:e.id,cooldownSessions:e.cooldownSessions})}var vRo=S(()=>{Mn();vt();_Tn();STn();s(aXi,"selectTipWithLongestTimeSinceShown");s(SRo,"getTipToShowOnSpinner");s(ERo,"recordShownTip")});var lXi,cXi,uXi,qup,dXi,AXi,pXi,mXi,fXi,gXi,Gup,hXi,_Xi,yXi,Wup,bXi,Vup,SXi,Yup,EXi,vXi,TXi,xXi,Kup,CXi,Qup,wXi,kXi,RXi,IXi,PXi,Xup,OXi,TRo,MXi,ETn,DXi,NXi,xRo,LXi,CRo,FXi,Jup,Zup,wRo=S(()=>{Pr();no();dnn();lXi=Be(()=>C.unknown()),cXi=Be(()=>C.object({matcher:C.string().optional(),hookCallbackIds:C.array(C.string()),timeout:C.number().optional()}).describe("Configuration for matching and routing hook callbacks.")),uXi=Be(()=>C.object({subtype:C.literal("initialize"),hooks:C.record(uDr(),C.array(cXi())).optional(),sdkMcpServers:C.array(C.string()).optional(),jsonSchema:C.record(C.string(),C.unknown()).optional(),systemPrompt:C.string().optional(),appendSystemPrompt:C.string().optional(),agents:C.record(C.string(),mDr()).optional(),promptSuggestions:C.boolean().optional(),agentProgressSummaries:C.boolean().optional()}).describe("Initializes the SDK session with hooks, MCP servers, and agent configuration.")),qup=Be(()=>C.object({commands:C.array(ann()),agents:C.array(lnn()),output_style:C.string(),available_output_styles:C.array(C.string()),models:C.array(ADr()),account:pDr(),pid:C.number().optional().describe("@internal CLI process PID for tmux socket isolation"),fast_mode_state:cUe().optional()}).describe("Response from session initialization with available commands, models, and account info.")),dXi=Be(()=>C.object({subtype:C.literal("interrupt")}).describe("Interrupts the currently running conversation turn.")),AXi=Be(()=>C.object({subtype:C.literal("can_use_tool"),tool_name:C.string(),input:C.record(C.string(),C.unknown()),permission_suggestions:C.array(lUe()).optional(),blocked_path:C.string().optional(),decision_reason:C.string().optional(),title:C.string().optional(),display_name:C.string().optional(),tool_use_id:C.string(),agent_id:C.string().optional(),description:C.string().optional()}).describe("Requests permission to use a tool with the given input.")),pXi=Be(()=>C.object({subtype:C.literal("set_permission_mode"),mode:JV(),ultraplan:C.boolean().optional().describe("@internal CCR ultraplan session marker.")}).describe("Sets the permission mode for tool execution handling.")),mXi=Be(()=>C.object({subtype:C.literal("set_model"),model:C.string().optional()}).describe("Sets the model to use for subsequent conversation turns.")),fXi=Be(()=>C.object({subtype:C.literal("set_max_thinking_tokens"),max_thinking_tokens:C.number().nullable()}).describe("Sets the maximum number of thinking tokens for extended thinking.")),gXi=Be(()=>C.object({subtype:C.literal("mcp_status")}).describe("Requests the current status of all MCP server connections.")),Gup=Be(()=>C.object({mcpServers:C.array(inn())}).describe("Response containing the current status of all MCP server connections.")),hXi=Be(()=>C.object({subtype:C.literal("get_context_usage")}).describe("Requests a breakdown of current context window usage by category.")),_Xi=Be(()=>C.object({name:C.string(),tokens:C.number(),color:C.string(),isDeferred:C.boolean().optional()})),yXi=Be(()=>C.object({color:C.string(),isFilled:C.boolean(),categoryName:C.string(),tokens:C.number(),percentage:C.number(),squareFullness:C.number()})),Wup=Be(()=>C.object({categories:C.array(_Xi()),totalTokens:C.number(),maxTokens:C.number(),rawMaxTokens:C.number(),percentage:C.number(),gridRows:C.array(C.array(yXi())),model:C.string(),memoryFiles:C.array(C.object({path:C.string(),type:C.string(),tokens:C.number()})),mcpTools:C.array(C.object({name:C.string(),serverName:C.string(),tokens:C.number(),isLoaded:C.boolean().optional()})),deferredBuiltinTools:C.array(C.object({name:C.string(),tokens:C.number(),isLoaded:C.boolean()})).optional(),systemTools:C.array(C.object({name:C.string(),tokens:C.number()})).optional(),systemPromptSections:C.array(C.object({name:C.string(),tokens:C.number()})).optional(),agents:C.array(C.object({agentType:C.string(),source:C.string(),tokens:C.number()})),slashCommands:C.object({totalCommands:C.number(),includedCommands:C.number(),tokens:C.number()}).optional(),skills:C.object({totalSkills:C.number(),includedSkills:C.number(),tokens:C.number(),skillFrontmatter:C.array(C.object({name:C.string(),source:C.string(),tokens:C.number()}))}).optional(),autoCompactThreshold:C.number().optional(),isAutoCompactEnabled:C.boolean(),messageBreakdown:C.object({toolCallTokens:C.number(),toolResultTokens:C.number(),attachmentTokens:C.number(),assistantMessageTokens:C.number(),userMessageTokens:C.number(),toolCallsByType:C.array(C.object({name:C.string(),callTokens:C.number(),resultTokens:C.number()})),attachmentsByType:C.array(C.object({name:C.string(),tokens:C.number()}))}).optional(),apiUsage:C.object({input_tokens:C.number(),output_tokens:C.number(),cache_creation_input_tokens:C.number(),cache_read_input_tokens:C.number()}).nullable()}).describe("Breakdown of current context window usage by category (system prompt, tools, messages, etc.).")),bXi=Be(()=>C.object({subtype:C.literal("rewind_files"),user_message_id:C.string(),dry_run:C.boolean().optional()}).describe("Rewinds file changes made since a specific user message.")),Vup=Be(()=>C.object({canRewind:C.boolean(),error:C.string().optional(),filesChanged:C.array(C.string()).optional(),insertions:C.number().optional(),deletions:C.number().optional()}).describe("Result of a rewindFiles operation.")),SXi=Be(()=>C.object({subtype:C.literal("cancel_async_message"),message_uuid:C.string()}).describe("Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution.")),Yup=Be(()=>C.object({cancelled:C.boolean()}).describe("Result of a cancel_async_message operation. cancelled=false means the message was not in the queue (already dequeued or never enqueued).")),EXi=Be(()=>C.object({subtype:C.literal("seed_read_state"),path:C.string(),mtime:C.number()}).describe("Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read \u2014 same staleness check as the normal path.")),vXi=Be(()=>C.object({subtype:C.literal("hook_callback"),callback_id:C.string(),input:dDr(),tool_use_id:C.string().optional()}).describe("Delivers a hook callback with its input data.")),TXi=Be(()=>C.object({subtype:C.literal("mcp_message"),server_name:C.string(),message:lXi()}).describe("Sends a JSON-RPC message to a specific MCP server.")),xXi=Be(()=>C.object({subtype:C.literal("mcp_set_servers"),servers:C.record(C.string(),jgt())}).describe("Replaces the set of dynamically managed MCP servers.")),Kup=Be(()=>C.object({added:C.array(C.string()),removed:C.array(C.string()),errors:C.record(C.string(),C.string())}).describe("Result of replacing the set of dynamically managed MCP servers.")),CXi=Be(()=>C.object({subtype:C.literal("reload_plugins")}).describe("Reloads plugins from disk and returns the refreshed session components.")),Qup=Be(()=>C.object({commands:C.array(ann()),agents:C.array(lnn()),plugins:C.array(C.object({name:C.string(),path:C.string(),source:C.string().optional()})),mcpServers:C.array(inn()),error_count:C.number()}).describe("Refreshed commands, agents, plugins, and MCP server status after reload.")),wXi=Be(()=>C.object({subtype:C.literal("mcp_reconnect"),serverName:C.string()}).describe("Reconnects a disconnected or failed MCP server.")),kXi=Be(()=>C.object({subtype:C.literal("mcp_toggle"),serverName:C.string(),enabled:C.boolean()}).describe("Enables or disables an MCP server.")),RXi=Be(()=>C.object({subtype:C.literal("stop_task"),task_id:C.string()}).describe("Stops a running task.")),IXi=Be(()=>C.object({subtype:C.literal("apply_flag_settings"),settings:C.record(C.string(),C.unknown())}).describe("Merges the provided settings into the flag settings layer, updating the active configuration.")),PXi=Be(()=>C.object({subtype:C.literal("get_settings")}).describe("Returns the effective merged settings and the raw per-source settings.")),Xup=Be(()=>C.object({effective:C.record(C.string(),C.unknown()),sources:C.array(C.object({source:C.enum(["userSettings","projectSettings","localSettings","flagSettings","policySettings"]),settings:C.record(C.string(),C.unknown())})).describe("Ordered low-to-high priority \u2014 later entries override earlier ones."),applied:C.object({model:C.string(),effort:C.enum(["low","medium","high","max"]).nullable()}).optional().describe("Runtime-resolved values after env overrides, session state, and model-specific defaults are applied. Unlike `effective` (disk merge), these reflect what will actually be sent to the API.")}).describe("Effective merged settings plus raw per-source settings in merge order.")),OXi=Be(()=>C.object({subtype:C.literal("elicitation"),mcp_server_name:C.string(),message:C.string(),mode:C.enum(["form","url"]).optional(),url:C.string().optional(),elicitation_id:C.string().optional(),requested_schema:C.record(C.string(),C.unknown()).optional()}).describe("Requests the SDK consumer to handle an MCP elicitation (user input request).")),TRo=Be(()=>C.object({action:C.enum(["accept","decline","cancel"]),content:C.record(C.string(),C.unknown()).optional()}).describe("Response from the SDK consumer for an elicitation request.")),MXi=Be(()=>C.union([dXi(),AXi(),uXi(),pXi(),mXi(),fXi(),gXi(),hXi(),vXi(),TXi(),bXi(),SXi(),EXi(),xXi(),CXi(),wXi(),kXi(),RXi(),IXi(),PXi(),OXi()])),ETn=Be(()=>C.object({type:C.literal("control_request"),request_id:C.string(),request:MXi()})),DXi=Be(()=>C.object({subtype:C.literal("success"),request_id:C.string(),response:C.record(C.string(),C.unknown()).optional()})),NXi=Be(()=>C.object({subtype:C.literal("error"),request_id:C.string(),error:C.string(),pending_permission_requests:C.array(C.lazy(()=>ETn())).optional()})),xRo=Be(()=>C.object({type:C.literal("control_response"),response:C.union([DXi(),NXi()])})),LXi=Be(()=>C.object({type:C.literal("control_cancel_request"),request_id:C.string()}).describe("Cancels a currently open control request.")),CRo=Be(()=>C.object({type:C.literal("keep_alive")}).describe("Keep-alive message to maintain WebSocket connection.")),FXi=Be(()=>C.object({type:C.literal("update_environment_variables"),variables:C.record(C.string(),C.string())}).describe("Updates environment variables at runtime.")),Jup=Be(()=>C.union([SDr(),hDr(),_Dr(),bDr(),xRo(),ETn(),LXi(),CRo()])),Zup=Be(()=>C.union([unn(),ETn(),xRo(),CRo(),FXi()]))});function Wxe(e,t,n,r){let o={type:"permissionPromptTool",permissionPromptToolName:t.name,toolResult:e};if(e.behavior==="allow"){let i=e.updatedPermissions;i&&(r.setAppState(l=>({...l,toolPermissionContext:iI(l.toolPermissionContext,i)})),aU(i));let a=Object.keys(e.updatedInput).length>0?e.updatedInput:n;return{...e,updatedInput:a,decisionReason:o}}else e.behavior==="deny"&&e.interrupt&&(v(`SDK permission prompt deny+interrupt: tool=${t.name} message=${e.message}`),r.abortController.abort());return{...e,decisionReason:o}}var idp,kRo,UXi,BXi,Jze,vTn=S(()=>{Pr();it();no();th();E_t();idp=Be(()=>vs.object({tool_name:vs.string().describe("The name of the tool requesting permission"),input:vs.record(vs.string(),vs.unknown()).describe("The input for the tool"),tool_use_id:vs.string().optional().describe("The unique tool use request ID")})),kRo=Be(()=>vs.enum(["user_temporary","user_permanent","user_reject"]).optional().catch(void 0)),UXi=Be(()=>vs.object({behavior:vs.literal("allow"),updatedInput:vs.record(vs.string(),vs.unknown()),updatedPermissions:vs.array(qbe()).optional().catch(e=>{v(`Malformed updatedPermissions from SDK host ignored: ${e.error.issues[0]?.message??"unknown"}`,{level:"warn"})}),toolUseID:vs.string().optional(),decisionClassification:kRo()})),BXi=Be(()=>vs.object({behavior:vs.literal("deny"),message:vs.string(),interrupt:vs.boolean().optional(),toolUseID:vs.string().optional(),decisionClassification:kRo()})),Jze=Be(()=>vs.union([UXi(),BXi()]));s(Wxe,"permissionPromptToolResultToPermissionDecision")});function HXi(e){return e.replace($Xi,t=>t==="\u2028"?"\\u2028":"\\u2029")}function ePt(e){return HXi(Fe(e))}var $Xi,TTn=S(()=>{jt();$Xi=/\u2028|\u2029/g;s(HXi,"escapeJsLineTerminators");s(ePt,"ndjsonSafeStringify")});import{randomUUID as xTn}from"crypto";function zXi(e){if(e){if(e.type==="classifier")return e.reason;switch(e.type){case"rule":case"mode":case"subcommandResults":case"permissionPromptTool":return;case"hook":case"asyncAgent":case"sandboxOverride":case"workingDir":case"safetyCheck":case"other":return e.reason}}}function qXi(e,t,n,r){let o;try{o=e.getActivityDescription?.(t)??e.getToolUseSummary?.(t)??e.userFacingName(t)}catch{o=e.name}return{tool_name:e.name,action_description:o,tool_use_id:n,request_id:r,input:t}}function RRo(e){console.error(e),process.exit(1)}async function WXi(e,t,n,r,o){let a=r.getAppState().toolPermissionContext.mode,l=aie(e,t,n,r,a,o,r.abortController.signal);for await(let c of l)if(c.permissionRequestResult&&(c.permissionRequestResult.behavior==="allow"||c.permissionRequestResult.behavior==="deny")){let u=c.permissionRequestResult;if(u.behavior==="allow"){let d=u.updatedInput||n,A=u.updatedPermissions??[];if(A.length>0){aU(A);let p=r.getAppState(),m=iI(p.toolPermissionContext,A);r.setAppState(f=>f.toolPermissionContext===m?f:{...f,toolPermissionContext:m})}return{behavior:"allow",updatedInput:d,userModified:!1,decisionReason:{type:"hook",hookName:"PermissionRequest"}}}else return{behavior:"deny",message:u.message||"Permission denied by PermissionRequest hook",decisionReason:{type:"hook",hookName:"PermissionRequest"}}}}var jXi,GXi,Vxe,tPt=S(()=>{wRo();tSn();it();Fd();Ct();vTn();hg();FF();jt();Pr();fLe();$vn();ap();th();aze();jt();Odn();TTn();jXi="SandboxNetworkAccess";s(zXi,"serializeDecisionReason");s(qXi,"buildRequiresActionDetails");GXi=1e3,Vxe=class{constructor(t,n){this.input=t;this.replayUserMessages=n;this.input=t,this.structuredInput=this.read()}static{s(this,"StructuredIO")}structuredInput;pendingRequests=new Map;restoredWorkerState=Promise.resolve(null);inputClosed=!1;unexpectedResponseCallback;resolvedToolUseIds=new Set;prependedLines=[];onControlRequestSent;onControlRequestResolved;outbound=new rve;trackResolvedToolUseId(t){if(t.request.subtype==="can_use_tool"&&(this.resolvedToolUseIds.add(t.request.tool_use_id),this.resolvedToolUseIds.size>GXi)){let n=this.resolvedToolUseIds.values().next().value;n!==void 0&&this.resolvedToolUseIds.delete(n)}}flushInternalEvents(){return Promise.resolve()}get internalEventsPending(){return 0}prependUserMessage(t){this.prependedLines.push(Fe({type:"user",session_id:"",message:{role:"user",content:t},parent_tool_use_id:null})+`
|
|
7765
7765
|
`)}async*read(){let t="",n=async function*(){for(;;){this.prependedLines.length>0&&(t=this.prependedLines.join("")+t,this.prependedLines=[]);let r=t.indexOf(`
|
|
7766
7766
|
`);if(r===-1)break;let o=t.slice(0,r);t=t.slice(r+1);let i=await this.processLine(o);i&&(Wt("info","cli_stdin_message_parsed",{type:i.type}),yield i)}}.bind(this);yield*n();for await(let r of this.input)t+=r,yield*n();if(t){let r=await this.processLine(t);r&&(yield r)}this.inputClosed=!0;for(let r of this.pendingRequests.values())r.reject(new Error("Tool permission stream closed before response received"))}getPendingPermissionRequests(){return Array.from(this.pendingRequests.values()).map(t=>t.request).filter(t=>t.request.subtype==="can_use_tool")}setUnexpectedResponseCallback(t){this.unexpectedResponseCallback=t}injectControlResponse(t){let n=t.response?.request_id;if(!n)return;let r=this.pendingRequests.get(n);if(r)if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n),this.write({type:"control_cancel_request",request_id:n}),t.response.subtype==="error")r.reject(new Error(t.response.error));else{let o=t.response.response;if(r.schema)try{r.resolve(r.schema.parse(o))}catch(i){r.reject(i)}else r.resolve({})}}setOnControlRequestSent(t){this.onControlRequestSent=t}setOnControlRequestResolved(t){this.onControlRequestResolved=t}async processLine(t){if(t)try{let n=gIt(Gt(t));if(n.type==="keep_alive")return;if(n.type==="update_environment_variables"){let r=Object.keys(n.variables);for(let[o,i]of Object.entries(n.variables))process.env[o]=i;v(`[structuredIO] applied update_environment_variables: ${r.join(", ")}`);return}if(n.type==="control_response"){let r="uuid"in n&&typeof n.uuid=="string"?n.uuid:void 0;r&&p2(r,"completed");let o=this.pendingRequests.get(n.response.request_id);if(!o){let l=(n.response.subtype==="success"?n.response.response:void 0)?.toolUseID;if(typeof l=="string"&&this.resolvedToolUseIds.has(l)){v(`Ignoring duplicate control_response for already-resolved toolUseID=${l} request_id=${n.response.request_id}`);return}this.unexpectedResponseCallback&&await this.unexpectedResponseCallback(n);return}if(this.trackResolvedToolUseId(o.request),this.pendingRequests.delete(n.response.request_id),o.request.request.subtype==="can_use_tool"&&this.onControlRequestResolved&&this.onControlRequestResolved(n.response.request_id),n.response.subtype==="error"){o.reject(new Error(n.response.error));return}let i=n.response.response;if(o.schema)try{o.resolve(o.schema.parse(i))}catch(a){o.reject(a)}else o.resolve({});return this.replayUserMessages?n:void 0}if(n.type!=="user"&&n.type!=="control_request"&&n.type!=="assistant"&&n.type!=="system"){v(`Ignoring unknown message type: ${n.type}`,{level:"warn"});return}return n.type==="control_request"?(n.request||RRo("Error: Missing request on control_request"),n):(n.type==="assistant"||n.type==="system"||n.message.role!=="user"&&RRo(`Error: Expected message role 'user', got '${n.message.role}'`),n)}catch(n){console.error(`Error parsing streaming input line: ${t}: ${n}`),process.exit(1)}}async write(t){Zo(ePt(t)+`
|
|
7767
|
-
`)}async sendRequest(t,n,r,o=xTn()){let i={type:"control_request",request_id:o,request:t};if(this.inputClosed)throw new Error("Stream closed");if(r?.aborted)throw new Error("Request aborted");this.outbound.enqueue(i),t.subtype==="can_use_tool"&&this.onControlRequestSent&&this.onControlRequestSent(i);let a=s(()=>{this.outbound.enqueue({type:"control_cancel_request",request_id:o});let l=this.pendingRequests.get(o);l&&(this.trackResolvedToolUseId(l.request),l.reject(new iu))},"aborted");r&&r.addEventListener("abort",a,{once:!0});try{return await new Promise((l,c)=>{this.pendingRequests.set(o,{request:{type:"control_request",request_id:o,request:t},resolve:s(u=>{l(u)},"resolve"),reject:c,schema:n})})}finally{r&&r.removeEventListener("abort",a),this.pendingRequests.delete(o)}}createCanUseTool(t){return async(n,r,o,i,a,l)=>{let c=l??await eb(n,r,o,i,a);if(c.behavior==="allow"||c.behavior==="deny")return c;let u=new AbortController,d=o.abortController.signal,A=s(()=>u.abort(),"onParentAbort");d.addEventListener("abort",A,{once:!0});try{let p=WXi(n.name,a,r,o,c.suggestions).then(b=>({source:"hook",decision:b})),m=xTn();t?.(qXi(n,r,a,m));let f=this.sendRequest({subtype:"can_use_tool",tool_name:n.name,input:r,permission_suggestions:c.suggestions,blocked_path:c.blockedPath,decision_reason:zXi(c.decisionReason),tool_use_id:a,agent_id:o.agentId},Jze(),u.signal,m).then(b=>({source:"sdk",result:b})),h=await Promise.race([p,f]);if(h.source==="hook"){if(h.decision)return f.catch(()=>{}),u.abort(),h.decision;let b=await f;return Wxe(b.result,n,r,o)}return Wxe(h.result,n,r,o)}catch(p){return Wxe({behavior:"deny",message:`Tool permission request failed: ${p}`,toolUseID:a},n,r,o)}finally{this.getPendingPermissionRequests().length===0&&Axe("running"),d.removeEventListener("abort",A)}}}createHookCallback(t,n){return{type:"callback",timeout:n,callback:s(async(r,o,i)=>{try{return await this.sendRequest({subtype:"hook_callback",callback_id:t,input:r,tool_use_id:o||void 0},axe(),i)}catch(a){return console.error(`Error in hook callback ${t}:`,a),{}}},"callback")}}async handleElicitation(t,n,r,o,i,a,l){try{return await this.sendRequest({subtype:"elicitation",mcp_server_name:t,message:n,mode:i,url:a,elicitation_id:l,requested_schema:r},TRo(),o)}catch{return{action:"cancel"}}}createSandboxAskCallback(){return async t=>{try{return(await this.sendRequest({subtype:"can_use_tool",tool_name:jXi,input:{host:t.host},tool_use_id:xTn(),description:`Allow network connection to ${t.host}?`},Jze())).behavior==="allow"}catch{return!1}}}async sendMcpMessage(t,n){return(await this.sendRequest({subtype:"mcp_message",server_name:t,message:n},C.object({mcp_response:C.any()}))).mcp_response}};s(RRo,"exitWithMessage");s(WXi,"executePermissionRequestHooksForSDK")});function IRo(e,t,n){let r=(0,nPt.useRef)(!1);(0,nPt.useEffect)(()=>{!yA()||r.current||(r.current=!0,e&&Z_t(e,n))},[t,e,n])}var nPt,PRo=S(()=>{nPt=U(et());RI();s(IRo,"useFileHistorySnapshotInit")});function CTn({hostPattern:{host:e},onUserResponse:t}){function n(i){switch(i){case"yes":t({allow:!0,persistToSettings:!1});break;case"yes-dont-ask-again":t({allow:!0,persistToSettings:!0});break;case"no":t({allow:!1,persistToSettings:!1});break}}s(n,"onSelect");let r=Kte(),o=[{label:"Yes",value:"yes"},...r?[]:[{label:(0,jk.jsxs)(_,{children:["Yes, and don't ask again for ",(0,jk.jsx)(_,{bold:!0,children:e})]}),value:"yes-dont-ask-again"}],{label:(0,jk.jsxs)(_,{children:["No, and tell Claude what to do differently ",(0,jk.jsx)(_,{bold:!0,children:"(esc)"})]}),value:"no"}];return(0,jk.jsx)(Xu,{title:"Network request outside of sandbox",children:(0,jk.jsxs)(O,{flexDirection:"column",paddingX:2,paddingY:1,children:[(0,jk.jsxs)(O,{children:[(0,jk.jsx)(_,{dimColor:!0,children:"Host:"}),(0,jk.jsxs)(_,{children:[" ",e]})]}),(0,jk.jsx)(O,{marginTop:1,children:(0,jk.jsx)(_,{children:"Do you want to allow this connection?"})}),(0,jk.jsx)(O,{children:(0,jk.jsx)(Jt,{options:o,onChange:n,onCancel:()=>{t({allow:!1,persistToSettings:!1})}})})]})})}var jk,ORo=S(()=>{Xe();Td();vt();va();TE();jk=U(Z());s(CTn,"SandboxPermissionRequest")});function VXi(e){let t=e.getHours()%12||12,n=String(e.getMinutes()).padStart(2,"0"),r=String(e.getSeconds()).padStart(2,"0"),o=e.getHours()<12?"am":"pm";return`${t}:${n}:${r}${o}`}function wTn(){let[e,t]=(0,Zze.useState)([]),[n,r]=(0,Zze.useState)(0);return(0,Zze.useEffect)(()=>{let o=tr.getSandboxViolationStore();return o.subscribe(a=>{t(a.slice(-10)),r(o.getTotalCount())})},[]),!tr.isSandboxingEnabled()||un()==="linux"||n===0?null:(0,tY.jsxs)(O,{flexDirection:"column",marginTop:1,children:[(0,tY.jsx)(O,{marginLeft:0,children:(0,tY.jsxs)(_,{color:"permission",children:["\u29C8 Sandbox blocked ",n," total"," ",n===1?"operation":"operations"]})}),e.map((o,i)=>(0,tY.jsx)(O,{paddingLeft:2,children:(0,tY.jsxs)(_,{dimColor:!0,children:[VXi(o.timestamp),o.command?` ${o.command}:`:""," ",o.line]})},`${o.timestamp.getTime()}-${i}`)),(0,tY.jsx)(O,{paddingLeft:2,children:(0,tY.jsxs)(_,{dimColor:!0,children:["\u2026 showing last ",Math.min(10,e.length)," of ",n]})})]})}var Zze,tY,MRo=S(()=>{Zze=U(et());Xe();Td();Zs();tY=U(Z());s(VXi,"formatTime");s(wTn,"SandboxViolationExpandedView")});function NRo({mcpClients:e=YXi}){let{addNotification:t}=ei();(0,DRo.useEffect)(()=>{if(ri())return;let n=e.filter(a=>a.type==="failed"&&a.config.type!=="sse-ide"&&a.config.type!=="ws-ide"&&a.config.type!=="claudeai-proxy"),r=e.filter(a=>a.type==="failed"&&a.config.type==="claudeai-proxy"&&EZt(a.name)),o=e.filter(a=>a.type==="needs-auth"&&a.config.type!=="claudeai-proxy"),i=e.filter(a=>a.type==="needs-auth"&&a.config.type==="claudeai-proxy"&&EZt(a.name));n.length===0&&r.length===0&&o.length===0&&i.length===0||(n.length>0&&t({key:"mcp-failed",jsx:(0,wS.jsxs)(wS.Fragment,{children:[(0,wS.jsxs)(_,{color:"error",children:[n.length," MCP"," ",n.length===1?"server":"servers"," failed"]}),(0,wS.jsx)(_,{dimColor:!0,children:" \xB7 /mcp"})]}),priority:"medium"}),r.length>0&&t({key:"mcp-claudeai-failed",jsx:(0,wS.jsxs)(wS.Fragment,{children:[(0,wS.jsxs)(_,{color:"error",children:[r.length," claude.ai"," ",r.length===1?"connector":"connectors"," ","unavailable"]}),(0,wS.jsx)(_,{dimColor:!0,children:" \xB7 /mcp"})]}),priority:"medium"}),o.length>0&&t({key:"mcp-needs-auth",jsx:(0,wS.jsxs)(wS.Fragment,{children:[(0,wS.jsxs)(_,{color:"warning",children:[o.length," MCP"," ",o.length===1?"server needs":"servers need"," ","auth"]}),(0,wS.jsx)(_,{dimColor:!0,children:" \xB7 /mcp"})]}),priority:"medium"}),i.length>0&&t({key:"mcp-claudeai-needs-auth",jsx:(0,wS.jsxs)(wS.Fragment,{children:[(0,wS.jsxs)(_,{color:"warning",children:[i.length," claude.ai"," ",i.length===1?"connector needs":"connectors need"," ","auth"]}),(0,wS.jsx)(_,{dimColor:!0,children:" \xB7 /mcp"})]}),priority:"medium"}))},[t,e])}var DRo,wS,YXi,LRo=S(()=>{DRo=U(et());hA();St();Xe();X_e();wS=U(Z()),YXi=[];s(NRo,"useMcpConnectivityStatus")});function FRo(){let{addNotification:e}=ei(),t=gt(i=>i.toolPermissionContext.mode),n=gt(i=>i.toolPermissionContext.isAutoModeAvailable),r=(0,eqe.useRef)(!1),o=(0,eqe.useRef)(t);(0,eqe.useEffect)(()=>{let i=o.current;if(o.current=t,ri()||r.current||!(t==="default"&&i!=="default"&&i!=="auto"&&!n&&RG()))return;let l=uie();l&&(r.current=!0,e({key:"auto-mode-unavailable",text:Dve(l),color:"warning",priority:"medium"}))},[t,n,e])}var eqe,URo=S(()=>{eqe=U(et());hA();St();fr();Hy();Mn();s(FRo,"useAutoModeUnavailableNotification")});function BRo(){let{addNotification:e}=ei(),t=Mr(),[n,r]=nY.useState(()=>qe("true")),o=nY.useRef(new Set),i=nY.useCallback((l,c)=>{let u=`${l}:${c}`;if(o.current.has(u))return;o.current.add(u),v(`LSP error: ${l} - ${c}`),t(A=>{let p=new Set(A.plugins.errors.map(f=>f.type==="generic-error"?`generic-error:${f.source}:${f.error}`:`${f.type}:${f.source}`)),m=`generic-error:${l}:${c}`;return p.has(m)?A:{...A,plugins:{...A.plugins,errors:[...A.plugins.errors,{type:"generic-error",source:l,error:c}]}}});let d=l.startsWith("plugin:")?l.split(":")[1]??l:l;e({key:`lsp-error-${l}`,jsx:(0,Wae.jsxs)(Wae.Fragment,{children:[(0,Wae.jsxs)(_,{color:"error",children:["LSP for ",d," failed"]}),(0,Wae.jsx)(_,{dimColor:!0,children:" \xB7 /plugin for details"})]}),priority:"medium",timeoutMs:8e3})},[e,t]),a=nY.useCallback(()=>{if(ri()||yJ())return;let l=xSe();if(l.status==="failed"){i("lsp-manager",l.error.message),r(!1);return}if(l.status==="pending"||l.status==="not-started")return;let c=R4();if(c){let u=c.getAllServers();for(let[d,A]of u)A.state==="error"&&A.lastError&&i(d,A.lastError.message)}},[i]);fE(a,n?KXi:null),nY.useEffect(()=>{ri()||!n||a()},[a,n])}var nY,Wae,KXi,$Ro=S(()=>{nY=U(et());VR();St();hA();Xe();gj();fr();it();Ot();Wae=U(Z()),KXi=5e3;s(BRo,"useLspInitializationNotification")});async function jRo(e){if(!e||!e.trim())return v("[binaryCheck] Empty command provided, returning false"),!1;let t=e.trim(),n=HRo.get(t);if(n!==void 0)return v(`[binaryCheck] Cache hit for '${t}': ${n}`),n;let r=!1;return await Hb(t).catch(()=>null)&&(r=!0),HRo.set(t,r),v(`[binaryCheck] Binary '${t}' ${r?"found":"not found"}`),r}var HRo,zRo=S(()=>{it();oD();HRo=new Map;s(jRo,"isBinaryInstalled")});import{extname as QXi}from"path";function JXi(e){return rH.has(e.toLowerCase())}function ZXi(e){if(!e)return null;if(typeof e=="string")return v("[lspRecommendation] Skipping string path lspServers (not readable from marketplace)"),null;if(Array.isArray(e)){for(let t of e){if(typeof t=="string")continue;let n=GRo(t);if(n)return n}return null}return GRo(e)}function qRo(e){return typeof e=="object"&&e!==null}function GRo(e){let t=new Set,n=null;for(let[r,o]of Object.entries(e)){if(!qRo(o))continue;!n&&typeof o.command=="string"&&(n=o.command);let i=o.extensionToLanguage;if(qRo(i))for(let a of Object.keys(i))t.add(a.toLowerCase())}return!n||t.size===0?null:{extensions:t,command:n}}async function eJi(){let e=new Map;try{let t=await Hc();for(let n of Object.keys(t))try{let r=await PT(n),o=JXi(n);for(let i of r.plugins){if(!i.lspServers)continue;let a=ZXi(i.lspServers);if(!a)continue;let l=`${i.name}@${n}`;e.set(l,{entry:i,marketplaceName:n,extensions:a.extensions,command:a.command,isOfficial:o})}}catch(r){v(`[lspRecommendation] Failed to load marketplace ${n}: ${r}`)}}catch(t){v(`[lspRecommendation] Failed to load marketplaces config: ${t}`)}return e}async function WRo(e){if(tJi())return v("[lspRecommendation] Recommendations are disabled"),[];let t=QXi(e).toLowerCase();if(!t)return v("[lspRecommendation] No file extension found"),[];v(`[lspRecommendation] Looking for LSP plugins for ${t}`);let n=await eJi(),o=rt().lspRecommendationNeverPlugins??[],i=[];for(let[l,c]of n)if(c.extensions.has(t)){if(o.includes(l)){v(`[lspRecommendation] Skipping ${l} (in never suggest list)`);continue}if(nL(l)){v(`[lspRecommendation] Skipping ${l} (already installed)`);continue}i.push({info:c,pluginId:l})}let a=[];for(let{info:l,pluginId:c}of i)await jRo(l.command)?(a.push({info:l,pluginId:c}),v(`[lspRecommendation] Binary '${l.command}' found for ${c}`)):v(`[lspRecommendation] Skipping ${c} (binary '${l.command}' not found)`);return a.sort((l,c)=>l.info.isOfficial&&!c.info.isOfficial?-1:!l.info.isOfficial&&c.info.isOfficial?1:0),a.map(({info:l,pluginId:c})=>({pluginId:c,pluginName:l.entry.name,marketplaceName:l.marketplaceName,description:l.entry.description,isOfficial:l.isOfficial,extensions:Array.from(l.extensions),command:l.command}))}function VRo(e){kt(t=>{let n=t.lspRecommendationNeverPlugins??[];return n.includes(e)?t:{...t,lspRecommendationNeverPlugins:[...n,e]}}),v(`[lspRecommendation] Added ${e} to never suggest`)}function YRo(){kt(e=>{let t=(e.lspRecommendationIgnoredCount??0)+1;return{...e,lspRecommendationIgnoredCount:t}}),v("[lspRecommendation] Incremented ignored count")}function tJi(){let e=rt();return e.lspRecommendationDisabled===!0||(e.lspRecommendationIgnoredCount??0)>=XXi}var XXi,KRo=S(()=>{zRo();mn();it();hS();nm();Lx();XXi=5;s(JXi,"isOfficialMarketplace");s(ZXi,"extractLspInfoFromManifest");s(qRo,"isRecord");s(GRo,"extractFromServerConfigRecord");s(eJi,"getLspPluginsFromMarketplaces");s(WRo,"getMatchingLspPlugins");s(VRo,"addToNeverSuggest");s(YRo,"incrementIgnoredCount");s(tJi,"isLspRecommendationsDisabled")});function rPt(){let[e,t]=Vae.useState(null),n=Vae.useRef(!1),r=Vae.useCallback(i=>{ri()||e||n.current||(n.current=!0,i().then(a=>{a&&t(a)}).catch(ne).finally(()=>{n.current=!1}))},[e]),o=Vae.useCallback(()=>t(null),[]);return{recommendation:e,clearRecommendation:o,tryResolve:r}}async function oPt(e,t,n,r,o){try{let i=await vC(e);if(!i)throw new Error(`Plugin ${e} not found in marketplace`);await o(i),r({key:`${n}-installed`,jsx:(0,kTn.jsxs)(_,{color:"success",children:[Ze.tick," ",t," installed \xB7 restart to apply"]}),priority:"immediate",timeoutMs:5e3})}catch(i){ne(i),r({key:`${n}-install-failed`,jsx:(0,kTn.jsxs)(_,{color:"error",children:["Failed to install ",t]}),priority:"immediate",timeoutMs:5e3})}}var Vae,kTn,RTn=S(()=>{oo();Vae=U(et());St();Xe();wt();nm();kTn=U(Z());s(rPt,"usePluginRecommendationBase");s(oPt,"installPluginAndNotify")});import{extname as nJi,join as rJi}from"path";function QRo(){let e=gt(l=>l.fileHistory.trackedFiles),{addNotification:t}=ei(),n=Yxe.useRef(new Set),{recommendation:r,clearRecommendation:o,tryResolve:i}=rPt();Yxe.useEffect(()=>{i(async()=>{if(MMt())return null;let l=[];for(let c of e)n.current.has(c)||(n.current.add(c),l.push(c));for(let c of l)try{let d=(await WRo(c))[0];if(d)return v(`[useLspPluginRecommendation] Found match: ${d.pluginName} for ${c}`),DMt(!0),{pluginId:d.pluginId,pluginName:d.pluginName,pluginDescription:d.description,fileExtension:nJi(c),shownAt:Date.now()}}catch(u){ne(u)}return null})},[e,i]);let a=Yxe.useCallback(l=>{if(!r)return;let{pluginId:c,pluginName:u,shownAt:d}=r;switch(v(`[useLspPluginRecommendation] User response: ${l} for ${u}`),l){case"yes":oPt(c,u,"lsp-plugin",t,async A=>{v(`[useLspPluginRecommendation] Installing plugin: ${c}`);let p=typeof A.entry.source=="string"?rJi(A.marketplaceInstallLocation,A.entry.source):void 0;await ZHe(c,A.entry,"user",void 0,p);let m=An("userSettings");Jn("userSettings",{enabledPlugins:{...m?.enabledPlugins,[c]:!0}}),v(`[useLspPluginRecommendation] Plugin installed: ${c}`)});break;case"no":{let A=Date.now()-d;A>=oJi&&(v(`[useLspPluginRecommendation] Timeout detected (${A}ms), incrementing ignored count`),YRo());break}case"never":VRo(c);break;case"disable":kt(A=>A.lspRecommendationDisabled?A:{...A,lspRecommendationDisabled:!0});break}o()},[r,t,o]);return{recommendation:r,handleResponse:a}}var Yxe,oJi,XRo=S(()=>{Yxe=U(et());St();hA();fr();mn();it();wt();KRo();d7();Mn();RTn();oJi=28e3;s(QRo,"useLspPluginRecommendation")});function JRo({pluginName:e,pluginDescription:t,fileExtension:n,onResponse:r}){let o=sPt.useRef(r);o.current=r,sPt.useEffect(()=>{let l=setTimeout(c=>c.current("no"),sJi,o);return()=>clearTimeout(l)},[]);function i(l){switch(l){case"yes":r("yes");break;case"no":r("no");break;case"never":r("never");break;case"disable":r("disable");break}}return s(i,"onSelect"),(0,x_.jsx)(Xu,{title:"LSP Plugin Recommendation",children:(0,x_.jsxs)(O,{flexDirection:"column",paddingX:2,paddingY:1,children:[(0,x_.jsx)(O,{marginBottom:1,children:(0,x_.jsx)(_,{dimColor:!0,children:"LSP provides code intelligence like go-to-definition and error checking"})}),(0,x_.jsxs)(O,{children:[(0,x_.jsx)(_,{dimColor:!0,children:"Plugin:"}),(0,x_.jsxs)(_,{children:[" ",e]})]}),t&&(0,x_.jsx)(O,{children:(0,x_.jsx)(_,{dimColor:!0,children:t})}),(0,x_.jsxs)(O,{children:[(0,x_.jsx)(_,{dimColor:!0,children:"Triggered by:"}),(0,x_.jsxs)(_,{children:[" ",n," files"]})]}),(0,x_.jsx)(O,{marginTop:1,children:(0,x_.jsx)(_,{children:"Would you like to install this LSP plugin?"})}),(0,x_.jsx)(O,{children:(0,x_.jsx)(Jt,{options:[{label:(0,x_.jsxs)(_,{children:["Yes, install ",(0,x_.jsx)(_,{bold:!0,children:e})]}),value:"yes"},{label:"No, not now",value:"no"},{label:(0,x_.jsxs)(_,{children:["Never for ",(0,x_.jsx)(_,{bold:!0,children:e})]}),value:"never"},{label:"Disable all LSP recommendations",value:"disable"}],onChange:i,onCancel:()=>r("no")})})]})})}var sPt,x_,sJi,ZRo=S(()=>{sPt=U(et());Xe();va();TE();x_=U(Z()),sJi=3e4;s(JRo,"LspRecommendationMenu")});function eIo(){let e=Kxe.useSyncExternalStore(Y$r,Vin),{addNotification:t}=ei(),{recommendation:n,clearRecommendation:r,tryResolve:o}=rPt();Kxe.useEffect(()=>{e&&o(async()=>{let a=await X$r(e);return a&&(v(`[useClaudeCodeHintRecommendation] surfacing ${a.pluginId} from ${a.sourceCommand}`),V$r()),Vin()===e&&W$r(),a})},[e,o]);let i=Kxe.useCallback(a=>{if(n){switch(J$r(n.pluginId),q("tengu_plugin_hint_response",{_PROTO_plugin_name:n.pluginName,_PROTO_marketplace_name:n.marketplaceName,response:a}),a){case"yes":{let{pluginId:l,pluginName:c,marketplaceName:u}=n;oPt(l,c,"hint-plugin",t,async d=>{let A=await u7({pluginId:l,entry:d.entry,marketplaceName:u,scope:"user",trigger:"hint"});if(!A.success)throw new Error(A.error)});break}case"disable":Z$r();break;case"no":break}r()}},[n,t,r]);return{recommendation:n,handleResponse:i}}var Kxe,tIo=S(()=>{Kxe=U(et());hA();vt();QBe();it();rbt();d7();RTn();s(eIo,"useClaudeCodeHintRecommendation")});function nIo({pluginName:e,pluginDescription:t,marketplaceName:n,sourceCommand:r,onResponse:o}){let i=iPt.useRef(o);i.current=o,iPt.useEffect(()=>{let c=setTimeout(u=>u.current("no"),iJi,i);return()=>clearTimeout(c)},[]);function a(c){switch(c){case"yes":o("yes");break;case"disable":o("disable");break;default:o("no")}}return s(a,"onSelect"),(0,ly.jsx)(Xu,{title:"Plugin Recommendation",children:(0,ly.jsxs)(O,{flexDirection:"column",paddingX:2,paddingY:1,children:[(0,ly.jsx)(O,{marginBottom:1,children:(0,ly.jsxs)(_,{dimColor:!0,children:["The ",(0,ly.jsx)(_,{bold:!0,children:r})," command suggests installing a plugin."]})}),(0,ly.jsxs)(O,{children:[(0,ly.jsx)(_,{dimColor:!0,children:"Plugin:"}),(0,ly.jsxs)(_,{children:[" ",e]})]}),(0,ly.jsxs)(O,{children:[(0,ly.jsx)(_,{dimColor:!0,children:"Marketplace:"}),(0,ly.jsxs)(_,{children:[" ",n]})]}),t&&(0,ly.jsx)(O,{children:(0,ly.jsx)(_,{dimColor:!0,children:t})}),(0,ly.jsx)(O,{marginTop:1,children:(0,ly.jsx)(_,{children:"Would you like to install it?"})}),(0,ly.jsx)(O,{children:(0,ly.jsx)(Jt,{options:[{label:(0,ly.jsxs)(_,{children:["Yes, install ",(0,ly.jsx)(_,{bold:!0,children:e})]}),value:"yes"},{label:"No",value:"no"},{label:"No, and don't show plugin installation hints again",value:"disable"}],onChange:a,onCancel:()=>o("no")})})]})})}var iPt,ly,iJi,rIo=S(()=>{iPt=U(et());Xe();va();TE();ly=U(Z()),iJi=3e4;s(nIo,"PluginHintMenu")});function oIo(){let{addNotification:e}=ei(),t=gt(i=>i.plugins.installationStatus),{totalFailed:n,failedMarketplacesCount:r,failedPluginsCount:o}=(0,aPt.useMemo)(()=>{if(!t)return{totalFailed:0,failedMarketplacesCount:0,failedPluginsCount:0};let i=t.marketplaces.filter(l=>l.status==="failed"),a=t.plugins.filter(l=>l.status==="failed");return{totalFailed:i.length+a.length,failedMarketplacesCount:i.length,failedPluginsCount:a.length}},[t]);(0,aPt.useEffect)(()=>{if(!ri()){if(!t){v("No installation status to monitor");return}n!==0&&(v(`Plugin installation status: ${r} failed marketplaces, ${o} failed plugins`),n!==0&&(v(`Adding notification for ${n} failed installations`),e({key:"plugin-install-failed",jsx:(0,Yae.jsxs)(Yae.Fragment,{children:[(0,Yae.jsxs)(_,{color:"error",children:[n," ",Qn(n,"plugin")," failed to install"]}),(0,Yae.jsx)(_,{dimColor:!0,children:" \xB7 /plugin for details"})]}),priority:"medium"})))}},[e,n,r,o])}var aPt,Yae,sIo=S(()=>{aPt=U(et());St();hA();Xe();fr();it();Do();Yae=U(Z());s(oIo,"usePluginInstallationStatus")});function iIo(){let{addNotification:e}=ei(),[t,n]=(0,tqe.useState)([]);(0,tqe.useEffect)(()=>ri()?void 0:zso(o=>{v(`Plugin autoupdate notification: ${o.length} plugin(s) updated`),n(o)}),[]),(0,tqe.useEffect)(()=>{if(ri()||t.length===0)return;let r=t.map(i=>{let a=i.indexOf("@");return a>0?i.substring(0,a):i}),o=r.length<=2?r.join(" and "):`${r.length} plugins`;e({key:"plugin-autoupdate-restart",jsx:(0,Kae.jsxs)(Kae.Fragment,{children:[(0,Kae.jsxs)(_,{color:"success",children:[r.length===1?"Plugin":"Plugins"," updated:"," ",o]}),(0,Kae.jsx)(_,{dimColor:!0,children:" \xB7 Run /reload-plugins to apply"})]}),priority:"low",timeoutMs:1e4}),v(`Showing plugin autoupdate notification for: ${r.join(", ")}`)},[t,e])}var tqe,Kae,aIo=S(()=>{tqe=U(et());St();hA();Xe();it();LCt();Kae=U(Z());s(iIo,"usePluginAutoupdateNotification")});import{isAbsolute as aJi,resolve as lJi}from"path";function ITn(e,t,n){let r=[],o=[],i=[];for(let[a,l]of Object.entries(e)){let c=t[a],u=lIo(l.source,n?.projectRoot);c?l.sourceIsFallback||$g(u,c.source)?i.push(a):o.push({name:a,declaredSource:u,materializedSource:c.source}):r.push(a)}return{missing:r,sourceChanged:o,upToDate:i}}async function lPt(e){let t=a7();if(Object.keys(t).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let n;try{n=await Hc()}catch(d){ne(d),n={}}let r=ITn(t,n,{projectRoot:Un()}),o=[...r.missing.map(d=>({name:d,source:lIo(t[d].source),action:"install"})),...r.sourceChanged.map(({name:d,declaredSource:A})=>({name:d,source:A,action:"update"}))],i=[],a=[];for(let d of o){if(e?.skip?.(d.name,d.source)){i.push(d.name);continue}if(d.action==="update"&&oH(d.source)&&!await Yi(d.source.path)){v(`[reconcile] '${d.name}' declared path does not exist; keeping materialized entry`),i.push(d.name);continue}a.push(d)}if(a.length===0)return{installed:[],updated:[],failed:[],upToDate:r.upToDate,skipped:i};v(`[reconcile] ${a.length} marketplace(s): ${a.map(d=>`${d.name}(${d.action})`).join(", ")}`);let l=[],c=[],u=[];for(let d=0;d<a.length;d++){let{name:A,source:p,action:m}=a[d];e?.onProgress?.({type:"installing",name:A,action:m,index:d+1,total:a.length});try{let f=await $j(p);m==="install"?l.push(A):c.push(A),e?.onProgress?.({type:"installed",name:A,alreadyMaterialized:f.alreadyMaterialized})}catch(f){let h=We(f);u.push({name:A,error:h}),e?.onProgress?.({type:"failed",name:A,error:h}),ne(f)}}return{installed:l,updated:c,failed:u,upToDate:r.upToDate,skipped:i}}function lIo(e,t){if((e.source==="directory"||e.source==="file")&&!aJi(e.path)){let n=t??Un(),r=zg(n);return{...e,path:lJi(r??n,e.path)}}return e}var PTn=S(()=>{pG();St();it();Ct();oi();Pa();wt();nm();Lx();s(ITn,"diffMarketplaces");s(lPt,"reconcileMarketplaces");s(lIo,"normalizeSource")});function OTn(e,t,n,r){e(o=>({...o,plugins:{...o.plugins,installationStatus:{...o.plugins.installationStatus,marketplaces:o.plugins.installationStatus.marketplaces.map(i=>i.name===t?{...i,status:n,error:r}:i)}}}))}async function cIo(e){v("performBackgroundPluginInstallations called");try{let t=a7(),n=await Hc().catch(()=>({})),r=ITn(t,n),o=[...r.missing,...r.sourceChanged.map(l=>l.name)];if(e(l=>({...l,plugins:{...l.plugins,installationStatus:{marketplaces:o.map(c=>({name:c,status:"pending"})),plugins:[]}}})),o.length===0)return;v(`Installing ${o.length} marketplace(s) in background`);let i=await lPt({onProgress:s(l=>{switch(l.type){case"installing":OTn(e,l.name,"installing");break;case"installed":OTn(e,l.name,"installed");break;case"failed":OTn(e,l.name,"failed",l.error);break}},"onProgress")}),a={installed_count:i.installed.length,updated_count:i.updated.length,failed_count:i.failed.length,up_to_date_count:i.upToDate.length};if(q("tengu_marketplace_background_install",a),Wt("info","tengu_marketplace_background_install",a),i.installed.length>0){Bj(),v(`Auto-refreshing plugins after ${i.installed.length} new marketplace(s) installed`);try{await Jie(e)}catch(l){ne(l),v(`Auto-refresh failed, falling back to needsRefresh: ${l}`,{level:"warn"}),hk("performBackgroundPluginInstallations: auto-refresh failed"),e(c=>c.plugins.needsRefresh?c:{...c,plugins:{...c.plugins,needsRefresh:!0}})}}else i.updated.length>0&&(Bj(),hk("performBackgroundPluginInstallations: marketplaces reconciled"),e(l=>l.plugins.needsRefresh?l:{...l,plugins:{...l.plugins,needsRefresh:!0}}))}catch(t){ne(t)}}var uIo=S(()=>{it();Fd();wt();nm();dg();PTn();lkt();vt();s(OTn,"updateMarketplaceStatus");s(cIo,"performBackgroundPluginInstallations")});async function dIo(e){if(v("performStartupChecks called"),!dA()){v("Trust not accepted for current directory - skipping plugin installations");return}try{v("Starting background plugin installations"),await TTt()&&(Bj(),hk("performStartupChecks: seed marketplaces changed"),e(n=>n.plugins.needsRefresh?n:{...n,plugins:{...n.plugins,needsRefresh:!0}})),await cIo(e)}catch(t){v(`Error initiating background plugin installations: ${t}`)}}var AIo=S(()=>{uIo();mn();it();nm();dg();s(dIo,"performStartupChecks")});function pIo(){let[e,t]=(0,cPt.useState)(c1.getInstance().getStatus());return(0,cPt.useEffect)(()=>c1.getInstance().subscribe(t),[]),!e.isAuthenticating&&!e.error&&e.output.length===0||!e.isAuthenticating&&!e.error?null:(0,Lz.jsxs)(O,{flexDirection:"column",borderStyle:"round",borderColor:"permission",paddingX:1,marginY:1,children:[(0,Lz.jsx)(_,{bold:!0,color:"permission",children:"Cloud Authentication"}),e.output.length>0&&(0,Lz.jsx)(O,{flexDirection:"column",marginTop:1,children:e.output.slice(-5).map((n,r)=>{let o=n.match(cJi);if(!o)return(0,Lz.jsx)(_,{dimColor:!0,children:n},r);let i=o[0],a=o.index??0,l=n.slice(0,a),c=n.slice(a+i.length);return(0,Lz.jsxs)(_,{dimColor:!0,children:[l,(0,Lz.jsx)(xo,{url:i,children:i}),c]},r)})}),e.error&&(0,Lz.jsx)(O,{marginTop:1,children:(0,Lz.jsx)(_,{color:"error",children:e.error})})]})}var cPt,Lz,cJi,mIo=S(()=>{cPt=U(et());Xe();grt();Lz=U(Z()),cJi=/https?:\/\/\S+/;s(pIo,"AwsAuthStatusBox")});function fIo(e){let{addNotification:t}=ei(),n=Q9(),r=(0,Fz.useMemo)(()=>O7t(n,e),[n,e]),o=(0,Fz.useMemo)(()=>M7t(n),[n]),i=(0,Fz.useRef)(null),a=Ei(),l=lH(),c=a==="team"||a==="enterprise",[u,d]=(0,Fz.useState)(!1);(0,Fz.useEffect)(()=>{ri()||(n.isUsingOverage&&!u&&(!c||l)?(t({key:"limit-reached",text:o,priority:"immediate"}),d(!0)):!n.isUsingOverage&&u&&d(!1))},[n.isUsingOverage,o,u,t,l,c]),(0,Fz.useEffect)(()=>{ri()||r&&r!==i.current&&(i.current=r,t({key:"rate-limit-warning",jsx:(0,MTn.jsx)(_,{children:(0,MTn.jsx)(_,{color:"warning",children:r})}),priority:"high"}))},[r,t])}var Fz,MTn,gIo=S(()=>{Fz=U(et());hA();Xe();y2();oUe();Cr();MG();St();MTn=U(Z());s(fIo,"useRateLimitWarningNotification")});function dJi(e){let t=e.toLowerCase(),n=lr();for(let[r,o]of Object.entries(uJi)){let i=o.retirementDates[n];if(!(!t.includes(r)||!i))return{isDeprecated:!0,modelName:o.modelName,retirementDate:i}}return{isDeprecated:!1}}function uPt(e){if(!e)return null;let t=dJi(e);return t.isDeprecated?`\u26A0 ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}var uJi,DTn=S(()=>{Jc();uJi={"claude-3-opus":{modelName:"Claude 3 Opus",retirementDates:{firstParty:"January 5, 2026",bedrock:"January 15, 2026",vertex:"January 5, 2026",foundry:"January 5, 2026"}},"claude-3-7-sonnet":{modelName:"Claude 3.7 Sonnet",retirementDates:{firstParty:"February 19, 2026",bedrock:"April 28, 2026",vertex:"May 11, 2026",foundry:"February 19, 2026"}},"claude-3-5-haiku":{modelName:"Claude 3.5 Haiku",retirementDates:{firstParty:"February 19, 2026",bedrock:null,vertex:null,foundry:null}}};s(dJi,"getDeprecatedModelInfo");s(uPt,"getModelDeprecationWarning")});function hIo(e){let{addNotification:t}=ei(),n=(0,dPt.useRef)(null);(0,dPt.useEffect)(()=>{if(ri())return;let r=uPt(e);r&&r!==n.current&&(n.current=r,t({key:"model-deprecation-warning",text:r,color:"warning",priority:"high"})),r||(n.current=null)},[e,t])}var dPt,_Io=S(()=>{dPt=U(et());hA();DTn();St();s(hIo,"useDeprecationWarningNotification")});function yIo(){qL(async()=>My()||qe(process.env.DISABLE_INSTALLATION_CHECKS)||await c4()==="development"?null:{timeoutMs:15e3,key:"npm-deprecation-warning",text:AJi,color:"warning",priority:"high"})}var AJi,bIo=S(()=>{iD();mQ();Ot();Gae();AJi="Claude Code has switched from npm to native installer. Run `claude install` or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options.";s(yIo,"useNpmDeprecationNotification")});function SIo({ideSelection:e,mcpClients:t,ideInstallationStatus:n}){let{addNotification:r,removeNotification:o}=ei(),{status:i,ideName:a}=Pxe(t),l=(0,Qae.useRef)(!1),c=n?hU(n?.ideType):!1,u=n?.error||c,d=i==="connected"&&(e?.filePath||e?.text&&e.lineCount>0),A=i==="connected"&&!d,p=u&&!c&&!A&&!d,m=u&&c&&!A&&!d;(0,Qae.useEffect)(()=>{if(ri())return;if(aS()||i!==null||m){o("ide-status-hint");return}if(l.current||(rt().ideHintShownCount??0)>=pJi)return;let f=setTimeout((h,b)=>{gye(!0).then(E=>{let x=E[0]?.name;x&&!h.current&&(h.current=!0,kt(T=>({...T,ideHintShownCount:(T.ideHintShownCount??0)+1})),b({key:"ide-status-hint",jsx:(0,APt.jsxs)(_,{dimColor:!0,children:["/ide for ",(0,APt.jsx)(_,{color:"ide",children:x})]}),priority:"low"}))})},3e3,l,r);return()=>clearTimeout(f)},[r,o,i,m]),(0,Qae.useEffect)(()=>{if(!ri()){if(p||m||i!=="disconnected"||!a){o("ide-status-disconnected");return}r({key:"ide-status-disconnected",text:`${a} disconnected`,color:"error",priority:"medium"})}},[r,o,i,a,p,m]),(0,Qae.useEffect)(()=>{if(!ri()){if(!m){o("ide-status-jetbrains-disconnected");return}r({key:"ide-status-jetbrains-disconnected",text:"IDE plugin not connected \xB7 /status for info",priority:"medium"})}},[r,o,m]),(0,Qae.useEffect)(()=>{if(!ri()){if(!p){o("ide-status-install-error");return}r({key:"ide-status-install-error",text:"IDE extension install failed (see /status for info)",color:"error",priority:"medium"})}},[r,o,p])}var Qae,APt,pJi,EIo=S(()=>{Qae=U(et());hA();Xe();mn();gf();St();ORt();APt=U(Z()),pJi=5;s(SIo,"useIDEStatusIndicator")});function TIo(){qL(()=>{let e=rt(),t=[];for(let n of mJi){let r=n(e);r&&t.push(r)}return t.length>0?t:null})}function vIo(e){return e!==void 0&&Date.now()-e<3e3}var mJi,xIo=S(()=>{mn();Gae();mJi=[e=>{if(vIo(e.sonnet45To46MigrationTimestamp))return{key:"sonnet-46-update",text:"Model updated to Sonnet 4.6",color:"suggestion",priority:"high",timeoutMs:3e3}},e=>{let t=!!e.legacyOpusMigrationTimestamp,n=e.legacyOpusMigrationTimestamp??e.opusProMigrationTimestamp;if(vIo(n))return{key:"opus-pro-update",text:t?"Model updated to Opus 4.6 \xB7 Set CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP=1 to opt out":"Model updated to Opus 4.6",color:"suggestion",priority:"high",timeoutMs:t?8e3:3e3}}];s(TIo,"useModelMigrationNotifications");s(vIo,"recent")});function CIo(){qL(async()=>{if((rt().subscriptionNoticeCount??0)>=fJi)return null;let e=await gJi();return e===null?null:(kt(t=>({...t,subscriptionNoticeCount:(t.subscriptionNoticeCount??0)+1})),q("tengu_switch_to_subscription_notice_shown",{}),{key:"switch-to-subscription",jsx:(0,NTn.jsxs)(_,{color:"suggestion",children:["Use your existing Claude ",e," plan with Claude Code",(0,NTn.jsxs)(_,{color:"text",dimColor:!0,children:[" ","\xB7 /login to activate"]})]}),priority:"low"})})}async function gJi(){if(to())return null;let e=await eKn();return e?e.account.has_claude_max?"Max":e.account.has_claude_pro?"Pro":null:null}var NTn,fJi,wIo=S(()=>{sme();Cr();Xe();vt();mn();Gae();NTn=U(Z()),fJi=3;s(CIo,"useCanSwitchToExistingSubscription");s(gJi,"getExistingClaudeSubscription")});function kIo(e){if(!("text"in e))return 1;let t=e.text.match(/^(\d+)/);return t?.[1]?parseInt(t[1],10):1}function hJi(e,t){return RIo(kIo(e)+1)}function RIo(e){return{key:"teammate-spawn",text:e===1?"1 agent spawned":`${e} agents spawned`,priority:"low",timeoutMs:5e3,fold:hJi}}function _Ji(e,t){return IIo(kIo(e)+1)}function IIo(e){return{key:"teammate-shutdown",text:e===1?"1 agent shut down":`${e} agents shut down`,priority:"low",timeoutMs:5e3,fold:_Ji}}function PIo(){let e=gt(o=>o.tasks),{addNotification:t}=ei(),n=(0,nqe.useRef)(new Set),r=(0,nqe.useRef)(new Set);(0,nqe.useEffect)(()=>{if(!ri())for(let[o,i]of Object.entries(e))ch(i)&&(i.status==="running"&&!n.current.has(o)&&(n.current.add(o),t(RIo(1))),i.status==="completed"&&!r.current.has(o)&&(r.current.add(o),t(IIo(1))))},[e,t])}var nqe,OIo=S(()=>{nqe=U(et());St();hA();fr();dO();s(kIo,"parseCount");s(hJi,"foldSpawn");s(RIo,"makeSpawnNotif");s(_Ji,"foldShutdown");s(IIo,"makeShutdownNotif");s(PIo,"useTeammateLifecycleNotification")});function LIo(){let{addNotification:e}=ei(),t=gt(r=>r.fastMode),n=Mr();(0,pPt.useEffect)(()=>{if(!ri()&&ui())return yKn(r=>{r?e({key:NIo,color:"fastMode",priority:"immediate",text:"Fast mode is now available \xB7 /fast to turn on"}):t&&(n(o=>({...o,fastMode:!1})),e({key:NIo,color:"warning",priority:"immediate",text:"Fast mode has been disabled by your organization"}))})},[e,t,n]),(0,pPt.useEffect)(()=>{if(!ri()&&ui())return hKn(r=>{n(o=>({...o,fastMode:!1})),e({key:yJi,color:"warning",priority:"immediate",text:r})})},[e,n]),(0,pPt.useEffect)(()=>{if(ri()||!t)return;let r=AKn((i,a)=>{let l=Ll(i-Date.now(),{hideTrailingZeros:!0}),c=bJi(a,l);e({key:MIo,invalidates:[DIo],text:c,color:"warning",priority:"immediate"})}),o=pKn(()=>{e({key:DIo,invalidates:[MIo],color:"fastMode",text:"Fast limit reset \xB7 now using fast mode",priority:"immediate"})});return()=>{r(),o()}},[e,t])}function bJi(e,t){switch(e){case"overloaded":return`Fast mode overloaded and is temporarily unavailable \xB7 resets in ${t}`;case"rate_limit":return`Fast limit reached and temporarily disabled \xB7 resets in ${t}`}}var pPt,MIo,DIo,NIo,yJi,FIo=S(()=>{pPt=U(et());hA();fr();Mv();kr();St();MIo="fast-mode-cooldown-started",DIo="fast-mode-cooldown-expired",NIo="fast-mode-org-changed",yJi="fast-mode-overage-rejected";s(LIo,"useFastModeNotification");s(bJi,"getCooldownMessage")});function UIo({onRun:e,onCancel:t,reason:n}){let r=(0,mPt.useRef)(!1);return cn("confirm:no",t,{context:"Confirmation"}),(0,mPt.useEffect)(()=>{r.current||(r.current=!0,e())},[e]),(0,Uz.jsxs)(O,{flexDirection:"column",marginTop:1,children:[(0,Uz.jsx)(O,{children:(0,Uz.jsx)(_,{bold:!0,children:"Running feedback capture..."})}),(0,Uz.jsx)(O,{children:(0,Uz.jsxs)(_,{dimColor:!0,children:["Press ",(0,Uz.jsx)(qt,{shortcut:"Esc",action:"cancel"})," anytime"]})}),(0,Uz.jsx)(O,{children:(0,Uz.jsxs)(_,{dimColor:!0,children:["Reason: ",n]})})]})}function BIo(e){return!1;switch(e){case"feedback_survey_bad":return!1;case"feedback_survey_good":return!1;default:return!1}}function $Io(e){return"/issue"}function HIo(e){switch(e){case"feedback_survey_bad":return'You responded "Bad" to the feedback survey';case"feedback_survey_good":return'You responded "Good" to the feedback survey';default:return"Unknown reason"}}var mPt,Uz,jIo=S(()=>{mPt=U(et());Ti();Xe();Gr();Uz=U(Z());s(UIo,"AutoRunIssueNotification");s(BIo,"shouldAutoRunIssue");s($Io,"getAutoRunCommand");s(HIo,"getAutoRunIssueReasonText")});var zIo=S(()=>{});function qIo(){return null}var rY,GIo=S(()=>{du();Xe();rY=U(Z());s(qIo,"IssueFlagBanner")});function vJi(e){for(let t of e){if(t.type!=="assistant")continue;let n=t.message.content;if(Array.isArray(n))for(let r of n){if(r.type!=="tool_use"||!("name"in r))continue;let o=r.name;if(o.startsWith("mcp__"))return!1;if(o===zr){let a=r.input?.command||"";if(SJi.some(l=>l.test(a)))return!1}}}return!0}function TJi(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type!=="user")continue;let r=BV(n);if(r)return EJi.some(o=>o.test(r))}return!1}function WIo(e,t){if(process.env.USER_TYPE!=="ant")return!1;let n=(0,rqe.useRef)(0),r=(0,rqe.useRef)(-1),o=(0,rqe.useMemo)(()=>vJi(e)&&TJi(e),[e]);return r.current===t?!0:Date.now()-n.current<CJi||t<xJi||!o?!1:(n.current=Date.now(),r.current=t,!0)}var rqe,SJi,EJi,xJi,CJi,VIo=S(()=>{rqe=U(et());Nu();Ln();SJi=[/\bcurl\b/,/\bwget\b/,/\bssh\b/,/\bkubectl\b/,/\bsrun\b/,/\bdocker\b/,/\bbq\b/,/\bgsutil\b/,/\bgcloud\b/,/\baws\b/,/\bgit\s+push\b/,/\bgit\s+pull\b/,/\bgit\s+fetch\b/,/\bgh\s+(pr|issue)\b/,/\bnc\b/,/\bncat\b/,/\btelnet\b/,/\bftp\b/],EJi=[/^no[,!]\s/i,/\bthat'?s (wrong|incorrect|not (what|right|correct))\b/i,/\bnot what I (asked|wanted|meant|said)\b/i,/\bI (said|asked|wanted|told you|already said)\b/i,/\bwhy did you\b/i,/\byou should(n'?t| not)? have\b/i,/\byou were supposed to\b/i,/\btry again\b/i,/\b(undo|revert) (that|this|it|what you)\b/i];s(vJi,"isSessionContainerCompatible");s(TJi,"hasFrictionSignal");xJi=3,CJi=1800*1e3;s(WIo,"useIssueFlagBanner")});var wJi,kJi,YIo=S(()=>{wJi=U(et());St();Xe();kJi=U(Z())});function LTn({children:e,mouseTracking:t=!0}){let n=(0,oqe.useContext)(Q6),r=(0,oqe.useContext)(e8);return(0,oqe.useInsertionEffect)(()=>{let o=UA.get(process.stdout);if(r)return r(rDe+"\x1B[2J\x1B[H"+(t?_te:"")),o?.setAltScreenActive(!0,t),()=>{o?.setAltScreenActive(!1),o?.clearTextSelection(),r((t?kW:"")+fge)}},[r,t]),(0,KIo.jsx)(lg,{flexDirection:"column",height:n?.rows??24,width:"100%",flexShrink:0,children:e})}var oqe,KIo,QIo=S(()=>{oqe=U(et());GR();K6();MW();OW();iDe();KIo=U(Z());s(LTn,"AlternateScreen")});function XIo(e,t,n){let r=(0,Qxe.useRef)(!1),o=(0,Qxe.useRef)(n);o.current=n,(0,Qxe.useEffect)(()=>t?e.subscribe(()=>{let a=e.getState(),l=e.hasSelection();if(a?.isDragging){r.current=!1;return}if(!l){r.current=!1;return}if(r.current||!(rt().copyOnSelect??!0))return;let u=e.copySelectionNoClear();if(!u||!u.trim()){r.current=!0;return}r.current=!0,o.current?.(u)}):void 0,[t,e])}function JIo(e){let[t]=qr();(0,Qxe.useEffect)(()=>{e.setSelectionBgColor(mE(t).selectionBg)},[e,t])}var Qxe,ZIo=S(()=>{Qxe=U(et());$fe();mn();F1();s(XIo,"useCopyOnSelect");s(JIo,"useSelectionBgColor")});function jJi(e){return!(e.wheelUp||e.wheelDown||(e.leftArrow||e.rightArrow||e.upArrow||e.downArrow||e.home||e.end||e.pageUp||e.pageDown)&&(e.shift||e.meta||e.super))}function zJi(e){return!e.shift||e.meta?null:e.leftArrow?"left":e.rightArrow?"right":e.upArrow?"up":e.downArrow?"down":e.home?"lineStart":e.end?"lineEnd":null}function nPo(e,t,n){if(!e.xtermJs){if(e.wheelMode&&n-e.time>LJi&&(e.wheelMode=!1,e.burstCount=0,e.mult=e.base),e.pendingFlip){if(e.pendingFlip=!1,t!==e.dir||n-e.time>OJi)return e.dir=t,e.time=n,e.mult=e.base,Math.floor(e.mult);e.wheelMode=!0}let l=n-e.time;if(t!==e.dir&&e.dir!==0)return e.pendingFlip=!0,e.time=n,0;if(e.dir=t,e.time=n,e.wheelMode)if(l<tPo)if(++e.burstCount>=5)e.wheelMode=!1,e.burstCount=0,e.mult=e.base;else return 1;else e.burstCount=0;if(e.wheelMode){let c=Math.pow(.5,l/ePo),u=Math.max(DJi,e.base*2),d=1+(e.mult-1)*c+MJi*c;return e.mult=Math.min(u,d,e.mult+NJi),Math.floor(e.mult)}if(l>RJi)e.mult=e.base;else{let c=Math.max(PJi,e.base*2);e.mult=Math.min(c,e.mult+IJi)}return Math.floor(e.mult)}let r=n-e.time,o=t===e.dir;if(e.time=n,e.dir=t,o&&r<tPo)return 1;if(!o||r>HJi)e.mult=2,e.frac=0;else{let l=Math.pow(.5,r/ePo),c=r>=UJi?BJi:$Ji;e.mult=Math.min(c,1+(e.mult-1)*l+FJi*l)}let i=e.mult+e.frac,a=Math.floor(i);return e.frac=i-a,a}function qJi(){let e=process.env.CLAUDE_CODE_SCROLL_SPEED;if(!e)return 1;let t=parseFloat(e);return Number.isNaN(t)||t<=0?1:Math.min(t,20)}function GJi(e=!1,t=1){return{time:0,mult:t,dir:0,xtermJs:e,frac:0,base:t,pendingFlip:!1,wheelMode:!1,burstCount:0}}function rPo(){let e=IW(),t=qJi();return v(`wheel accel: ${e?"decay (xterm.js)":"window (native)"} \xB7 base=${t} \xB7 TERM_PROGRAM=${process.env.TERM_PROGRAM??"unset"}`),GJi(e,t)}function FTn({scrollRef:e,isActive:t,onScroll:n,isModal:r=!1}){let o=Oge(),{addNotification:i}=ei(),a=(0,sY.useRef)(null);function l(d){let A=brr(),p=d.length,m;switch(A){case"native":m=`copied ${p} chars to clipboard`;break;case"tmux-buffer":m=`copied ${p} chars to tmux buffer \xB7 paste with prefix + ]`;break;case"osc52":m=`sent ${p} chars via OSC 52 \xB7 check terminal clipboard settings if paste fails`;break}i({key:"selection-copied",text:m,color:"suggestion",priority:"immediate",timeoutMs:A==="native"?2e3:4e3})}s(l,"showCopiedToast");function c(){let d=o.copySelection();d&&l(d)}s(c,"copyAndToast");function u(d,A){let p=o.getState();if(!p?.anchor||!p.focus)return;let m=d.getViewportTop(),f=m+d.getViewportHeight()-1;if(p.anchor.row<m||p.anchor.row>f||p.focus.row<m||p.focus.row>f)return;let h=Math.max(0,d.getScrollHeight()-d.getViewportHeight()),b=d.getScrollTop()+d.getPendingDelta(),E=Math.max(0,Math.min(h,b+A))-b;if(E!==0)if(E>0)o.captureScrolledRows(m,m+E-1,"above"),o.shiftSelection(-E,m,f);else{let x=-E;o.captureScrolledRows(f-x+1,f,"below"),o.shiftSelection(x,m,f)}}return s(u,"translateSelectionForJump"),Ur({"scroll:pageUp":s(()=>{let d=e.current;if(!d)return;let A=-Math.max(1,Math.floor(d.getViewportHeight()/2));u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:pageUp"),"scroll:pageDown":s(()=>{let d=e.current;if(!d)return;let A=Math.max(1,Math.floor(d.getViewportHeight()/2));u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:pageDown"),"scroll:lineUp":s(()=>{o.clearSelection();let d=e.current;if(!d||d.getScrollHeight()<=d.getViewportHeight())return!1;a.current??=rPo(),XJi(d,nPo(a.current,-1,performance.now())),n?.(!1,d)},"scroll:lineUp"),"scroll:lineDown":s(()=>{o.clearSelection();let d=e.current;if(!d||d.getScrollHeight()<=d.getViewportHeight())return!1;a.current??=rPo();let A=nPo(a.current,1,performance.now()),p=QJi(d,A);n?.(p,d)},"scroll:lineDown"),"scroll:top":s(()=>{let d=e.current;d&&(u(d,-(d.getScrollTop()+d.getPendingDelta())),d.scrollTo(0),n?.(!1,d))},"scroll:top"),"scroll:bottom":s(()=>{let d=e.current;if(!d)return;let A=Math.max(0,d.getScrollHeight()-d.getViewportHeight());u(d,A-(d.getScrollTop()+d.getPendingDelta())),d.scrollTo(A),d.scrollToBottom(),n?.(!0,d)},"scroll:bottom"),"selection:copy":c},{context:"Scroll",isActive:t}),Ur({"scroll:halfPageUp":s(()=>{let d=e.current;if(!d)return;let A=-Math.max(1,Math.floor(d.getViewportHeight()/2));u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:halfPageUp"),"scroll:halfPageDown":s(()=>{let d=e.current;if(!d)return;let A=Math.max(1,Math.floor(d.getViewportHeight()/2));u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:halfPageDown"),"scroll:fullPageUp":s(()=>{let d=e.current;if(!d)return;let A=-Math.max(1,d.getViewportHeight());u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:fullPageUp"),"scroll:fullPageDown":s(()=>{let d=e.current;if(!d)return;let A=Math.max(1,d.getViewportHeight());u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:fullPageDown")},{context:"Scroll",isActive:t}),Xo((d,A,p)=>{let m=e.current;if(!m)return;let f=ZJi(m,JJi(d,A),h=>u(m,h));f!==null&&(n?.(f,m),p.stopImmediatePropagation())},{isActive:t&&r}),Xo((d,A,p)=>{if(!o.hasSelection())return;if(A.escape){o.clearSelection(),p.stopImmediatePropagation();return}if(A.ctrl&&!A.shift&&!A.meta&&d==="c"){c(),p.stopImmediatePropagation();return}let m=zJi(A);if(m){o.moveFocus(m),p.stopImmediatePropagation();return}jJi(A)&&o.clearSelection()},{isActive:t}),YJi(e,o,t,n),XIo(o,t,l),JIo(o),null}function YJi(e,t,n,r){let o=(0,sY.useRef)(null),i=(0,sY.useRef)(0),a=(0,sY.useRef)(0),l=(0,sY.useRef)(0),c=(0,sY.useRef)(r);c.current=r,(0,sY.useEffect)(()=>{if(!n)return;function u(){i.current=0,o.current&&(clearInterval(o.current),o.current=null)}s(u,"stop");function d(){let f=t.getState(),h=e.current,b=i.current;if(!f?.isDragging||!f.focus||!h||b===0||++l.current>VJi){u();return}if(h.getPendingDelta()!==0)return;let E=h.getViewportTop(),x=E+h.getViewportHeight()-1;if(b<0){if(h.getScrollTop()<=0){u();return}let T=Math.min(fPt,h.getScrollTop());t.captureScrolledRows(x-T+1,x,"below"),t.shiftAnchor(T,0,x),h.scrollBy(-fPt)}else{let T=Math.max(0,h.getScrollHeight()-h.getViewportHeight());if(h.getScrollTop()>=T){u();return}let R=Math.min(fPt,T-h.getScrollTop());t.captureScrolledRows(E,E+R-1,"above"),t.shiftAnchor(-R,E,x),h.scrollBy(fPt)}c.current?.(!1,h)}s(d,"tick");function A(f){a.current=f,i.current!==f&&(u(),i.current=f,l.current=0,d(),i.current===f&&(o.current=setInterval(d,WJi)))}s(A,"start");function p(){let f=e.current;if(!f){u();return}let h=f.getViewportTop(),b=h+f.getViewportHeight()-1,E=t.getState();(!E?.isDragging||E.scrolledOffAbove.length===0&&E.scrolledOffBelow.length===0)&&(a.current=0);let x=KJi(E,h,b,a.current);if(x===0){if(a.current!==0&&E?.focus){let T=E.focus.row<h?-1:E.focus.row>b?1:0;T!==0&&T!==a.current&&(E.scrolledOffAbove=[],E.scrolledOffBelow=[],E.scrolledOffAboveSW=[],E.scrolledOffBelowSW=[],a.current=0)}u()}else A(x)}s(p,"check");let m=t.subscribe(p);return()=>{m(),u(),a.current=0}},[n,e,t])}function KJi(e,t,n,r=0){if(!e?.isDragging||!e.anchor||!e.focus)return 0;let o=e.focus.row,i=o<t?-1:o>n?1:0;return r!==0?i===r?i:0:e.anchor.row<t||e.anchor.row>n?0:i}function oY(e,t){let n=Math.max(0,e.getScrollHeight()-e.getViewportHeight()),r=e.getScrollTop()+e.getPendingDelta()+t;return r>=n?(e.scrollTo(n),e.scrollToBottom(),!0):(e.scrollTo(Math.max(0,r)),!1)}function QJi(e,t){let n=Math.max(0,e.getScrollHeight()-e.getViewportHeight());return e.getScrollTop()+e.getPendingDelta()+t>=n?(e.scrollToBottom(),!0):(e.scrollBy(t),!1)}function XJi(e,t){if(e.getScrollTop()+e.getPendingDelta()-t<=0){e.scrollTo(0);return}e.scrollBy(-t)}function JJi(e,t){if(t.meta)return null;if(!t.ctrl&&!t.shift){if(t.upArrow)return"lineUp";if(t.downArrow)return"lineDown";if(t.home)return"top";if(t.end)return"bottom"}if(t.ctrl){if(t.shift)return null;switch(e){case"u":return"halfPageUp";case"d":return"halfPageDown";case"b":return"fullPageUp";case"f":return"fullPageDown";case"n":return"lineDown";case"p":return"lineUp";default:return null}}let n=e[0];if(!n||e!==n.repeat(e.length))return null;if(n==="G"||n==="g"&&t.shift)return"bottom";if(t.shift)return null;switch(n){case"g":return"top";case"j":return"lineDown";case"k":return"lineUp";case" ":return"fullPageDown";case"b":return"fullPageUp";default:return null}}function ZJi(e,t,n){switch(t){case null:return null;case"lineUp":case"lineDown":{let r=t==="lineDown"?1:-1;return n(r),oY(e,r)}case"halfPageUp":case"halfPageDown":{let r=Math.max(1,Math.floor(e.getViewportHeight()/2)),o=t==="halfPageDown"?r:-r;return n(o),oY(e,o)}case"fullPageUp":case"fullPageDown":{let r=Math.max(1,e.getViewportHeight()),o=t==="fullPageDown"?r:-r;return n(o),oY(e,o)}case"top":return n(-(e.getScrollTop()+e.getPendingDelta())),e.scrollTo(0),!1;case"bottom":{let r=Math.max(0,e.getScrollHeight()-e.getViewportHeight());return n(r-(e.getScrollTop()+e.getPendingDelta())),e.scrollTo(r),e.scrollToBottom(),!0}}}var sY,RJi,IJi,PJi,OJi,MJi,DJi,NJi,LJi,ePo,FJi,tPo,UJi,BJi,$Ji,HJi,fPt,WJi,VJi,oPo=S(()=>{sY=U(et());hA();ZIo();Alt();PW();By();Xe();Gr();it();RJi=40,IJi=.3,PJi=6,OJi=200,MJi=15,DJi=15,NJi=3,LJi=1500,ePo=150,FJi=5,tPo=5,UJi=80,BJi=3,$Ji=6,HJi=500;s(jJi,"shouldClearSelectionOnKey");s(zJi,"selectionFocusMoveForKey");s(nPo,"computeWheelStep");s(qJi,"readScrollSpeedBase");s(GJi,"initWheelAccel");s(rPo,"initAndLogWheelAccel");fPt=2,WJi=50,VJi=200;s(FTn,"ScrollKeybindingHandler");s(YJi,"useDragToScroll");s(KJi,"dragScrollDirection");s(oY,"jumpBy");s(QJi,"scrollDown");s(XJi,"scrollUp");s(JJi,"modalPagerAction");s(ZJi,"applyModalPagerAction")});var uPo={};Bt(uPo,{REPL:()=>BTn});import{dirname as eZi,join as tZi}from"path";import{tmpdir as nZi}from"os";import{writeFile as rZi}from"fs/promises";import{randomUUID as sqe}from"crypto";function iPo({showAllInTranscript:e,virtualScroll:t,searchBadge:n,suppressShowAll:r=!1,status:o}){let i=Xi("app:toggleTranscript","Global","ctrl+o"),a=Xi("transcript:toggleShowAll","Transcript","ctrl+e");return(0,gr.jsxs)(O,{noSelect:!0,alignItems:"center",alignSelf:"center",borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",marginTop:1,paddingLeft:2,width:"100%",children:[(0,gr.jsxs)(_,{dimColor:!0,children:["Showing detailed transcript \xB7 ",i," to toggle",n?" \xB7 n/N to navigate":t?` \xB7 ${Ze.arrowUp}${Ze.arrowDown} scroll \xB7 home/end top/bottom`:r?"":` \xB7 ${a} to ${e?"collapse":"show all"}`]}),o?(0,gr.jsxs)(gr.Fragment,{children:[(0,gr.jsx)(O,{flexGrow:1}),(0,gr.jsxs)(_,{children:[o," "]})]}):n?(0,gr.jsxs)(gr.Fragment,{children:[(0,gr.jsx)(O,{flexGrow:1}),(0,gr.jsxs)(_,{dimColor:!0,children:[n.current,"/",n.count," "]})]}):null]})}function AZi({jumpRef:e,count:t,current:n,onClose:r,onCancel:o,setHighlight:i,initialQuery:a}){let{query:l,cursorOffset:c}=PO({isActive:!0,initialQuery:a,onExit:s(()=>r(l),"onExit"),onCancel:o}),[u,d]=um.useState("building");um.useEffect(()=>{let f=!0,h=e.current?.warmSearchIndex;if(!h){d(null);return}return d("building"),h().then(b=>{f&&(b<20?d(null):(d({ms:b}),setTimeout(()=>f&&d(null),2e3)))}),()=>{f=!1}},[]);let A=u!=="building";(0,Vt.useEffect)(()=>{A&&(e.current?.setSearchQuery(l),i(l))},[l,A]);let p=c,m=p<l.length?l[p]:" ";return(0,gr.jsxs)(O,{borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",marginTop:1,paddingLeft:2,width:"100%",noSelect:!0,children:[(0,gr.jsx)(_,{children:"/"}),(0,gr.jsx)(_,{children:l.slice(0,p)}),(0,gr.jsx)(_,{inverse:!0,children:m}),p<l.length&&(0,gr.jsx)(_,{children:l.slice(p+1)}),(0,gr.jsx)(O,{flexGrow:1}),u==="building"?(0,gr.jsx)(_,{dimColor:!0,children:"indexing\u2026 "}):u?(0,gr.jsxs)(_,{dimColor:!0,children:["indexed in ",u.ms,"ms "]}):t===0&&l?(0,gr.jsx)(_,{color:"error",children:"no matches "}):t>0?(0,gr.jsxs)(_,{dimColor:!0,children:[n,"/",t," "]}):null]})}function cPo({isAnimating:e,title:t,disabled:n,noPrefix:r}){let o=Pm(),[i,a]=(0,Vt.useState)(0);(0,Vt.useEffect)(()=>{if(n||r||!e||!o)return;let c=setInterval(u=>u(d=>(d+1)%aPo.length),pZi,a);return()=>clearInterval(c)},[n,r,e,o]);let l=e?aPo[i]??lPo:lPo;return flt(n?null:r?t:`${l} ${t}`),null}function BTn({commands:e,debug:t,initialTools:n,initialMessages:r,pendingHookMessages:o,initialFileHistorySnapshots:i,initialContentReplacements:a,initialAgentName:l,initialAgentColor:c,mcpClients:u,dynamicMcpConfig:d,autoConnectIdeFlag:A,strictMcpConfig:p=!1,systemPrompt:m,appendSystemPrompt:f,onBeforeQuery:h,onTurnComplete:b,disabled:E=!1,mainThreadAgentDefinition:x,disableSlashCommands:T=!1,taskListId:R,remoteSessionConfig:I,directConnectConfig:M,sshSession:N,thinkingConfig:F}){let D=!!I,L=(0,Vt.useMemo)(()=>qe(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE),[]),B=(0,Vt.useMemo)(()=>!1,[]),z=(0,Vt.useMemo)(()=>qe(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),G=!1;(0,Vt.useEffect)(()=>(v(`[REPL:mount] REPL mounted, disabled=${E}`),()=>v("[REPL:unmount] REPL unmounting")),[E]);let[H,W]=(0,Vt.useState)(x),Y=gt(at=>at.toolPermissionContext),K=gt(at=>at.verbose),ee=gt(at=>at.mcp),ge=gt(at=>at.plugins),fe=gt(at=>at.agentDefinitions),de=gt(at=>at.fileHistory),oe=gt(at=>at.initialMessage),ae=Rz(),Se=gt(at=>at.spinnerTip),Me=gt(at=>at.expandedView)==="tasks",Te=gt(at=>at.pendingWorkerRequest),Ie=gt(at=>at.pendingSandboxRequest),xe=gt(at=>at.teamContext),re=gt(at=>at.tasks),te=gt(at=>at.workerSandboxPermissions),ue=gt(at=>at.elicitation),Ae=gt(at=>at.ultraplanPendingChoice),ie=gt(at=>at.ultraplanLaunchPending),be=gt(at=>at.viewingAgentTaskId),Pe=Mr(),Re=be?re[be]:void 0,Ue=n_(Re)&&Re.retain&&!Re.diskLoaded;(0,Vt.useEffect)(()=>{if(!be||!Ue)return;let at=be;aQ(at).then(Rt=>{Pe(Ht=>{let Fn=Ht.tasks[at];if(!n_(Fn)||Fn.diskLoaded||!Fn.retain)return Ht;let dr=Fn.messages??[],Dr=new Set(dr.map(Ho=>Ho.uuid)),vr=Rt?Rt.messages.filter(Ho=>!Dr.has(Ho.uuid)):[];return{...Ht,tasks:{...Ht.tasks,[at]:{...Fn,messages:[...vr,...dr],diskLoaded:!0}}}})})},[be,Ue,Pe]);let Ee=Uu(),De=t8(),ke=vE(),[tt,Ne]=(0,Vt.useState)(e);hko(D?void 0:Xc(),Ne);let nt=um.useSyncExternalStore(sPo?.subscribeToProactiveChanges??aZi,sPo?.isProactiveActive??lZi),ct=gt(at=>at.isBriefOnly),Qe=(0,Vt.useMemo)(()=>UE(Y),[Y,nt,ct]);QOr(),XOr();let[$e,Ge]=(0,Vt.useState)(d),pe=(0,Vt.useCallback)(at=>{Ge(at)},[Ge]),[ve,Ce]=(0,Vt.useState)("prompt"),[Ve,Je]=(0,Vt.useState)(!1),[Ye,ot]=(0,Vt.useState)(!1),[ft,ce]=(0,Vt.useState)(""),je=(0,Vt.useRef)(0),me=(0,Vt.useRef)(void 0),we=(0,Vt.useRef)(!1),{addNotification:Ke,removeNotification:dt}=ei(),Tt=cZi,tn=dko(u,ee.clients),[On,Tr]=(0,Vt.useState)(void 0),[Qr,Cs]=(0,Vt.useState)(null),[Er,$n]=(0,Vt.useState)(null),[Ao,xt]=(0,Vt.useState)(!1),[fn,cr]=(0,Vt.useState)(()=>!1),[gn,Nr]=(0,Vt.useState)(()=>Hko(ke)),bo=gt(at=>at.showRemoteCallout),[Dn,Nn]=(0,Vt.useState)(()=>_Ro());TIo(),CIo(),SIo({ideSelection:On,mcpClients:tn,ideInstallationStatus:Er}),NRo({mcpClients:tn}),FRo(),oIo(),iIo(),tCt(),fIo(ke),LIo(),hIo(ke),yIo(),sZi(),rRo(),lRo(),ARo(),BRo(),PIo();let{recommendation:So,handleResponse:Ls}=QRo(),{recommendation:Co,handleResponse:Bs}=eIo(),fi=(0,Vt.useMemo)(()=>[...Qe,...n],[Qe,n]);UIt({enabled:!D});let vc=A1r();(0,Vt.useEffect)(()=>{D||dIo(Pe)},[Pe,D]),fRo(D?UTn:tn,Y.mode),Swo(Pe,r,{enabled:!D});let zo=Gwt(fi,ee.tools,Y),{tools:Tc,allowedAgentTypes:eu}=(0,Vt.useMemo)(()=>{if(!H)return{tools:zo,allowedAgentTypes:void 0};let at=FV(H,zo,!1,!0);return{tools:at.resolvedTools,allowedAgentTypes:at.allowedAgentTypes}},[H,zo]),yp=iTn(tt,ge.commands),Rr=iTn(yp,ee.commands),ii=(0,Vt.useMemo)(()=>T?[]:Rr,[T,Rr]);ESo(D?UTn:ee.clients),Sko(D?UTn:ee.clients,Tr);let[kl,Wr]=(0,Vt.useState)("responding"),$p=(0,Vt.useRef)(kl);$p.current=kl;let[Kl,Kd]=(0,Vt.useState)([]),[zc,Qd]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{if(zc&&!zc.isStreaming&&zc.streamingEndedAt){let Rt=3e4-(Date.now()-zc.streamingEndedAt);if(Rt>0){let Ht=setTimeout(Qd,Rt,null);return()=>clearTimeout(Ht)}else Qd(null)}},[zc]);let[Oi,al]=(0,Vt.useState)(null),XA=(0,Vt.useRef)(null);XA.current=Oi;let Eu=(0,Vt.useRef)(()=>{}),wd=(0,Vt.useRef)(()=>{}),Rl=(0,Vt.useRef)(null),xc=(0,Vt.useRef)(null),rd=(0,Vt.useRef)(0),ti=um.useRef(new fRt).current,Il=um.useSyncExternalStore(ti.subscribe,ti.getSnapshot),[yi,od]=um.useState(I?.hasInitialPrompt??!1),Os=Il||yi,[$i,Cc]=um.useState(void 0),Pl=um.useRef(0),wc=um.useRef(!1),ta=um.useRef(0),Hu=um.useRef(0),Ql=um.useRef(null),Vm=um.useCallback(()=>{ta.current=Date.now(),Hu.current=0,Ql.current=null},[]),vu=um.useRef(!1);Il&&!vu.current&&Vm(),vu.current=Il;let kd=um.useCallback(at=>{od(at),at&&Vm()},[Vm]),Xl=um.useRef(null),tu=um.useRef(void 0),Xt=um.useRef(void 0),hr=1500,[po,Lo]=um.useState(!1),[Lr,as]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{Lr?.notifications&&Lr.notifications.forEach(at=>{Ke({key:"auto-updater-notification",text:at,priority:"low"})})},[Lr,Ke]),(0,Vt.useEffect)(()=>{cs()&&nZn().then(at=>{at&&Ke({key:"tmux-mouse-hint",text:at,priority:"low"})})},[]);let[ml,Hi]=(0,Vt.useState)(!1);(0,Vt.useEffect)(()=>{},[]);let[Hr,$s]=(0,Vt.useState)(null),Tu=(0,Vt.useRef)(null),ai=(0,Vt.useCallback)(at=>{if(at?.isLocalJSXCommand){let{clearLocalJSX:Rt,...Ht}=at;Tu.current={...Ht,isLocalJSXCommand:!0},$s(Ht);return}if(Tu.current){if(at?.clearLocalJSX){Tu.current=null,$s(null);return}return}if(at?.clearLocalJSX){$s(null);return}$s(at)},[]),[Es,Fa]=(0,Vt.useState)([]),[Gs,nu]=(0,Vt.useState)(null),[Wa,Mi]=(0,Vt.useState)([]),[ji,ru]=(0,Vt.useState)([]),Va=(0,Vt.useRef)(new Map),ju=gt(at=>at.settings.terminalTitleFromRename)!==!1?cT(Et()):void 0,[zu,Sh]=(0,Vt.useState)(),kA=(0,Vt.useRef)((r?.length??0)>0),uy=H?.agentType,dm=ju??uy??zu??"Claude Code",Hp=Es.length>0||ji.length>0||Te||Ie,JA=Hr?.isLocalJSXCommand===!0&&Hr?.jsx!=null,Am=Os&&!Hp&&!JA;(0,Vt.useEffect)(()=>{if(Os&&!Hp&&!JA)return eSo(),()=>tSo()},[Os,Hp,JA]);let pc=Hp||JA?"waiting":Os?"busy":"idle",VC=pc!=="waiting"?void 0:Es.length>0?`approve ${Es[0].tool.name}`:Te?"worker request":Ie?"sandbox request":JA?"dialog open":"input needed";(0,Vt.useEffect)(()=>{},[pc,VC]);let kc=nn("tengu_terminal_sidebar",!1)&&(rt().showStatusInTerminalTab??!1);plt(L||!kc?null:pc),(0,Vt.useEffect)(()=>(L1r(Fa),()=>F1r()),[Fa]);let[Yo,YC]=(0,Vt.useState)(r??[]),Ms=(0,Vt.useRef)(Yo),Jr=(0,Vt.useRef)(!1),wo=(0,Vt.useCallback)(at=>{let Rt=Ms.current,Ht=typeof at=="function"?at(Ms.current):at;if(Ms.current=Ht,Ht.length<Pl.current)Pl.current=0;else if(Ht.length>Rt.length&&wc.current){let Fn=Ht.length-Rt.length;(Rt.length===0||Ht[0]===Rt[0]?Ht.slice(-Fn):Ht.slice(0,Fn)).some(fve)?wc.current=!1:Pl.current=Ht.length}YC(Ht)},[]),aa=(0,Vt.useCallback)(at=>{at!==void 0?(Pl.current=Ms.current.length,wc.current=!0):wc.current=!1,Cc(at)},[]),{dividerIndex:Rd,dividerYRef:C_,onScrollAway:dy,onRepin:Cg,jumpToNew:_b,shiftDivider:RS}=jlo(Yo.length),[yd,Ym]=(0,Vt.useState)(null),ZE=(0,Vt.useRef)(null),yb=(0,Vt.useMemo)(()=>zlo(Yo,Rd),[Rd,Yo.length]),Id=(0,Vt.useCallback)(()=>{Rl.current?.scrollToBottom(),Cg(),Ym(null)},[Cg,Ym]),IS=Yo.at(-1),ZA=IS!=null&&fve(IS);(0,Vt.useEffect)(()=>{ZA&&Id()},[ZA,IS,Id]);let{maybeLoadOlder:jp}=uZi,Ay=(0,Vt.useCallback)((at,Rt)=>{rd.current=Date.now(),at?Cg():dy(Rt)},[Cg,dy,jp,Pe]),Oe=iwo(o,wo),He=(0,Vt.useDeferredValue)(Yo),yt=Yo.length-He.length;yt>0&&v(`[useDeferredValue] Messages deferred by ${yt} (${He.length}\u2192${Yo.length})`);let[on,En]=(0,Vt.useState)(null),[mr,_s]=(0,Vt.useState)(()=>$3t()),gi=(0,Vt.useRef)(mr);gi.current=mr;let Rc=(0,Vt.useRef)(null),Di=(0,Vt.useCallback)(at=>{Tt(gi.current,at)||(gi.current===""&&at!==""&&Date.now()-rd.current>=dZi&&Id(),gi.current=at,_s(at),Lo(at.trim().length>0))},[Lo,Id,Tt]);(0,Vt.useEffect)(()=>{if(mr.trim().length===0)return;let at=setTimeout(Lo,hr,!1);return()=>clearTimeout(at)},[mr]);let[qu,Xd]=(0,Vt.useState)("prompt"),[mc,Cu]=(0,Vt.useState)(),bp=(0,Vt.useCallback)(({slashCommands:at})=>{let Rt=new Set(at);Ne(Ht=>Ht.filter(Fn=>Rt.has(Fn.name)||Cbn.has(Fn)))},[Ne]),[ev,py]=(0,Vt.useState)(sqe()),[zp,kf]=(0,Vt.useState)(new Set),bb=(0,Vt.useRef)(!1),Ci=ICo({config:I,setMessages:wo,setIsLoading:kd,onInit:bp,setToolUseConfirmQueue:Fa,tools:fi,setStreamingToolUses:Kd,setStreamMode:Wr,setInProgressToolUseIDs:kf}),or=MCo({config:M,setMessages:wo,setIsLoading:kd,setToolUseConfirmQueue:Fa,tools:fi}),pm=NCo({session:N,setMessages:wo,setIsLoading:kd,setToolUseConfirmQueue:Fa,tools:fi}),Km=pm.isRemoteMode?pm:or.isRemoteMode?or:Ci,Jd=(0,Vt.useCallback)(async()=>{let{clearConversation:at}=await Promise.resolve().then(()=>(kfn(),pZr));await at({setMessages:wo,readFileState:sv.current,discoveredSkillNames:wg.current,loadedNestedMemoryPaths:MS.current,getAppState:s(()=>Ee.getState(),"getAppState"),setAppState:Pe,setConversationId:py}),kA.current=!1,Sh(void 0),QC.current.clear(),wP.current=0},[wo,Pe,py,Ee]),hP=(0,Vt.useCallback)(async()=>{if(Km.isRemoteMode){if(!await Km.sendMessage("/clear"))return kd(!1),Ke({key:"remote-clear-failed",text:"Unable to clear the remote session. Context was not reset.",priority:"immediate"}),!1;kd(!1)}return await Jd(),!0},[Km,Ke,Jd,kd]),[Zd,Rf]=(0,Vt.useState)({}),[Eh,_P]=(0,Vt.useState)(0),my=(0,Vt.useRef)(0),tv=(0,Vt.useRef)([]),JT=(0,Vt.useCallback)(at=>{let Rt=my.current;if(my.current=at(Rt),my.current>Rt){let Ht=tv.current;if(Ht.length>0){let Fn=Ht.at(-1);Fn.lastTokenTime=Date.now(),Fn.endResponseLength=my.current}}},[]),[eA,na]=(0,Vt.useState)(null),Qm=!(gt(at=>at.settings.prefersReducedMotion)??!1)&&!wrr(),fl=(0,Vt.useCallback)(at=>{Qm&&na(at)},[Qm]),fy=eA&&Qm&&eA.substring(0,eA.lastIndexOf(`
|
|
7767
|
+
`)}async sendRequest(t,n,r,o=xTn()){let i={type:"control_request",request_id:o,request:t};if(this.inputClosed)throw new Error("Stream closed");if(r?.aborted)throw new Error("Request aborted");this.outbound.enqueue(i),t.subtype==="can_use_tool"&&this.onControlRequestSent&&this.onControlRequestSent(i);let a=s(()=>{this.outbound.enqueue({type:"control_cancel_request",request_id:o});let l=this.pendingRequests.get(o);l&&(this.trackResolvedToolUseId(l.request),l.reject(new iu))},"aborted");r&&r.addEventListener("abort",a,{once:!0});try{return await new Promise((l,c)=>{this.pendingRequests.set(o,{request:{type:"control_request",request_id:o,request:t},resolve:s(u=>{l(u)},"resolve"),reject:c,schema:n})})}finally{r&&r.removeEventListener("abort",a),this.pendingRequests.delete(o)}}createCanUseTool(t){return async(n,r,o,i,a,l)=>{let c=l??await eb(n,r,o,i,a);if(c.behavior==="allow"||c.behavior==="deny")return c;let u=new AbortController,d=o.abortController.signal,A=s(()=>u.abort(),"onParentAbort");d.addEventListener("abort",A,{once:!0});try{let p=WXi(n.name,a,r,o,c.suggestions).then(b=>({source:"hook",decision:b})),m=xTn();t?.(qXi(n,r,a,m));let f=this.sendRequest({subtype:"can_use_tool",tool_name:n.name,input:r,permission_suggestions:c.suggestions,blocked_path:c.blockedPath,decision_reason:zXi(c.decisionReason),tool_use_id:a,agent_id:o.agentId},Jze(),u.signal,m).then(b=>({source:"sdk",result:b})),h=await Promise.race([p,f]);if(h.source==="hook"){if(h.decision)return f.catch(()=>{}),u.abort(),h.decision;let b=await f;return Wxe(b.result,n,r,o)}return Wxe(h.result,n,r,o)}catch(p){return Wxe({behavior:"deny",message:`Tool permission request failed: ${p}`,toolUseID:a},n,r,o)}finally{this.getPendingPermissionRequests().length===0&&Axe("running"),d.removeEventListener("abort",A)}}}createHookCallback(t,n){return{type:"callback",timeout:n,callback:s(async(r,o,i)=>{try{return await this.sendRequest({subtype:"hook_callback",callback_id:t,input:r,tool_use_id:o||void 0},axe(),i)}catch(a){return console.error(`Error in hook callback ${t}:`,a),{}}},"callback")}}async handleElicitation(t,n,r,o,i,a,l){try{return await this.sendRequest({subtype:"elicitation",mcp_server_name:t,message:n,mode:i,url:a,elicitation_id:l,requested_schema:r},TRo(),o)}catch{return{action:"cancel"}}}createSandboxAskCallback(){return async t=>{try{return(await this.sendRequest({subtype:"can_use_tool",tool_name:jXi,input:{host:t.host},tool_use_id:xTn(),description:`Allow network connection to ${t.host}?`},Jze())).behavior==="allow"}catch{return!1}}}async sendMcpMessage(t,n){return(await this.sendRequest({subtype:"mcp_message",server_name:t,message:n},C.object({mcp_response:C.any()}))).mcp_response}};s(RRo,"exitWithMessage");s(WXi,"executePermissionRequestHooksForSDK")});function IRo(e,t,n){let r=(0,nPt.useRef)(!1);(0,nPt.useEffect)(()=>{!yA()||r.current||(r.current=!0,e&&Z_t(e,n))},[t,e,n])}var nPt,PRo=S(()=>{nPt=U(et());RI();s(IRo,"useFileHistorySnapshotInit")});function CTn({hostPattern:{host:e},onUserResponse:t}){function n(i){switch(i){case"yes":t({allow:!0,persistToSettings:!1});break;case"yes-dont-ask-again":t({allow:!0,persistToSettings:!0});break;case"no":t({allow:!1,persistToSettings:!1});break}}s(n,"onSelect");let r=Kte(),o=[{label:"Yes",value:"yes"},...r?[]:[{label:(0,jk.jsxs)(_,{children:["Yes, and don't ask again for ",(0,jk.jsx)(_,{bold:!0,children:e})]}),value:"yes-dont-ask-again"}],{label:(0,jk.jsxs)(_,{children:["No, and tell Claude what to do differently ",(0,jk.jsx)(_,{bold:!0,children:"(esc)"})]}),value:"no"}];return(0,jk.jsx)(Xu,{title:"Network request outside of sandbox",children:(0,jk.jsxs)(O,{flexDirection:"column",paddingX:2,paddingY:1,children:[(0,jk.jsxs)(O,{children:[(0,jk.jsx)(_,{dimColor:!0,children:"Host:"}),(0,jk.jsxs)(_,{children:[" ",e]})]}),(0,jk.jsx)(O,{marginTop:1,children:(0,jk.jsx)(_,{children:"Do you want to allow this connection?"})}),(0,jk.jsx)(O,{children:(0,jk.jsx)(Jt,{options:o,onChange:n,onCancel:()=>{t({allow:!1,persistToSettings:!1})}})})]})})}var jk,ORo=S(()=>{Xe();Td();vt();va();TE();jk=U(Z());s(CTn,"SandboxPermissionRequest")});function VXi(e){let t=e.getHours()%12||12,n=String(e.getMinutes()).padStart(2,"0"),r=String(e.getSeconds()).padStart(2,"0"),o=e.getHours()<12?"am":"pm";return`${t}:${n}:${r}${o}`}function wTn(){let[e,t]=(0,Zze.useState)([]),[n,r]=(0,Zze.useState)(0);return(0,Zze.useEffect)(()=>{let o=tr.getSandboxViolationStore();return o.subscribe(a=>{t(a.slice(-10)),r(o.getTotalCount())})},[]),!tr.isSandboxingEnabled()||un()==="linux"||n===0?null:(0,tY.jsxs)(O,{flexDirection:"column",marginTop:1,children:[(0,tY.jsx)(O,{marginLeft:0,children:(0,tY.jsxs)(_,{color:"permission",children:["\u29C8 Sandbox blocked ",n," total"," ",n===1?"operation":"operations"]})}),e.map((o,i)=>(0,tY.jsx)(O,{paddingLeft:2,children:(0,tY.jsxs)(_,{dimColor:!0,children:[VXi(o.timestamp),o.command?` ${o.command}:`:""," ",o.line]})},`${o.timestamp.getTime()}-${i}`)),(0,tY.jsx)(O,{paddingLeft:2,children:(0,tY.jsxs)(_,{dimColor:!0,children:["\u2026 showing last ",Math.min(10,e.length)," of ",n]})})]})}var Zze,tY,MRo=S(()=>{Zze=U(et());Xe();Td();Zs();tY=U(Z());s(VXi,"formatTime");s(wTn,"SandboxViolationExpandedView")});function NRo({mcpClients:e=YXi}){let{addNotification:t}=ei();(0,DRo.useEffect)(()=>{if(ri())return;let n=e.filter(a=>a.type==="failed"&&a.config.type!=="sse-ide"&&a.config.type!=="ws-ide"&&a.config.type!=="claudeai-proxy"),r=e.filter(a=>a.type==="failed"&&a.config.type==="claudeai-proxy"&&EZt(a.name)),o=e.filter(a=>a.type==="needs-auth"&&a.config.type!=="claudeai-proxy"),i=e.filter(a=>a.type==="needs-auth"&&a.config.type==="claudeai-proxy"&&EZt(a.name));n.length===0&&r.length===0&&o.length===0&&i.length===0||(n.length>0&&t({key:"mcp-failed",jsx:(0,wS.jsxs)(wS.Fragment,{children:[(0,wS.jsxs)(_,{color:"error",children:[n.length," MCP"," ",n.length===1?"server":"servers"," failed"]}),(0,wS.jsx)(_,{dimColor:!0,children:" \xB7 /mcp"})]}),priority:"medium"}),r.length>0&&t({key:"mcp-claudeai-failed",jsx:(0,wS.jsxs)(wS.Fragment,{children:[(0,wS.jsxs)(_,{color:"error",children:[r.length," claude.ai"," ",r.length===1?"connector":"connectors"," ","unavailable"]}),(0,wS.jsx)(_,{dimColor:!0,children:" \xB7 /mcp"})]}),priority:"medium"}),o.length>0&&t({key:"mcp-needs-auth",jsx:(0,wS.jsxs)(wS.Fragment,{children:[(0,wS.jsxs)(_,{color:"warning",children:[o.length," MCP"," ",o.length===1?"server needs":"servers need"," ","auth"]}),(0,wS.jsx)(_,{dimColor:!0,children:" \xB7 /mcp"})]}),priority:"medium"}),i.length>0&&t({key:"mcp-claudeai-needs-auth",jsx:(0,wS.jsxs)(wS.Fragment,{children:[(0,wS.jsxs)(_,{color:"warning",children:[i.length," claude.ai"," ",i.length===1?"connector needs":"connectors need"," ","auth"]}),(0,wS.jsx)(_,{dimColor:!0,children:" \xB7 /mcp"})]}),priority:"medium"}))},[t,e])}var DRo,wS,YXi,LRo=S(()=>{DRo=U(et());hA();St();Xe();X_e();wS=U(Z()),YXi=[];s(NRo,"useMcpConnectivityStatus")});function FRo(){let{addNotification:e}=ei(),t=gt(i=>i.toolPermissionContext.mode),n=gt(i=>i.toolPermissionContext.isAutoModeAvailable),r=(0,eqe.useRef)(!1),o=(0,eqe.useRef)(t);(0,eqe.useEffect)(()=>{let i=o.current;if(o.current=t,ri()||r.current||!(t==="default"&&i!=="default"&&i!=="auto"&&!n&&RG()))return;let l=uie();l&&(r.current=!0,e({key:"auto-mode-unavailable",text:Dve(l),color:"warning",priority:"medium"}))},[t,n,e])}var eqe,URo=S(()=>{eqe=U(et());hA();St();fr();Hy();Mn();s(FRo,"useAutoModeUnavailableNotification")});function BRo(){let{addNotification:e}=ei(),t=Mr(),[n,r]=nY.useState(()=>qe("true")),o=nY.useRef(new Set),i=nY.useCallback((l,c)=>{let u=`${l}:${c}`;if(o.current.has(u))return;o.current.add(u),v(`LSP error: ${l} - ${c}`),t(A=>{let p=new Set(A.plugins.errors.map(f=>f.type==="generic-error"?`generic-error:${f.source}:${f.error}`:`${f.type}:${f.source}`)),m=`generic-error:${l}:${c}`;return p.has(m)?A:{...A,plugins:{...A.plugins,errors:[...A.plugins.errors,{type:"generic-error",source:l,error:c}]}}});let d=l.startsWith("plugin:")?l.split(":")[1]??l:l;e({key:`lsp-error-${l}`,jsx:(0,Wae.jsxs)(Wae.Fragment,{children:[(0,Wae.jsxs)(_,{color:"error",children:["LSP for ",d," failed"]}),(0,Wae.jsx)(_,{dimColor:!0,children:" \xB7 /plugin for details"})]}),priority:"medium",timeoutMs:8e3})},[e,t]),a=nY.useCallback(()=>{if(ri()||yJ())return;let l=xSe();if(l.status==="failed"){i("lsp-manager",l.error.message),r(!1);return}if(l.status==="pending"||l.status==="not-started")return;let c=R4();if(c){let u=c.getAllServers();for(let[d,A]of u)A.state==="error"&&A.lastError&&i(d,A.lastError.message)}},[i]);fE(a,n?KXi:null),nY.useEffect(()=>{ri()||!n||a()},[a,n])}var nY,Wae,KXi,$Ro=S(()=>{nY=U(et());VR();St();hA();Xe();gj();fr();it();Ot();Wae=U(Z()),KXi=5e3;s(BRo,"useLspInitializationNotification")});async function jRo(e){if(!e||!e.trim())return v("[binaryCheck] Empty command provided, returning false"),!1;let t=e.trim(),n=HRo.get(t);if(n!==void 0)return v(`[binaryCheck] Cache hit for '${t}': ${n}`),n;let r=!1;return await Hb(t).catch(()=>null)&&(r=!0),HRo.set(t,r),v(`[binaryCheck] Binary '${t}' ${r?"found":"not found"}`),r}var HRo,zRo=S(()=>{it();oD();HRo=new Map;s(jRo,"isBinaryInstalled")});import{extname as QXi}from"path";function JXi(e){return rH.has(e.toLowerCase())}function ZXi(e){if(!e)return null;if(typeof e=="string")return v("[lspRecommendation] Skipping string path lspServers (not readable from marketplace)"),null;if(Array.isArray(e)){for(let t of e){if(typeof t=="string")continue;let n=GRo(t);if(n)return n}return null}return GRo(e)}function qRo(e){return typeof e=="object"&&e!==null}function GRo(e){let t=new Set,n=null;for(let[r,o]of Object.entries(e)){if(!qRo(o))continue;!n&&typeof o.command=="string"&&(n=o.command);let i=o.extensionToLanguage;if(qRo(i))for(let a of Object.keys(i))t.add(a.toLowerCase())}return!n||t.size===0?null:{extensions:t,command:n}}async function eJi(){let e=new Map;try{let t=await Hc();for(let n of Object.keys(t))try{let r=await PT(n),o=JXi(n);for(let i of r.plugins){if(!i.lspServers)continue;let a=ZXi(i.lspServers);if(!a)continue;let l=`${i.name}@${n}`;e.set(l,{entry:i,marketplaceName:n,extensions:a.extensions,command:a.command,isOfficial:o})}}catch(r){v(`[lspRecommendation] Failed to load marketplace ${n}: ${r}`)}}catch(t){v(`[lspRecommendation] Failed to load marketplaces config: ${t}`)}return e}async function WRo(e){if(tJi())return v("[lspRecommendation] Recommendations are disabled"),[];let t=QXi(e).toLowerCase();if(!t)return v("[lspRecommendation] No file extension found"),[];v(`[lspRecommendation] Looking for LSP plugins for ${t}`);let n=await eJi(),o=rt().lspRecommendationNeverPlugins??[],i=[];for(let[l,c]of n)if(c.extensions.has(t)){if(o.includes(l)){v(`[lspRecommendation] Skipping ${l} (in never suggest list)`);continue}if(nL(l)){v(`[lspRecommendation] Skipping ${l} (already installed)`);continue}i.push({info:c,pluginId:l})}let a=[];for(let{info:l,pluginId:c}of i)await jRo(l.command)?(a.push({info:l,pluginId:c}),v(`[lspRecommendation] Binary '${l.command}' found for ${c}`)):v(`[lspRecommendation] Skipping ${c} (binary '${l.command}' not found)`);return a.sort((l,c)=>l.info.isOfficial&&!c.info.isOfficial?-1:!l.info.isOfficial&&c.info.isOfficial?1:0),a.map(({info:l,pluginId:c})=>({pluginId:c,pluginName:l.entry.name,marketplaceName:l.marketplaceName,description:l.entry.description,isOfficial:l.isOfficial,extensions:Array.from(l.extensions),command:l.command}))}function VRo(e){kt(t=>{let n=t.lspRecommendationNeverPlugins??[];return n.includes(e)?t:{...t,lspRecommendationNeverPlugins:[...n,e]}}),v(`[lspRecommendation] Added ${e} to never suggest`)}function YRo(){kt(e=>{let t=(e.lspRecommendationIgnoredCount??0)+1;return{...e,lspRecommendationIgnoredCount:t}}),v("[lspRecommendation] Incremented ignored count")}function tJi(){let e=rt();return e.lspRecommendationDisabled===!0||(e.lspRecommendationIgnoredCount??0)>=XXi}var XXi,KRo=S(()=>{zRo();mn();it();hS();nm();Lx();XXi=5;s(JXi,"isOfficialMarketplace");s(ZXi,"extractLspInfoFromManifest");s(qRo,"isRecord");s(GRo,"extractFromServerConfigRecord");s(eJi,"getLspPluginsFromMarketplaces");s(WRo,"getMatchingLspPlugins");s(VRo,"addToNeverSuggest");s(YRo,"incrementIgnoredCount");s(tJi,"isLspRecommendationsDisabled")});function rPt(){let[e,t]=Vae.useState(null),n=Vae.useRef(!1),r=Vae.useCallback(i=>{ri()||e||n.current||(n.current=!0,i().then(a=>{a&&t(a)}).catch(ne).finally(()=>{n.current=!1}))},[e]),o=Vae.useCallback(()=>t(null),[]);return{recommendation:e,clearRecommendation:o,tryResolve:r}}async function oPt(e,t,n,r,o){try{let i=await vC(e);if(!i)throw new Error(`Plugin ${e} not found in marketplace`);await o(i),r({key:`${n}-installed`,jsx:(0,kTn.jsxs)(_,{color:"success",children:[Ze.tick," ",t," installed \xB7 restart to apply"]}),priority:"immediate",timeoutMs:5e3})}catch(i){ne(i),r({key:`${n}-install-failed`,jsx:(0,kTn.jsxs)(_,{color:"error",children:["Failed to install ",t]}),priority:"immediate",timeoutMs:5e3})}}var Vae,kTn,RTn=S(()=>{oo();Vae=U(et());St();Xe();wt();nm();kTn=U(Z());s(rPt,"usePluginRecommendationBase");s(oPt,"installPluginAndNotify")});import{extname as nJi,join as rJi}from"path";function QRo(){let e=gt(l=>l.fileHistory.trackedFiles),{addNotification:t}=ei(),n=Yxe.useRef(new Set),{recommendation:r,clearRecommendation:o,tryResolve:i}=rPt();Yxe.useEffect(()=>{i(async()=>{if(MMt())return null;let l=[];for(let c of e)n.current.has(c)||(n.current.add(c),l.push(c));for(let c of l)try{let d=(await WRo(c))[0];if(d)return v(`[useLspPluginRecommendation] Found match: ${d.pluginName} for ${c}`),DMt(!0),{pluginId:d.pluginId,pluginName:d.pluginName,pluginDescription:d.description,fileExtension:nJi(c),shownAt:Date.now()}}catch(u){ne(u)}return null})},[e,i]);let a=Yxe.useCallback(l=>{if(!r)return;let{pluginId:c,pluginName:u,shownAt:d}=r;switch(v(`[useLspPluginRecommendation] User response: ${l} for ${u}`),l){case"yes":oPt(c,u,"lsp-plugin",t,async A=>{v(`[useLspPluginRecommendation] Installing plugin: ${c}`);let p=typeof A.entry.source=="string"?rJi(A.marketplaceInstallLocation,A.entry.source):void 0;await ZHe(c,A.entry,"user",void 0,p);let m=An("userSettings");Jn("userSettings",{enabledPlugins:{...m?.enabledPlugins,[c]:!0}}),v(`[useLspPluginRecommendation] Plugin installed: ${c}`)});break;case"no":{let A=Date.now()-d;A>=oJi&&(v(`[useLspPluginRecommendation] Timeout detected (${A}ms), incrementing ignored count`),YRo());break}case"never":VRo(c);break;case"disable":kt(A=>A.lspRecommendationDisabled?A:{...A,lspRecommendationDisabled:!0});break}o()},[r,t,o]);return{recommendation:r,handleResponse:a}}var Yxe,oJi,XRo=S(()=>{Yxe=U(et());St();hA();fr();mn();it();wt();KRo();d7();Mn();RTn();oJi=28e3;s(QRo,"useLspPluginRecommendation")});function JRo({pluginName:e,pluginDescription:t,fileExtension:n,onResponse:r}){let o=sPt.useRef(r);o.current=r,sPt.useEffect(()=>{let l=setTimeout(c=>c.current("no"),sJi,o);return()=>clearTimeout(l)},[]);function i(l){switch(l){case"yes":r("yes");break;case"no":r("no");break;case"never":r("never");break;case"disable":r("disable");break}}return s(i,"onSelect"),(0,x_.jsx)(Xu,{title:"LSP Plugin Recommendation",children:(0,x_.jsxs)(O,{flexDirection:"column",paddingX:2,paddingY:1,children:[(0,x_.jsx)(O,{marginBottom:1,children:(0,x_.jsx)(_,{dimColor:!0,children:"LSP provides code intelligence like go-to-definition and error checking"})}),(0,x_.jsxs)(O,{children:[(0,x_.jsx)(_,{dimColor:!0,children:"Plugin:"}),(0,x_.jsxs)(_,{children:[" ",e]})]}),t&&(0,x_.jsx)(O,{children:(0,x_.jsx)(_,{dimColor:!0,children:t})}),(0,x_.jsxs)(O,{children:[(0,x_.jsx)(_,{dimColor:!0,children:"Triggered by:"}),(0,x_.jsxs)(_,{children:[" ",n," files"]})]}),(0,x_.jsx)(O,{marginTop:1,children:(0,x_.jsx)(_,{children:"Would you like to install this LSP plugin?"})}),(0,x_.jsx)(O,{children:(0,x_.jsx)(Jt,{options:[{label:(0,x_.jsxs)(_,{children:["Yes, install ",(0,x_.jsx)(_,{bold:!0,children:e})]}),value:"yes"},{label:"No, not now",value:"no"},{label:(0,x_.jsxs)(_,{children:["Never for ",(0,x_.jsx)(_,{bold:!0,children:e})]}),value:"never"},{label:"Disable all LSP recommendations",value:"disable"}],onChange:i,onCancel:()=>r("no")})})]})})}var sPt,x_,sJi,ZRo=S(()=>{sPt=U(et());Xe();va();TE();x_=U(Z()),sJi=3e4;s(JRo,"LspRecommendationMenu")});function eIo(){let e=Kxe.useSyncExternalStore(Y$r,Vin),{addNotification:t}=ei(),{recommendation:n,clearRecommendation:r,tryResolve:o}=rPt();Kxe.useEffect(()=>{e&&o(async()=>{let a=await X$r(e);return a&&(v(`[useClaudeCodeHintRecommendation] surfacing ${a.pluginId} from ${a.sourceCommand}`),V$r()),Vin()===e&&W$r(),a})},[e,o]);let i=Kxe.useCallback(a=>{if(n){switch(J$r(n.pluginId),q("tengu_plugin_hint_response",{_PROTO_plugin_name:n.pluginName,_PROTO_marketplace_name:n.marketplaceName,response:a}),a){case"yes":{let{pluginId:l,pluginName:c,marketplaceName:u}=n;oPt(l,c,"hint-plugin",t,async d=>{let A=await u7({pluginId:l,entry:d.entry,marketplaceName:u,scope:"user",trigger:"hint"});if(!A.success)throw new Error(A.error)});break}case"disable":Z$r();break;case"no":break}r()}},[n,t,r]);return{recommendation:n,handleResponse:i}}var Kxe,tIo=S(()=>{Kxe=U(et());hA();vt();QBe();it();rbt();d7();RTn();s(eIo,"useClaudeCodeHintRecommendation")});function nIo({pluginName:e,pluginDescription:t,marketplaceName:n,sourceCommand:r,onResponse:o}){let i=iPt.useRef(o);i.current=o,iPt.useEffect(()=>{let c=setTimeout(u=>u.current("no"),iJi,i);return()=>clearTimeout(c)},[]);function a(c){switch(c){case"yes":o("yes");break;case"disable":o("disable");break;default:o("no")}}return s(a,"onSelect"),(0,ly.jsx)(Xu,{title:"Plugin Recommendation",children:(0,ly.jsxs)(O,{flexDirection:"column",paddingX:2,paddingY:1,children:[(0,ly.jsx)(O,{marginBottom:1,children:(0,ly.jsxs)(_,{dimColor:!0,children:["The ",(0,ly.jsx)(_,{bold:!0,children:r})," command suggests installing a plugin."]})}),(0,ly.jsxs)(O,{children:[(0,ly.jsx)(_,{dimColor:!0,children:"Plugin:"}),(0,ly.jsxs)(_,{children:[" ",e]})]}),(0,ly.jsxs)(O,{children:[(0,ly.jsx)(_,{dimColor:!0,children:"Marketplace:"}),(0,ly.jsxs)(_,{children:[" ",n]})]}),t&&(0,ly.jsx)(O,{children:(0,ly.jsx)(_,{dimColor:!0,children:t})}),(0,ly.jsx)(O,{marginTop:1,children:(0,ly.jsx)(_,{children:"Would you like to install it?"})}),(0,ly.jsx)(O,{children:(0,ly.jsx)(Jt,{options:[{label:(0,ly.jsxs)(_,{children:["Yes, install ",(0,ly.jsx)(_,{bold:!0,children:e})]}),value:"yes"},{label:"No",value:"no"},{label:"No, and don't show plugin installation hints again",value:"disable"}],onChange:a,onCancel:()=>o("no")})})]})})}var iPt,ly,iJi,rIo=S(()=>{iPt=U(et());Xe();va();TE();ly=U(Z()),iJi=3e4;s(nIo,"PluginHintMenu")});function oIo(){let{addNotification:e}=ei(),t=gt(i=>i.plugins.installationStatus),{totalFailed:n,failedMarketplacesCount:r,failedPluginsCount:o}=(0,aPt.useMemo)(()=>{if(!t)return{totalFailed:0,failedMarketplacesCount:0,failedPluginsCount:0};let i=t.marketplaces.filter(l=>l.status==="failed"),a=t.plugins.filter(l=>l.status==="failed");return{totalFailed:i.length+a.length,failedMarketplacesCount:i.length,failedPluginsCount:a.length}},[t]);(0,aPt.useEffect)(()=>{if(!ri()){if(!t){v("No installation status to monitor");return}n!==0&&(v(`Plugin installation status: ${r} failed marketplaces, ${o} failed plugins`),n!==0&&(v(`Adding notification for ${n} failed installations`),e({key:"plugin-install-failed",jsx:(0,Yae.jsxs)(Yae.Fragment,{children:[(0,Yae.jsxs)(_,{color:"error",children:[n," ",Qn(n,"plugin")," failed to install"]}),(0,Yae.jsx)(_,{dimColor:!0,children:" \xB7 /plugin for details"})]}),priority:"medium"})))}},[e,n,r,o])}var aPt,Yae,sIo=S(()=>{aPt=U(et());St();hA();Xe();fr();it();Do();Yae=U(Z());s(oIo,"usePluginInstallationStatus")});function iIo(){let{addNotification:e}=ei(),[t,n]=(0,tqe.useState)([]);(0,tqe.useEffect)(()=>ri()?void 0:zso(o=>{v(`Plugin autoupdate notification: ${o.length} plugin(s) updated`),n(o)}),[]),(0,tqe.useEffect)(()=>{if(ri()||t.length===0)return;let r=t.map(i=>{let a=i.indexOf("@");return a>0?i.substring(0,a):i}),o=r.length<=2?r.join(" and "):`${r.length} plugins`;e({key:"plugin-autoupdate-restart",jsx:(0,Kae.jsxs)(Kae.Fragment,{children:[(0,Kae.jsxs)(_,{color:"success",children:[r.length===1?"Plugin":"Plugins"," updated:"," ",o]}),(0,Kae.jsx)(_,{dimColor:!0,children:" \xB7 Run /reload-plugins to apply"})]}),priority:"low",timeoutMs:1e4}),v(`Showing plugin autoupdate notification for: ${r.join(", ")}`)},[t,e])}var tqe,Kae,aIo=S(()=>{tqe=U(et());St();hA();Xe();it();LCt();Kae=U(Z());s(iIo,"usePluginAutoupdateNotification")});import{isAbsolute as aJi,resolve as lJi}from"path";function ITn(e,t,n){let r=[],o=[],i=[];for(let[a,l]of Object.entries(e)){let c=t[a],u=lIo(l.source,n?.projectRoot);c?l.sourceIsFallback||$g(u,c.source)?i.push(a):o.push({name:a,declaredSource:u,materializedSource:c.source}):r.push(a)}return{missing:r,sourceChanged:o,upToDate:i}}async function lPt(e){let t=a7();if(Object.keys(t).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let n;try{n=await Hc()}catch(d){ne(d),n={}}let r=ITn(t,n,{projectRoot:Un()}),o=[...r.missing.map(d=>({name:d,source:lIo(t[d].source),action:"install"})),...r.sourceChanged.map(({name:d,declaredSource:A})=>({name:d,source:A,action:"update"}))],i=[],a=[];for(let d of o){if(e?.skip?.(d.name,d.source)){i.push(d.name);continue}if(d.action==="update"&&oH(d.source)&&!await Yi(d.source.path)){v(`[reconcile] '${d.name}' declared path does not exist; keeping materialized entry`),i.push(d.name);continue}a.push(d)}if(a.length===0)return{installed:[],updated:[],failed:[],upToDate:r.upToDate,skipped:i};v(`[reconcile] ${a.length} marketplace(s): ${a.map(d=>`${d.name}(${d.action})`).join(", ")}`);let l=[],c=[],u=[];for(let d=0;d<a.length;d++){let{name:A,source:p,action:m}=a[d];e?.onProgress?.({type:"installing",name:A,action:m,index:d+1,total:a.length});try{let f=await $j(p);m==="install"?l.push(A):c.push(A),e?.onProgress?.({type:"installed",name:A,alreadyMaterialized:f.alreadyMaterialized})}catch(f){let h=We(f);u.push({name:A,error:h}),e?.onProgress?.({type:"failed",name:A,error:h}),ne(f)}}return{installed:l,updated:c,failed:u,upToDate:r.upToDate,skipped:i}}function lIo(e,t){if((e.source==="directory"||e.source==="file")&&!aJi(e.path)){let n=t??Un(),r=zg(n);return{...e,path:lJi(r??n,e.path)}}return e}var PTn=S(()=>{pG();St();it();Ct();oi();Pa();wt();nm();Lx();s(ITn,"diffMarketplaces");s(lPt,"reconcileMarketplaces");s(lIo,"normalizeSource")});function OTn(e,t,n,r){e(o=>({...o,plugins:{...o.plugins,installationStatus:{...o.plugins.installationStatus,marketplaces:o.plugins.installationStatus.marketplaces.map(i=>i.name===t?{...i,status:n,error:r}:i)}}}))}async function cIo(e){v("performBackgroundPluginInstallations called");try{let t=a7(),n=await Hc().catch(()=>({})),r=ITn(t,n),o=[...r.missing,...r.sourceChanged.map(l=>l.name)];if(e(l=>({...l,plugins:{...l.plugins,installationStatus:{marketplaces:o.map(c=>({name:c,status:"pending"})),plugins:[]}}})),o.length===0)return;v(`Installing ${o.length} marketplace(s) in background`);let i=await lPt({onProgress:s(l=>{switch(l.type){case"installing":OTn(e,l.name,"installing");break;case"installed":OTn(e,l.name,"installed");break;case"failed":OTn(e,l.name,"failed",l.error);break}},"onProgress")}),a={installed_count:i.installed.length,updated_count:i.updated.length,failed_count:i.failed.length,up_to_date_count:i.upToDate.length};if(q("tengu_marketplace_background_install",a),Wt("info","tengu_marketplace_background_install",a),i.installed.length>0){Bj(),v(`Auto-refreshing plugins after ${i.installed.length} new marketplace(s) installed`);try{await Jie(e)}catch(l){ne(l),v(`Auto-refresh failed, falling back to needsRefresh: ${l}`,{level:"warn"}),hk("performBackgroundPluginInstallations: auto-refresh failed"),e(c=>c.plugins.needsRefresh?c:{...c,plugins:{...c.plugins,needsRefresh:!0}})}}else i.updated.length>0&&(Bj(),hk("performBackgroundPluginInstallations: marketplaces reconciled"),e(l=>l.plugins.needsRefresh?l:{...l,plugins:{...l.plugins,needsRefresh:!0}}))}catch(t){ne(t)}}var uIo=S(()=>{it();Fd();wt();nm();dg();PTn();lkt();vt();s(OTn,"updateMarketplaceStatus");s(cIo,"performBackgroundPluginInstallations")});async function dIo(e){if(v("performStartupChecks called"),!dA()){v("Trust not accepted for current directory - skipping plugin installations");return}try{v("Starting background plugin installations"),await TTt()&&(Bj(),hk("performStartupChecks: seed marketplaces changed"),e(n=>n.plugins.needsRefresh?n:{...n,plugins:{...n.plugins,needsRefresh:!0}})),await cIo(e)}catch(t){v(`Error initiating background plugin installations: ${t}`)}}var AIo=S(()=>{uIo();mn();it();nm();dg();s(dIo,"performStartupChecks")});function pIo(){let[e,t]=(0,cPt.useState)(c1.getInstance().getStatus());return(0,cPt.useEffect)(()=>c1.getInstance().subscribe(t),[]),!e.isAuthenticating&&!e.error&&e.output.length===0||!e.isAuthenticating&&!e.error?null:(0,Lz.jsxs)(O,{flexDirection:"column",borderStyle:"round",borderColor:"permission",paddingX:1,marginY:1,children:[(0,Lz.jsx)(_,{bold:!0,color:"permission",children:"Cloud Authentication"}),e.output.length>0&&(0,Lz.jsx)(O,{flexDirection:"column",marginTop:1,children:e.output.slice(-5).map((n,r)=>{let o=n.match(cJi);if(!o)return(0,Lz.jsx)(_,{dimColor:!0,children:n},r);let i=o[0],a=o.index??0,l=n.slice(0,a),c=n.slice(a+i.length);return(0,Lz.jsxs)(_,{dimColor:!0,children:[l,(0,Lz.jsx)(xo,{url:i,children:i}),c]},r)})}),e.error&&(0,Lz.jsx)(O,{marginTop:1,children:(0,Lz.jsx)(_,{color:"error",children:e.error})})]})}var cPt,Lz,cJi,mIo=S(()=>{cPt=U(et());Xe();grt();Lz=U(Z()),cJi=/https?:\/\/\S+/;s(pIo,"AwsAuthStatusBox")});function fIo(e){let{addNotification:t}=ei(),n=Q9(),r=(0,Fz.useMemo)(()=>O7t(n,e),[n,e]),o=(0,Fz.useMemo)(()=>M7t(n),[n]),i=(0,Fz.useRef)(null),a=Ei(),l=lH(),c=a==="team"||a==="enterprise",[u,d]=(0,Fz.useState)(!1);(0,Fz.useEffect)(()=>{ri()||(n.isUsingOverage&&!u&&(!c||l)?(t({key:"limit-reached",text:o,priority:"immediate"}),d(!0)):!n.isUsingOverage&&u&&d(!1))},[n.isUsingOverage,o,u,t,l,c]),(0,Fz.useEffect)(()=>{ri()||r&&r!==i.current&&(i.current=r,t({key:"rate-limit-warning",jsx:(0,MTn.jsx)(_,{children:(0,MTn.jsx)(_,{color:"warning",children:r})}),priority:"high"}))},[r,t])}var Fz,MTn,gIo=S(()=>{Fz=U(et());hA();Xe();y2();oUe();Cr();MG();St();MTn=U(Z());s(fIo,"useRateLimitWarningNotification")});function dJi(e){let t=e.toLowerCase(),n=lr();for(let[r,o]of Object.entries(uJi)){let i=o.retirementDates[n];if(!(!t.includes(r)||!i))return{isDeprecated:!0,modelName:o.modelName,retirementDate:i}}return{isDeprecated:!1}}function uPt(e){if(!e)return null;let t=dJi(e);return t.isDeprecated?`\u26A0 ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}var uJi,DTn=S(()=>{Jc();uJi={"claude-3-opus":{modelName:"Claude 3 Opus",retirementDates:{firstParty:"January 5, 2026",bedrock:"January 15, 2026",vertex:"January 5, 2026",foundry:"January 5, 2026"}},"claude-3-7-sonnet":{modelName:"Claude 3.7 Sonnet",retirementDates:{firstParty:"February 19, 2026",bedrock:"April 28, 2026",vertex:"May 11, 2026",foundry:"February 19, 2026"}},"claude-3-5-haiku":{modelName:"Claude 3.5 Haiku",retirementDates:{firstParty:"February 19, 2026",bedrock:null,vertex:null,foundry:null}}};s(dJi,"getDeprecatedModelInfo");s(uPt,"getModelDeprecationWarning")});function hIo(e){let{addNotification:t}=ei(),n=(0,dPt.useRef)(null);(0,dPt.useEffect)(()=>{if(ri())return;let r=uPt(e);r&&r!==n.current&&(n.current=r,t({key:"model-deprecation-warning",text:r,color:"warning",priority:"high"})),r||(n.current=null)},[e,t])}var dPt,_Io=S(()=>{dPt=U(et());hA();DTn();St();s(hIo,"useDeprecationWarningNotification")});function yIo(){qL(async()=>My()||qe(process.env.DISABLE_INSTALLATION_CHECKS)||await c4()==="development"?null:{timeoutMs:15e3,key:"npm-deprecation-warning",text:AJi,color:"warning",priority:"high"})}var AJi,bIo=S(()=>{iD();mQ();Ot();Gae();AJi="Claude Code has switched from npm to native installer. Run `claude install` or see https://docs.anthropic.com/en/docs/claude-code/getting-started for more options.";s(yIo,"useNpmDeprecationNotification")});function SIo({ideSelection:e,mcpClients:t,ideInstallationStatus:n}){let{addNotification:r,removeNotification:o}=ei(),{status:i,ideName:a}=Pxe(t),l=(0,Qae.useRef)(!1),c=n?hU(n?.ideType):!1,u=n?.error||c,d=i==="connected"&&(e?.filePath||e?.text&&e.lineCount>0),A=i==="connected"&&!d,p=u&&!c&&!A&&!d,m=u&&c&&!A&&!d;(0,Qae.useEffect)(()=>{if(ri())return;if(aS()||i!==null||m){o("ide-status-hint");return}if(l.current||(rt().ideHintShownCount??0)>=pJi)return;let f=setTimeout((h,b)=>{gye(!0).then(E=>{let x=E[0]?.name;x&&!h.current&&(h.current=!0,kt(T=>({...T,ideHintShownCount:(T.ideHintShownCount??0)+1})),b({key:"ide-status-hint",jsx:(0,APt.jsxs)(_,{dimColor:!0,children:["/ide for ",(0,APt.jsx)(_,{color:"ide",children:x})]}),priority:"low"}))})},3e3,l,r);return()=>clearTimeout(f)},[r,o,i,m]),(0,Qae.useEffect)(()=>{if(!ri()){if(p||m||i!=="disconnected"||!a){o("ide-status-disconnected");return}r({key:"ide-status-disconnected",text:`${a} disconnected`,color:"error",priority:"medium"})}},[r,o,i,a,p,m]),(0,Qae.useEffect)(()=>{if(!ri()){if(!m){o("ide-status-jetbrains-disconnected");return}r({key:"ide-status-jetbrains-disconnected",text:"IDE plugin not connected \xB7 /status for info",priority:"medium"})}},[r,o,m]),(0,Qae.useEffect)(()=>{if(!ri()){if(!p){o("ide-status-install-error");return}r({key:"ide-status-install-error",text:"IDE extension install failed (see /status for info)",color:"error",priority:"medium"})}},[r,o,p])}var Qae,APt,pJi,EIo=S(()=>{Qae=U(et());hA();Xe();mn();gf();St();ORt();APt=U(Z()),pJi=5;s(SIo,"useIDEStatusIndicator")});function TIo(){qL(()=>{let e=rt(),t=[];for(let n of mJi){let r=n(e);r&&t.push(r)}return t.length>0?t:null})}function vIo(e){return e!==void 0&&Date.now()-e<3e3}var mJi,xIo=S(()=>{mn();Gae();mJi=[e=>{if(vIo(e.sonnet45To46MigrationTimestamp))return{key:"sonnet-46-update",text:"Model updated to Sonnet 4.6",color:"suggestion",priority:"high",timeoutMs:3e3}},e=>{let t=!!e.legacyOpusMigrationTimestamp,n=e.legacyOpusMigrationTimestamp??e.opusProMigrationTimestamp;if(vIo(n))return{key:"opus-pro-update",text:t?"Model updated to Opus 4.6 \xB7 Set CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP=1 to opt out":"Model updated to Opus 4.6",color:"suggestion",priority:"high",timeoutMs:t?8e3:3e3}}];s(TIo,"useModelMigrationNotifications");s(vIo,"recent")});function CIo(){qL(async()=>{if((rt().subscriptionNoticeCount??0)>=fJi)return null;let e=await gJi();return e===null?null:(kt(t=>({...t,subscriptionNoticeCount:(t.subscriptionNoticeCount??0)+1})),q("tengu_switch_to_subscription_notice_shown",{}),{key:"switch-to-subscription",jsx:(0,NTn.jsxs)(_,{color:"suggestion",children:["Use your existing Claude ",e," plan with Claude Code",(0,NTn.jsxs)(_,{color:"text",dimColor:!0,children:[" ","\xB7 /login to activate"]})]}),priority:"low"})})}async function gJi(){if(to())return null;let e=await eKn();return e?e.account.has_claude_max?"Max":e.account.has_claude_pro?"Pro":null:null}var NTn,fJi,wIo=S(()=>{sme();Cr();Xe();vt();mn();Gae();NTn=U(Z()),fJi=3;s(CIo,"useCanSwitchToExistingSubscription");s(gJi,"getExistingClaudeSubscription")});function kIo(e){if(!("text"in e))return 1;let t=e.text.match(/^(\d+)/);return t?.[1]?parseInt(t[1],10):1}function hJi(e,t){return RIo(kIo(e)+1)}function RIo(e){return{key:"teammate-spawn",text:e===1?"1 agent spawned":`${e} agents spawned`,priority:"low",timeoutMs:5e3,fold:hJi}}function _Ji(e,t){return IIo(kIo(e)+1)}function IIo(e){return{key:"teammate-shutdown",text:e===1?"1 agent shut down":`${e} agents shut down`,priority:"low",timeoutMs:5e3,fold:_Ji}}function PIo(){let e=gt(o=>o.tasks),{addNotification:t}=ei(),n=(0,nqe.useRef)(new Set),r=(0,nqe.useRef)(new Set);(0,nqe.useEffect)(()=>{if(!ri())for(let[o,i]of Object.entries(e))ch(i)&&(i.status==="running"&&!n.current.has(o)&&(n.current.add(o),t(RIo(1))),i.status==="completed"&&!r.current.has(o)&&(r.current.add(o),t(IIo(1))))},[e,t])}var nqe,OIo=S(()=>{nqe=U(et());St();hA();fr();dO();s(kIo,"parseCount");s(hJi,"foldSpawn");s(RIo,"makeSpawnNotif");s(_Ji,"foldShutdown");s(IIo,"makeShutdownNotif");s(PIo,"useTeammateLifecycleNotification")});function LIo(){let{addNotification:e}=ei(),t=gt(r=>r.fastMode),n=Mr();(0,pPt.useEffect)(()=>{if(!ri()&&ui())return yKn(r=>{r?e({key:NIo,color:"fastMode",priority:"immediate",text:"Fast mode is now available \xB7 /fast to turn on"}):t&&(n(o=>({...o,fastMode:!1})),e({key:NIo,color:"warning",priority:"immediate",text:"Fast mode has been disabled by your organization"}))})},[e,t,n]),(0,pPt.useEffect)(()=>{if(!ri()&&ui())return hKn(r=>{n(o=>({...o,fastMode:!1})),e({key:yJi,color:"warning",priority:"immediate",text:r})})},[e,n]),(0,pPt.useEffect)(()=>{if(ri()||!t)return;let r=AKn((i,a)=>{let l=Ll(i-Date.now(),{hideTrailingZeros:!0}),c=bJi(a,l);e({key:MIo,invalidates:[DIo],text:c,color:"warning",priority:"immediate"})}),o=pKn(()=>{e({key:DIo,invalidates:[MIo],color:"fastMode",text:"Fast limit reset \xB7 now using fast mode",priority:"immediate"})});return()=>{r(),o()}},[e,t])}function bJi(e,t){switch(e){case"overloaded":return`Fast mode overloaded and is temporarily unavailable \xB7 resets in ${t}`;case"rate_limit":return`Fast limit reached and temporarily disabled \xB7 resets in ${t}`}}var pPt,MIo,DIo,NIo,yJi,FIo=S(()=>{pPt=U(et());hA();fr();Mv();kr();St();MIo="fast-mode-cooldown-started",DIo="fast-mode-cooldown-expired",NIo="fast-mode-org-changed",yJi="fast-mode-overage-rejected";s(LIo,"useFastModeNotification");s(bJi,"getCooldownMessage")});function UIo({onRun:e,onCancel:t,reason:n}){let r=(0,mPt.useRef)(!1);return cn("confirm:no",t,{context:"Confirmation"}),(0,mPt.useEffect)(()=>{r.current||(r.current=!0,e())},[e]),(0,Uz.jsxs)(O,{flexDirection:"column",marginTop:1,children:[(0,Uz.jsx)(O,{children:(0,Uz.jsx)(_,{bold:!0,children:"Running feedback capture..."})}),(0,Uz.jsx)(O,{children:(0,Uz.jsxs)(_,{dimColor:!0,children:["Press ",(0,Uz.jsx)(qt,{shortcut:"Esc",action:"cancel"})," anytime"]})}),(0,Uz.jsx)(O,{children:(0,Uz.jsxs)(_,{dimColor:!0,children:["Reason: ",n]})})]})}function BIo(e){return!1;switch(e){case"feedback_survey_bad":return!1;case"feedback_survey_good":return!1;default:return!1}}function $Io(e){return"/issue"}function HIo(e){switch(e){case"feedback_survey_bad":return'You responded "Bad" to the feedback survey';case"feedback_survey_good":return'You responded "Good" to the feedback survey';default:return"Unknown reason"}}var mPt,Uz,jIo=S(()=>{mPt=U(et());Ti();Xe();Gr();Uz=U(Z());s(UIo,"AutoRunIssueNotification");s(BIo,"shouldAutoRunIssue");s($Io,"getAutoRunCommand");s(HIo,"getAutoRunIssueReasonText")});var zIo=S(()=>{});function qIo(){return null}var rY,GIo=S(()=>{du();Xe();rY=U(Z());s(qIo,"IssueFlagBanner")});function vJi(e){for(let t of e){if(t.type!=="assistant")continue;let n=t.message.content;if(Array.isArray(n))for(let r of n){if(r.type!=="tool_use"||!("name"in r))continue;let o=r.name;if(o.startsWith("mcp__"))return!1;if(o===zr){let a=r.input?.command||"";if(SJi.some(l=>l.test(a)))return!1}}}return!0}function TJi(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type!=="user")continue;let r=BV(n);if(r)return EJi.some(o=>o.test(r))}return!1}function WIo(e,t){if(process.env.USER_TYPE!=="ant")return!1;let n=(0,rqe.useRef)(0),r=(0,rqe.useRef)(-1),o=(0,rqe.useMemo)(()=>vJi(e)&&TJi(e),[e]);return r.current===t?!0:Date.now()-n.current<CJi||t<xJi||!o?!1:(n.current=Date.now(),r.current=t,!0)}var rqe,SJi,EJi,xJi,CJi,VIo=S(()=>{rqe=U(et());Nu();Ln();SJi=[/\bcurl\b/,/\bwget\b/,/\bssh\b/,/\bkubectl\b/,/\bsrun\b/,/\bdocker\b/,/\bbq\b/,/\bgsutil\b/,/\bgcloud\b/,/\baws\b/,/\bgit\s+push\b/,/\bgit\s+pull\b/,/\bgit\s+fetch\b/,/\bgh\s+(pr|issue)\b/,/\bnc\b/,/\bncat\b/,/\btelnet\b/,/\bftp\b/],EJi=[/^no[,!]\s/i,/\bthat'?s (wrong|incorrect|not (what|right|correct))\b/i,/\bnot what I (asked|wanted|meant|said)\b/i,/\bI (said|asked|wanted|told you|already said)\b/i,/\bwhy did you\b/i,/\byou should(n'?t| not)? have\b/i,/\byou were supposed to\b/i,/\btry again\b/i,/\b(undo|revert) (that|this|it|what you)\b/i];s(vJi,"isSessionContainerCompatible");s(TJi,"hasFrictionSignal");xJi=3,CJi=1800*1e3;s(WIo,"useIssueFlagBanner")});var wJi,kJi,YIo=S(()=>{wJi=U(et());St();Xe();kJi=U(Z())});function LTn({children:e,mouseTracking:t=!0}){let n=(0,oqe.useContext)(Q6),r=(0,oqe.useContext)(e8);return(0,oqe.useInsertionEffect)(()=>{let o=UA.get(process.stdout);if(r)return r(rDe+"\x1B[2J\x1B[H"+(t?_te:"")),o?.setAltScreenActive(!0,t),()=>{o?.setAltScreenActive(!1),o?.clearTextSelection(),r((t?kW:"")+fge)}},[r,t]),(0,KIo.jsx)(lg,{flexDirection:"column",height:n?.rows??24,width:"100%",flexShrink:0,children:e})}var oqe,KIo,QIo=S(()=>{oqe=U(et());GR();K6();MW();OW();iDe();KIo=U(Z());s(LTn,"AlternateScreen")});function XIo(e,t,n){let r=(0,Qxe.useRef)(!1),o=(0,Qxe.useRef)(n);o.current=n,(0,Qxe.useEffect)(()=>t?e.subscribe(()=>{let a=e.getState(),l=e.hasSelection();if(a?.isDragging){r.current=!1;return}if(!l){r.current=!1;return}if(r.current||!(rt().copyOnSelect??!0))return;let u=e.copySelectionNoClear();if(!u||!u.trim()){r.current=!0;return}r.current=!0,o.current?.(u)}):void 0,[t,e])}function JIo(e){let[t]=qr();(0,Qxe.useEffect)(()=>{e.setSelectionBgColor(mE(t).selectionBg)},[e,t])}var Qxe,ZIo=S(()=>{Qxe=U(et());$fe();mn();F1();s(XIo,"useCopyOnSelect");s(JIo,"useSelectionBgColor")});function jJi(e){return!(e.wheelUp||e.wheelDown||(e.leftArrow||e.rightArrow||e.upArrow||e.downArrow||e.home||e.end||e.pageUp||e.pageDown)&&(e.shift||e.meta||e.super))}function zJi(e){return!e.shift||e.meta?null:e.leftArrow?"left":e.rightArrow?"right":e.upArrow?"up":e.downArrow?"down":e.home?"lineStart":e.end?"lineEnd":null}function nPo(e,t,n){if(!e.xtermJs){if(e.wheelMode&&n-e.time>LJi&&(e.wheelMode=!1,e.burstCount=0,e.mult=e.base),e.pendingFlip){if(e.pendingFlip=!1,t!==e.dir||n-e.time>OJi)return e.dir=t,e.time=n,e.mult=e.base,Math.floor(e.mult);e.wheelMode=!0}let l=n-e.time;if(t!==e.dir&&e.dir!==0)return e.pendingFlip=!0,e.time=n,0;if(e.dir=t,e.time=n,e.wheelMode)if(l<tPo)if(++e.burstCount>=5)e.wheelMode=!1,e.burstCount=0,e.mult=e.base;else return 1;else e.burstCount=0;if(e.wheelMode){let c=Math.pow(.5,l/ePo),u=Math.max(DJi,e.base*2),d=1+(e.mult-1)*c+MJi*c;return e.mult=Math.min(u,d,e.mult+NJi),Math.floor(e.mult)}if(l>RJi)e.mult=e.base;else{let c=Math.max(PJi,e.base*2);e.mult=Math.min(c,e.mult+IJi)}return Math.floor(e.mult)}let r=n-e.time,o=t===e.dir;if(e.time=n,e.dir=t,o&&r<tPo)return 1;if(!o||r>HJi)e.mult=2,e.frac=0;else{let l=Math.pow(.5,r/ePo),c=r>=UJi?BJi:$Ji;e.mult=Math.min(c,1+(e.mult-1)*l+FJi*l)}let i=e.mult+e.frac,a=Math.floor(i);return e.frac=i-a,a}function qJi(){let e=process.env.CLAUDE_CODE_SCROLL_SPEED;if(!e)return 1;let t=parseFloat(e);return Number.isNaN(t)||t<=0?1:Math.min(t,20)}function GJi(e=!1,t=1){return{time:0,mult:t,dir:0,xtermJs:e,frac:0,base:t,pendingFlip:!1,wheelMode:!1,burstCount:0}}function rPo(){let e=IW(),t=qJi();return v(`wheel accel: ${e?"decay (xterm.js)":"window (native)"} \xB7 base=${t} \xB7 TERM_PROGRAM=${process.env.TERM_PROGRAM??"unset"}`),GJi(e,t)}function FTn({scrollRef:e,isActive:t,onScroll:n,isModal:r=!1}){let o=Oge(),{addNotification:i}=ei(),a=(0,sY.useRef)(null);function l(d){let A=brr(),p=d.length,m;switch(A){case"native":m=`copied ${p} chars to clipboard`;break;case"tmux-buffer":m=`copied ${p} chars to tmux buffer \xB7 paste with prefix + ]`;break;case"osc52":m=`sent ${p} chars via OSC 52 \xB7 check terminal clipboard settings if paste fails`;break}i({key:"selection-copied",text:m,color:"suggestion",priority:"immediate",timeoutMs:A==="native"?2e3:4e3})}s(l,"showCopiedToast");function c(){let d=o.copySelection();d&&l(d)}s(c,"copyAndToast");function u(d,A){let p=o.getState();if(!p?.anchor||!p.focus)return;let m=d.getViewportTop(),f=m+d.getViewportHeight()-1;if(p.anchor.row<m||p.anchor.row>f||p.focus.row<m||p.focus.row>f)return;let h=Math.max(0,d.getScrollHeight()-d.getViewportHeight()),b=d.getScrollTop()+d.getPendingDelta(),E=Math.max(0,Math.min(h,b+A))-b;if(E!==0)if(E>0)o.captureScrolledRows(m,m+E-1,"above"),o.shiftSelection(-E,m,f);else{let x=-E;o.captureScrolledRows(f-x+1,f,"below"),o.shiftSelection(x,m,f)}}return s(u,"translateSelectionForJump"),Ur({"scroll:pageUp":s(()=>{let d=e.current;if(!d)return;let A=-Math.max(1,Math.floor(d.getViewportHeight()/2));u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:pageUp"),"scroll:pageDown":s(()=>{let d=e.current;if(!d)return;let A=Math.max(1,Math.floor(d.getViewportHeight()/2));u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:pageDown"),"scroll:lineUp":s(()=>{o.clearSelection();let d=e.current;if(!d||d.getScrollHeight()<=d.getViewportHeight())return!1;a.current??=rPo(),XJi(d,nPo(a.current,-1,performance.now())),n?.(!1,d)},"scroll:lineUp"),"scroll:lineDown":s(()=>{o.clearSelection();let d=e.current;if(!d||d.getScrollHeight()<=d.getViewportHeight())return!1;a.current??=rPo();let A=nPo(a.current,1,performance.now()),p=QJi(d,A);n?.(p,d)},"scroll:lineDown"),"scroll:top":s(()=>{let d=e.current;d&&(u(d,-(d.getScrollTop()+d.getPendingDelta())),d.scrollTo(0),n?.(!1,d))},"scroll:top"),"scroll:bottom":s(()=>{let d=e.current;if(!d)return;let A=Math.max(0,d.getScrollHeight()-d.getViewportHeight());u(d,A-(d.getScrollTop()+d.getPendingDelta())),d.scrollTo(A),d.scrollToBottom(),n?.(!0,d)},"scroll:bottom"),"selection:copy":c},{context:"Scroll",isActive:t}),Ur({"scroll:halfPageUp":s(()=>{let d=e.current;if(!d)return;let A=-Math.max(1,Math.floor(d.getViewportHeight()/2));u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:halfPageUp"),"scroll:halfPageDown":s(()=>{let d=e.current;if(!d)return;let A=Math.max(1,Math.floor(d.getViewportHeight()/2));u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:halfPageDown"),"scroll:fullPageUp":s(()=>{let d=e.current;if(!d)return;let A=-Math.max(1,d.getViewportHeight());u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:fullPageUp"),"scroll:fullPageDown":s(()=>{let d=e.current;if(!d)return;let A=Math.max(1,d.getViewportHeight());u(d,A);let p=oY(d,A);n?.(p,d)},"scroll:fullPageDown")},{context:"Scroll",isActive:t}),Xo((d,A,p)=>{let m=e.current;if(!m)return;let f=ZJi(m,JJi(d,A),h=>u(m,h));f!==null&&(n?.(f,m),p.stopImmediatePropagation())},{isActive:t&&r}),Xo((d,A,p)=>{if(!o.hasSelection())return;if(A.escape){o.clearSelection(),p.stopImmediatePropagation();return}if(A.ctrl&&!A.shift&&!A.meta&&d==="c"){c(),p.stopImmediatePropagation();return}let m=zJi(A);if(m){o.moveFocus(m),p.stopImmediatePropagation();return}jJi(A)&&o.clearSelection()},{isActive:t}),YJi(e,o,t,n),XIo(o,t,l),JIo(o),null}function YJi(e,t,n,r){let o=(0,sY.useRef)(null),i=(0,sY.useRef)(0),a=(0,sY.useRef)(0),l=(0,sY.useRef)(0),c=(0,sY.useRef)(r);c.current=r,(0,sY.useEffect)(()=>{if(!n)return;function u(){i.current=0,o.current&&(clearInterval(o.current),o.current=null)}s(u,"stop");function d(){let f=t.getState(),h=e.current,b=i.current;if(!f?.isDragging||!f.focus||!h||b===0||++l.current>VJi){u();return}if(h.getPendingDelta()!==0)return;let E=h.getViewportTop(),x=E+h.getViewportHeight()-1;if(b<0){if(h.getScrollTop()<=0){u();return}let T=Math.min(fPt,h.getScrollTop());t.captureScrolledRows(x-T+1,x,"below"),t.shiftAnchor(T,0,x),h.scrollBy(-fPt)}else{let T=Math.max(0,h.getScrollHeight()-h.getViewportHeight());if(h.getScrollTop()>=T){u();return}let R=Math.min(fPt,T-h.getScrollTop());t.captureScrolledRows(E,E+R-1,"above"),t.shiftAnchor(-R,E,x),h.scrollBy(fPt)}c.current?.(!1,h)}s(d,"tick");function A(f){a.current=f,i.current!==f&&(u(),i.current=f,l.current=0,d(),i.current===f&&(o.current=setInterval(d,WJi)))}s(A,"start");function p(){let f=e.current;if(!f){u();return}let h=f.getViewportTop(),b=h+f.getViewportHeight()-1,E=t.getState();(!E?.isDragging||E.scrolledOffAbove.length===0&&E.scrolledOffBelow.length===0)&&(a.current=0);let x=KJi(E,h,b,a.current);if(x===0){if(a.current!==0&&E?.focus){let T=E.focus.row<h?-1:E.focus.row>b?1:0;T!==0&&T!==a.current&&(E.scrolledOffAbove=[],E.scrolledOffBelow=[],E.scrolledOffAboveSW=[],E.scrolledOffBelowSW=[],a.current=0)}u()}else A(x)}s(p,"check");let m=t.subscribe(p);return()=>{m(),u(),a.current=0}},[n,e,t])}function KJi(e,t,n,r=0){if(!e?.isDragging||!e.anchor||!e.focus)return 0;let o=e.focus.row,i=o<t?-1:o>n?1:0;return r!==0?i===r?i:0:e.anchor.row<t||e.anchor.row>n?0:i}function oY(e,t){let n=Math.max(0,e.getScrollHeight()-e.getViewportHeight()),r=e.getScrollTop()+e.getPendingDelta()+t;return r>=n?(e.scrollTo(n),e.scrollToBottom(),!0):(e.scrollTo(Math.max(0,r)),!1)}function QJi(e,t){let n=Math.max(0,e.getScrollHeight()-e.getViewportHeight());return e.getScrollTop()+e.getPendingDelta()+t>=n?(e.scrollToBottom(),!0):(e.scrollBy(t),!1)}function XJi(e,t){if(e.getScrollTop()+e.getPendingDelta()-t<=0){e.scrollTo(0);return}e.scrollBy(-t)}function JJi(e,t){if(t.meta)return null;if(!t.ctrl&&!t.shift){if(t.upArrow)return"lineUp";if(t.downArrow)return"lineDown";if(t.home)return"top";if(t.end)return"bottom"}if(t.ctrl){if(t.shift)return null;switch(e){case"u":return"halfPageUp";case"d":return"halfPageDown";case"b":return"fullPageUp";case"f":return"fullPageDown";case"n":return"lineDown";case"p":return"lineUp";default:return null}}let n=e[0];if(!n||e!==n.repeat(e.length))return null;if(n==="G"||n==="g"&&t.shift)return"bottom";if(t.shift)return null;switch(n){case"g":return"top";case"j":return"lineDown";case"k":return"lineUp";case" ":return"fullPageDown";case"b":return"fullPageUp";default:return null}}function ZJi(e,t,n){switch(t){case null:return null;case"lineUp":case"lineDown":{let r=t==="lineDown"?1:-1;return n(r),oY(e,r)}case"halfPageUp":case"halfPageDown":{let r=Math.max(1,Math.floor(e.getViewportHeight()/2)),o=t==="halfPageDown"?r:-r;return n(o),oY(e,o)}case"fullPageUp":case"fullPageDown":{let r=Math.max(1,e.getViewportHeight()),o=t==="fullPageDown"?r:-r;return n(o),oY(e,o)}case"top":return n(-(e.getScrollTop()+e.getPendingDelta())),e.scrollTo(0),!1;case"bottom":{let r=Math.max(0,e.getScrollHeight()-e.getViewportHeight());return n(r-(e.getScrollTop()+e.getPendingDelta())),e.scrollTo(r),e.scrollToBottom(),!0}}}var sY,RJi,IJi,PJi,OJi,MJi,DJi,NJi,LJi,ePo,FJi,tPo,UJi,BJi,$Ji,HJi,fPt,WJi,VJi,oPo=S(()=>{sY=U(et());hA();ZIo();Alt();PW();By();Xe();Gr();it();RJi=40,IJi=.3,PJi=6,OJi=200,MJi=15,DJi=15,NJi=3,LJi=1500,ePo=150,FJi=5,tPo=5,UJi=80,BJi=3,$Ji=6,HJi=500;s(jJi,"shouldClearSelectionOnKey");s(zJi,"selectionFocusMoveForKey");s(nPo,"computeWheelStep");s(qJi,"readScrollSpeedBase");s(GJi,"initWheelAccel");s(rPo,"initAndLogWheelAccel");fPt=2,WJi=50,VJi=200;s(FTn,"ScrollKeybindingHandler");s(YJi,"useDragToScroll");s(KJi,"dragScrollDirection");s(oY,"jumpBy");s(QJi,"scrollDown");s(XJi,"scrollUp");s(JJi,"modalPagerAction");s(ZJi,"applyModalPagerAction")});var uPo={};Bt(uPo,{REPL:()=>BTn});import{dirname as eZi,join as tZi}from"path";import{tmpdir as nZi}from"os";import{writeFile as rZi}from"fs/promises";import{randomUUID as sqe}from"crypto";function iPo({showAllInTranscript:e,virtualScroll:t,searchBadge:n,suppressShowAll:r=!1,status:o}){let i=Xi("app:toggleTranscript","Global","ctrl+o"),a=Xi("transcript:toggleShowAll","Transcript","ctrl+e");return(0,gr.jsxs)(O,{noSelect:!0,alignItems:"center",alignSelf:"center",borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",marginTop:1,paddingLeft:2,width:"100%",children:[(0,gr.jsxs)(_,{dimColor:!0,children:["Showing detailed transcript \xB7 ",i," to toggle",n?" \xB7 n/N to navigate":t?` \xB7 ${Ze.arrowUp}${Ze.arrowDown} scroll \xB7 home/end top/bottom`:r?"":` \xB7 ${a} to ${e?"collapse":"show all"}`]}),o?(0,gr.jsxs)(gr.Fragment,{children:[(0,gr.jsx)(O,{flexGrow:1}),(0,gr.jsxs)(_,{children:[o," "]})]}):n?(0,gr.jsxs)(gr.Fragment,{children:[(0,gr.jsx)(O,{flexGrow:1}),(0,gr.jsxs)(_,{dimColor:!0,children:[n.current,"/",n.count," "]})]}):null]})}function AZi({jumpRef:e,count:t,current:n,onClose:r,onCancel:o,setHighlight:i,initialQuery:a}){let{query:l,cursorOffset:c}=PO({isActive:!0,initialQuery:a,onExit:s(()=>r(l),"onExit"),onCancel:o}),[u,d]=um.useState("building");um.useEffect(()=>{let f=!0,h=e.current?.warmSearchIndex;if(!h){d(null);return}return d("building"),h().then(b=>{f&&(b<20?d(null):(d({ms:b}),setTimeout(()=>f&&d(null),2e3)))}),()=>{f=!1}},[]);let A=u!=="building";(0,Vt.useEffect)(()=>{A&&(e.current?.setSearchQuery(l),i(l))},[l,A]);let p=c,m=p<l.length?l[p]:" ";return(0,gr.jsxs)(O,{borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",marginTop:1,paddingLeft:2,width:"100%",noSelect:!0,children:[(0,gr.jsx)(_,{children:"/"}),(0,gr.jsx)(_,{children:l.slice(0,p)}),(0,gr.jsx)(_,{inverse:!0,children:m}),p<l.length&&(0,gr.jsx)(_,{children:l.slice(p+1)}),(0,gr.jsx)(O,{flexGrow:1}),u==="building"?(0,gr.jsx)(_,{dimColor:!0,children:"indexing\u2026 "}):u?(0,gr.jsxs)(_,{dimColor:!0,children:["indexed in ",u.ms,"ms "]}):t===0&&l?(0,gr.jsx)(_,{color:"error",children:"no matches "}):t>0?(0,gr.jsxs)(_,{dimColor:!0,children:[n,"/",t," "]}):null]})}function cPo({isAnimating:e,title:t,disabled:n,noPrefix:r}){let o=Pm(),[i,a]=(0,Vt.useState)(0);(0,Vt.useEffect)(()=>{if(n||r||!e||!o)return;let c=setInterval(u=>u(d=>(d+1)%aPo.length),pZi,a);return()=>clearInterval(c)},[n,r,e,o]);let l=e?aPo[i]??lPo:lPo;return flt(n?null:r?t:`${l} ${t}`),null}function BTn({commands:e,debug:t,initialTools:n,initialMessages:r,pendingHookMessages:o,initialFileHistorySnapshots:i,initialContentReplacements:a,initialAgentName:l,initialAgentColor:c,mcpClients:u,dynamicMcpConfig:d,autoConnectIdeFlag:A,strictMcpConfig:p=!1,systemPrompt:m,appendSystemPrompt:f,onBeforeQuery:h,onTurnComplete:b,disabled:E=!1,mainThreadAgentDefinition:x,disableSlashCommands:T=!1,taskListId:R,remoteSessionConfig:I,directConnectConfig:M,sshSession:N,thinkingConfig:F}){let D=!!I,L=(0,Vt.useMemo)(()=>qe(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE),[]),B=(0,Vt.useMemo)(()=>!1,[]),z=(0,Vt.useMemo)(()=>qe(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),G=!1;(0,Vt.useEffect)(()=>(v(`[REPL:mount] REPL mounted, disabled=${E}`),()=>v("[REPL:unmount] REPL unmounting")),[E]);let[H,W]=(0,Vt.useState)(x),Y=gt(at=>at.toolPermissionContext),K=gt(at=>at.verbose),ee=gt(at=>at.mcp),ge=gt(at=>at.plugins),fe=gt(at=>at.agentDefinitions),de=gt(at=>at.fileHistory),oe=gt(at=>at.initialMessage),ae=Rz(),Se=gt(at=>at.spinnerTip),Me=gt(at=>at.expandedView)==="tasks",Te=gt(at=>at.pendingWorkerRequest),Ie=gt(at=>at.pendingSandboxRequest),xe=gt(at=>at.teamContext),re=gt(at=>at.tasks),te=gt(at=>at.workerSandboxPermissions),ue=gt(at=>at.elicitation),Ae=gt(at=>at.ultraplanPendingChoice),ie=gt(at=>at.ultraplanLaunchPending),be=gt(at=>at.viewingAgentTaskId),Pe=Mr(),Re=be?re[be]:void 0,Ue=n_(Re)&&Re.retain&&!Re.diskLoaded;(0,Vt.useEffect)(()=>{if(!be||!Ue)return;let at=be;aQ(at).then(Rt=>{Pe(Ht=>{let Fn=Ht.tasks[at];if(!n_(Fn)||Fn.diskLoaded||!Fn.retain)return Ht;let dr=Fn.messages??[],Dr=new Set(dr.map(Ho=>Ho.uuid)),vr=Rt?Rt.messages.filter(Ho=>!Dr.has(Ho.uuid)):[];return{...Ht,tasks:{...Ht.tasks,[at]:{...Fn,messages:[...vr,...dr],diskLoaded:!0}}}})})},[be,Ue,Pe]);let Ee=Uu(),De=t8(),ke=vE(),[tt,Ne]=(0,Vt.useState)(e);hko(D?void 0:Xc(),Ne);let nt=um.useSyncExternalStore(sPo?.subscribeToProactiveChanges??aZi,sPo?.isProactiveActive??lZi),ct=gt(at=>at.isBriefOnly),Qe=(0,Vt.useMemo)(()=>UE(Y),[Y,nt,ct]);QOr(),XOr();let[$e,Ge]=(0,Vt.useState)(d),pe=(0,Vt.useCallback)(at=>{Ge(at)},[Ge]),[ve,Ce]=(0,Vt.useState)("prompt"),[Ve,Je]=(0,Vt.useState)(!1),[Ye,ot]=(0,Vt.useState)(!1),[ft,ce]=(0,Vt.useState)(""),je=(0,Vt.useRef)(0),me=(0,Vt.useRef)(void 0),we=(0,Vt.useRef)(!1),{addNotification:Ke,removeNotification:dt}=ei(),Tt=cZi,tn=dko(u,ee.clients),[On,Tr]=(0,Vt.useState)(void 0),[Qr,Cs]=(0,Vt.useState)(null),[Er,$n]=(0,Vt.useState)(null),[Ao,xt]=(0,Vt.useState)(!1),[fn,cr]=(0,Vt.useState)(()=>!1),[gn,Nr]=(0,Vt.useState)(()=>Hko(ke)),bo=gt(at=>at.showRemoteCallout),[Dn,Nn]=(0,Vt.useState)(()=>_Ro());TIo(),CIo(),SIo({ideSelection:On,mcpClients:tn,ideInstallationStatus:Er}),NRo({mcpClients:tn}),FRo(),oIo(),iIo(),tCt(),fIo(ke),LIo(),hIo(ke),yIo(),sZi(),rRo(),lRo(),ARo(),BRo(),PIo();let{recommendation:So,handleResponse:Ls}=QRo(),{recommendation:Co,handleResponse:Bs}=eIo(),fi=(0,Vt.useMemo)(()=>[...Qe,...n],[Qe,n]);UIt({enabled:!D});let vc=A1r();(0,Vt.useEffect)(()=>{D||dIo(Pe)},[Pe,D]),fRo(D?UTn:tn,Y.mode),Swo(Pe,r,{enabled:!D});let zo=Gwt(fi,ee.tools,Y),{tools:Tc,allowedAgentTypes:eu}=(0,Vt.useMemo)(()=>{if(!H)return{tools:zo,allowedAgentTypes:void 0};let at=FV(H,zo,!1,!0);return{tools:at.resolvedTools,allowedAgentTypes:at.allowedAgentTypes}},[H,zo]),yp=iTn(tt,ge.commands),Rr=iTn(yp,ee.commands),ii=(0,Vt.useMemo)(()=>T?[]:Rr,[T,Rr]);ESo(D?UTn:ee.clients),Sko(D?UTn:ee.clients,Tr);let[kl,Wr]=(0,Vt.useState)("responding"),$p=(0,Vt.useRef)(kl);$p.current=kl;let[Kl,Kd]=(0,Vt.useState)([]),[zc,Qd]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{if(zc&&!zc.isStreaming&&zc.streamingEndedAt){let Rt=3e4-(Date.now()-zc.streamingEndedAt);if(Rt>0){let Ht=setTimeout(Qd,Rt,null);return()=>clearTimeout(Ht)}else Qd(null)}},[zc]);let[Oi,al]=(0,Vt.useState)(null),XA=(0,Vt.useRef)(null);XA.current=Oi;let Eu=(0,Vt.useRef)(()=>{}),wd=(0,Vt.useRef)(()=>{}),Rl=(0,Vt.useRef)(null),xc=(0,Vt.useRef)(null),rd=(0,Vt.useRef)(0),ti=um.useRef(new fRt).current,Il=um.useSyncExternalStore(ti.subscribe,ti.getSnapshot),[yi,od]=um.useState(I?.hasInitialPrompt??!1),Os=Il||yi,[$i,Cc]=um.useState(void 0),Pl=um.useRef(0),wc=um.useRef(!1),ta=um.useRef(0),Hu=um.useRef(0),Ql=um.useRef(null),Vm=um.useCallback(()=>{ta.current=Date.now(),Hu.current=0,Ql.current=null},[]),vu=um.useRef(!1);Il&&!vu.current&&Vm(),vu.current=Il;let kd=um.useCallback(at=>{od(at),at&&Vm()},[Vm]),Xl=um.useRef(null),tu=um.useRef(void 0),Xt=um.useRef(void 0),hr=1500,[po,Lo]=um.useState(!1),[Lr,as]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{Lr?.notifications&&Lr.notifications.forEach(at=>{Ke({key:"auto-updater-notification",text:at,priority:"low"})})},[Lr,Ke]),(0,Vt.useEffect)(()=>{cs()&&nZn().then(at=>{at&&Ke({key:"tmux-mouse-hint",text:at,priority:"low"})})},[]);let[ml,Hi]=(0,Vt.useState)(!1);(0,Vt.useEffect)(()=>{},[]);let[Hr,$s]=(0,Vt.useState)(null),Tu=(0,Vt.useRef)(null),ai=(0,Vt.useCallback)(at=>{if(at?.isLocalJSXCommand){let{clearLocalJSX:Rt,...Ht}=at;Tu.current={...Ht,isLocalJSXCommand:!0},$s(Ht);return}if(Tu.current){if(at?.clearLocalJSX){Tu.current=null,$s(null);return}return}if(at?.clearLocalJSX){$s(null);return}$s(at)},[]),[Es,Fa]=(0,Vt.useState)([]),[Gs,nu]=(0,Vt.useState)(null),[Wa,Mi]=(0,Vt.useState)([]),[ji,ru]=(0,Vt.useState)([]),Va=(0,Vt.useRef)(new Map),ju=gt(at=>at.settings.terminalTitleFromRename)!==!1?cT(Et()):void 0,[zu,Sh]=(0,Vt.useState)(),kA=(0,Vt.useRef)((r?.length??0)>0),uy=H?.agentType,dm=ju??uy??zu??"Clavue",Hp=Es.length>0||ji.length>0||Te||Ie,JA=Hr?.isLocalJSXCommand===!0&&Hr?.jsx!=null,Am=Os&&!Hp&&!JA;(0,Vt.useEffect)(()=>{if(Os&&!Hp&&!JA)return eSo(),()=>tSo()},[Os,Hp,JA]);let pc=Hp||JA?"waiting":Os?"busy":"idle",VC=pc!=="waiting"?void 0:Es.length>0?`approve ${Es[0].tool.name}`:Te?"worker request":Ie?"sandbox request":JA?"dialog open":"input needed";(0,Vt.useEffect)(()=>{},[pc,VC]);let kc=nn("tengu_terminal_sidebar",!1)&&(rt().showStatusInTerminalTab??!1);plt(L||!kc?null:pc),(0,Vt.useEffect)(()=>(L1r(Fa),()=>F1r()),[Fa]);let[Yo,YC]=(0,Vt.useState)(r??[]),Ms=(0,Vt.useRef)(Yo),Jr=(0,Vt.useRef)(!1),wo=(0,Vt.useCallback)(at=>{let Rt=Ms.current,Ht=typeof at=="function"?at(Ms.current):at;if(Ms.current=Ht,Ht.length<Pl.current)Pl.current=0;else if(Ht.length>Rt.length&&wc.current){let Fn=Ht.length-Rt.length;(Rt.length===0||Ht[0]===Rt[0]?Ht.slice(-Fn):Ht.slice(0,Fn)).some(fve)?wc.current=!1:Pl.current=Ht.length}YC(Ht)},[]),aa=(0,Vt.useCallback)(at=>{at!==void 0?(Pl.current=Ms.current.length,wc.current=!0):wc.current=!1,Cc(at)},[]),{dividerIndex:Rd,dividerYRef:C_,onScrollAway:dy,onRepin:Cg,jumpToNew:_b,shiftDivider:RS}=jlo(Yo.length),[yd,Ym]=(0,Vt.useState)(null),ZE=(0,Vt.useRef)(null),yb=(0,Vt.useMemo)(()=>zlo(Yo,Rd),[Rd,Yo.length]),Id=(0,Vt.useCallback)(()=>{Rl.current?.scrollToBottom(),Cg(),Ym(null)},[Cg,Ym]),IS=Yo.at(-1),ZA=IS!=null&&fve(IS);(0,Vt.useEffect)(()=>{ZA&&Id()},[ZA,IS,Id]);let{maybeLoadOlder:jp}=uZi,Ay=(0,Vt.useCallback)((at,Rt)=>{rd.current=Date.now(),at?Cg():dy(Rt)},[Cg,dy,jp,Pe]),Oe=iwo(o,wo),He=(0,Vt.useDeferredValue)(Yo),yt=Yo.length-He.length;yt>0&&v(`[useDeferredValue] Messages deferred by ${yt} (${He.length}\u2192${Yo.length})`);let[on,En]=(0,Vt.useState)(null),[mr,_s]=(0,Vt.useState)(()=>$3t()),gi=(0,Vt.useRef)(mr);gi.current=mr;let Rc=(0,Vt.useRef)(null),Di=(0,Vt.useCallback)(at=>{Tt(gi.current,at)||(gi.current===""&&at!==""&&Date.now()-rd.current>=dZi&&Id(),gi.current=at,_s(at),Lo(at.trim().length>0))},[Lo,Id,Tt]);(0,Vt.useEffect)(()=>{if(mr.trim().length===0)return;let at=setTimeout(Lo,hr,!1);return()=>clearTimeout(at)},[mr]);let[qu,Xd]=(0,Vt.useState)("prompt"),[mc,Cu]=(0,Vt.useState)(),bp=(0,Vt.useCallback)(({slashCommands:at})=>{let Rt=new Set(at);Ne(Ht=>Ht.filter(Fn=>Rt.has(Fn.name)||Cbn.has(Fn)))},[Ne]),[ev,py]=(0,Vt.useState)(sqe()),[zp,kf]=(0,Vt.useState)(new Set),bb=(0,Vt.useRef)(!1),Ci=ICo({config:I,setMessages:wo,setIsLoading:kd,onInit:bp,setToolUseConfirmQueue:Fa,tools:fi,setStreamingToolUses:Kd,setStreamMode:Wr,setInProgressToolUseIDs:kf}),or=MCo({config:M,setMessages:wo,setIsLoading:kd,setToolUseConfirmQueue:Fa,tools:fi}),pm=NCo({session:N,setMessages:wo,setIsLoading:kd,setToolUseConfirmQueue:Fa,tools:fi}),Km=pm.isRemoteMode?pm:or.isRemoteMode?or:Ci,Jd=(0,Vt.useCallback)(async()=>{let{clearConversation:at}=await Promise.resolve().then(()=>(kfn(),pZr));await at({setMessages:wo,readFileState:sv.current,discoveredSkillNames:wg.current,loadedNestedMemoryPaths:MS.current,getAppState:s(()=>Ee.getState(),"getAppState"),setAppState:Pe,setConversationId:py}),kA.current=!1,Sh(void 0),QC.current.clear(),wP.current=0},[wo,Pe,py,Ee]),hP=(0,Vt.useCallback)(async()=>{if(Km.isRemoteMode){if(!await Km.sendMessage("/clear"))return kd(!1),Ke({key:"remote-clear-failed",text:"Unable to clear the remote session. Context was not reset.",priority:"immediate"}),!1;kd(!1)}return await Jd(),!0},[Km,Ke,Jd,kd]),[Zd,Rf]=(0,Vt.useState)({}),[Eh,_P]=(0,Vt.useState)(0),my=(0,Vt.useRef)(0),tv=(0,Vt.useRef)([]),JT=(0,Vt.useCallback)(at=>{let Rt=my.current;if(my.current=at(Rt),my.current>Rt){let Ht=tv.current;if(Ht.length>0){let Fn=Ht.at(-1);Fn.lastTokenTime=Date.now(),Fn.endResponseLength=my.current}}},[]),[eA,na]=(0,Vt.useState)(null),Qm=!(gt(at=>at.settings.prefersReducedMotion)??!1)&&!wrr(),fl=(0,Vt.useCallback)(at=>{Qm&&na(at)},[Qm]),fy=eA&&Qm&&eA.substring(0,eA.lastIndexOf(`
|
|
7768
7768
|
`)+1)||null,[At,pn]=(0,Vt.useState)(0),[ur,ds]=(0,Vt.useState)(null),[Ni,Ol]=(0,Vt.useState)(null),[Pd,tA]=(0,Vt.useState)(null),[mm,gy]=(0,Vt.useState)(!1),[Wk,YL]=(0,Vt.useState)(void 0),[yP,bP]=(0,Vt.useState)(!1),[SP,kB]=(0,Vt.useState)(null),KL=(0,Vt.useRef)(!1),rM=(0,Vt.useRef)(At);rM.current=At;let[RB]=(0,Vt.useState)(()=>({current:Nkr(r,a)})),[Sb,QL]=(0,Vt.useState)(rt().hasAcknowledgedCostThreshold),[IB,XL]=(0,Vt.useState)("INSERT"),[oM,EP]=(0,Vt.useState)(!1),[gl,KC]=(0,Vt.useState)(!1),[If,PB]=(0,Vt.useState)(!1);(0,Vt.useEffect)(()=>{Ae&&oM&&EP(!1)},[Ae,oM]);let fm=Pm(),Xm=(0,Vt.useRef)(fm);Xm.current=fm;let[nA]=qr(),w_=um.useRef(!1),Pf=(0,Vt.useCallback)(()=>{if(w_.current)return;w_.current=!0;let at=Ms.current.slice(wP.current);for(let Rt of uXt(at))QC.current.add(Rt);wP.current=Ms.current.length,SRo({theme:nA,readFileState:sv.current,bashTools:QC.current}).then(async Rt=>{if(Rt){let Ht=await Rt.content({theme:nA});Pe(Fn=>({...Fn,spinnerTip:Ht})),ERo(Rt)}else Pe(Ht=>Ht.spinnerTip===void 0?Ht:{...Ht,spinnerTip:void 0})})},[Pe,nA]),sd=(0,Vt.useCallback)(()=>{kd(!1),aa(void 0),my.current=0,tv.current=[],na(null),Kd([]),ds(null),Ol(null),tA(null),Pf(),LUe(),dvt()},[Pf]),sM=(0,Vt.useMemo)(()=>Woe(re).some(at=>at.status==="running"),[re]);(0,Vt.useEffect)(()=>{if(!sM&&Xl.current!==null){let at=Date.now()-Xl.current,Rt=tu.current;Xl.current=null,tu.current=void 0,wo(Ht=>[...Ht,emn(at,Rt,er(Ht,Kje))])}},[sM,wo]);let nv=(0,Vt.useRef)(!1);(0,Vt.useEffect)(()=>{{if(Y.mode!=="auto"){nv.current=!1;return}if(nv.current||(rt().autoPermissionsNotificationCount??0)>=3)return;let Ht=setTimeout((Fn,dr)=>{Fn.current=!0,kt(Dr=>{let vr=Dr.autoPermissionsNotificationCount??0;return vr>=3?Dr:{...Dr,autoPermissionsNotificationCount:vr+1}}),dr(Dr=>[...Dr,nh(QRt,"warning")])},800,nv,wo);return()=>clearTimeout(Ht)}},[Y.mode,wo]);let OS=(0,Vt.useRef)(!1);(0,Vt.useEffect)(()=>{if(OS.current)return;let at=vf();if(!at?.creationDurationMs||at.usedSparsePaths||at.creationDurationMs<15e3)return;OS.current=!0;let Rt=Math.round(at.creationDurationMs/1e3);wo(Ht=>[...Ht,nh(`Worktree creation took ${Rt}s. For large repos, set \`worktree.sparsePaths\` in .\u0063laude/settings.json to check out only the directories you need \u2014 e.g. \`{"worktree": {"sparsePaths": ["src", "packages/foo"]}}\`.`,"info")])},[wo]);let ZT=(0,Vt.useMemo)(()=>{let at=Yo.findLast(Ht=>Ht.type==="assistant");if(at?.type!=="assistant")return!1;let Rt=at.message.content.filter(Ht=>Ht.type==="tool_use"&&zp.has(Ht.id));return Rt.length>0&&Rt.every(Ht=>Ht.type==="tool_use"&&Ht.name===xne)},[Yo,zp]),{onBeforeQuery:JL,onTurnComplete:vP,render:rv}=VCo({enabled:B,setMessages:wo,inputValue:mr,setInputValue:Di,setToolJSX:ai}),TP=(!Hr||Hr.showSpinner===!0)&&Es.length===0&&ji.length===0&&(Os||$i||sM||jQt()>0)&&!Te&&!ZT&&(!fy||ct),ov=Es.length>0||ji.length>0||Wa.length>0||ue.queue.length>0||te.queue.length>0,iM=Yko(Yo,Os,Eh,"session",ov),ZL=GCo(wo),eF=WIo(Yo,Eh),Vk=(0,Vt.useMemo)(()=>({...iM,handleSelect:s(at=>{XC.current=!1;let Rt=iM.handleSelect(at);at==="bad"&&!Rt&&BIo("feedback_survey_bad")&&(tF("feedback_survey_bad"),XC.current=!0)},"handleSelect")}),[iM]),xP=Jko(Yo,Os,ov,{enabled:!D}),Eb=Qko(Yo,Os,ov,{enabled:!D}),vh=oZi(Yo,Os,ov,Vk.state!=="closed"||xP.state!=="closed"||Eb.state!=="closed");Dko({autoConnectIdeFlag:A,ideToInstallExtension:Qr,setDynamicMcpConfig:Ge,setShowIdeOnboarding:xt,setIDEInstallationState:$n}),IRo(i,de,at=>Pe(Rt=>({...Rt,fileHistory:at})));let CP=(0,Vt.useCallback)(async(at,Rt,Ht)=>{let Fn=performance.now();try{let dr=pyt(Rt.messages),Dr=E2e();await v2e("resume",{getAppState:s(()=>Ee.getState(),"getAppState"),setAppState:Pe,signal:AbortSignal.timeout(Dr),timeoutMs:Dr});let vr=await OE("resume",{sessionId:at,agentType:H?.agentType,model:ke});dr.push(...vr),Ht==="fork"?ZUr(Rt,at):oyt(Rt,at),qze(Rt,Pe),Rt.fileHistorySnapshots&&eyt(Rt);let{agentDefinition:Ho}=jae(Rt.agentSetting,x,fe);W(Ho),Pe(ks=>({...ks,agent:Ho?.agentType})),Pe(ks=>({...ks,standaloneAgentContext:Gze(Rt.agentName,Rt.agentColor)})),Cj(Rt.agentName),aM(dr,Rt.projectPath??Un()),sd(),al(null),py(at);let js=Qan(at);Qbt(),Wce(),hv(at,Rt.fullPath?eZi(Rt.fullPath):null);let{renameRecordingForSession:li}=await Promise.resolve().then(()=>(zze(),Cko));if(await li(),await SL(),S2e(),bz(Rt),kA.current=!0,Sh(void 0),Ht!=="fork")wko(),Wze(Rt.worktreeSession),sae(),xsn({abortController:new AbortController,getAppState:s(()=>Ee.getState(),"getAppState"),setAppState:Pe});else{let ks=vf();ks&&jI(ks)}js&&Iwe(js),RB.current&&Ht!=="fork"&&(RB.current=Pmt(dr,Rt.contentReplacements??[])),wo(()=>dr),ai(null),Di(""),q("tengu_session_resumed",{entrypoint:Ht,success:!0,resume_duration_ms:Math.round(performance.now()-Fn)})}catch(dr){throw q("tengu_session_resumed",{entrypoint:Ht,success:!1}),dr}},[sd,Pe]),[Th]=(0,Vt.useState)(()=>J1(c2)),sv=(0,Vt.useRef)(Th),QC=(0,Vt.useRef)(new Set),wP=(0,Vt.useRef)(0),wg=(0,Vt.useRef)(new Set),MS=(0,Vt.useRef)(new Set),aM=(0,Vt.useCallback)((at,Rt)=>{let Ht=g_e(at,Rt,c2);sv.current=jhe(sv.current,Ht);for(let Fn of uXt(at))QC.current.add(Fn)},[]);(0,Vt.useEffect)(()=>{r&&r.length>0&&(aM(r,Un()),xsn({abortController:new AbortController,getAppState:s(()=>Ee.getState(),"getAppState"),setAppState:Pe}))},[]);let{status:Yk,reverify:kP}=lwo(),[RP,tF]=(0,Vt.useState)(null),XC=(0,Vt.useRef)(!1),[IP,Kk]=(0,Vt.useState)(null),[jz,OB]=(0,Vt.useState)(!1),MB=!Os&&yP;function DB(){if(jz||IP)return;if(mm)return"message-selector";if(po)return;if(Wa[0])return"sandbox-permission";let at=!Hr||Hr.shouldContinueAnimation;if(at&&Es[0])return"tool-permission";if(at&&ji[0])return"prompt";if(at&&te.queue[0])return"worker-sandbox-permission";if(at&&ue.queue[0])return"elicitation";if(at&&MB)return"cost";if(at&&SP)return"idle-return";if(at&&Ao)return"ide-onboarding";if(at&&gn)return"effort-callout";if(at&&bo)return"remote-callout";if(at&&So)return"lsp-recommendation";if(at&&Co)return"plugin-hint";if(at&&Dn)return"desktop-upsell"}s(DB,"getFocusedInputDialog");let Ml=DB(),JC=po&&(Wa[0]||Es[0]||ji[0]||te.queue[0]||ue.queue[0]||MB);Xt.current=Ml,(0,Vt.useEffect)(()=>{if(!Os)return;let at=Ml==="tool-permission",Rt=Date.now();at&&Ql.current===null?Ql.current=Rt:!at&&Ql.current!==null&&(Hu.current+=Rt-Ql.current,Ql.current=null)},[Ml,Os]);let xh=(0,Vt.useRef)(Ml);(0,Vt.useLayoutEffect)(()=>{xh.current==="tool-permission"!==(Ml==="tool-permission")&&Id(),xh.current=Ml},[Ml,Id]);function Qk(){if(Ml!=="elicitation"){if(v(`[onCancel] focusedInputDialog=${Ml} streamMode=${kl}`),ti.forceEnd(),KL.current=!1,eA?.trim()&&wo(at=>[...at,wE({content:eA})]),sd(),Ml==="tool-permission")Es[0]?.onAbort(),Fa([]);else if(Ml==="prompt"){for(let at of ji)at.reject(new Error("Prompt cancelled by user"));ru([]),Oi?.abort("user-cancel")}else Km.isRemoteMode?Km.cancelRequest():Oi?.abort("user-cancel");al(null),vP(Ms.current,!0)}}s(Qk,"onCancel");let V=(0,Vt.useCallback)(()=>{let at=Gdt(mr,0);at&&(Di(at.text),Xd("prompt"),at.images.length>0&&Rf(Rt=>{let Ht={...Rt};for(let Fn of at.images)Ht[Fn.id]=Fn;return Ht}))},[Di,Xd,mr,Rf]),se={setToolUseConfirmQueue:Fa,onCancel:Qk,onAgentsKilled:s(()=>wo(at=>[...at,P7r()]),"onAgentsKilled"),isMessageSelectorVisible:mm||!!oM,screen:ve,abortSignal:Oi?.signal,popCommandFromQueue:V,vimMode:IB,isLocalJSXCommand:Hr?.isLocalJSXCommand,isSearchingHistory:gl,isHelpOpen:If,inputMode:qu,inputValue:mr,streamMode:kl};(0,Vt.useEffect)(()=>{zS()>=5&&!yP&&!Sb&&(q("tengu_cost_threshold_reached",{}),QL(!0),art()&&bP(!0))},[Yo,yP,Sb]);let ze=(0,Vt.useCallback)(async at=>{if(lo()&&iBe()){let Rt=w1r(),Ht=await k1r(at.host,Rt);return new Promise(Fn=>{if(!Ht){Mi(dr=>[...dr,{hostPattern:at,resolvePromise:Fn}]);return}M1r({requestId:Rt,host:at.host,resolve:Fn}),Pe(dr=>({...dr,pendingSandboxRequest:{requestId:Rt,host:at.host}}))})}return new Promise(Rt=>{let Ht=!1;function Fn(dr){Ht||(Ht=!0,Rt(dr))}s(Fn,"resolveOnce"),Mi(dr=>[...dr,{hostPattern:at,resolvePromise:Fn}])})},[Pe,Ee]);(0,Vt.useEffect)(()=>{let at=tr.getSandboxUnavailableReason();if(at){if(tr.isSandboxRequired()){process.stderr.write(`
|
|
7769
7769
|
Error: sandbox required but unavailable: ${at}
|
|
7770
7770
|
sandbox.failIfUnavailable is set \u2014 refusing to start without a working sandbox.
|
|
@@ -8962,4 +8962,4 @@ Usage: claude --remote "your task description"`,()=>si(1));q("tengu_remote_creat
|
|
|
8962
8962
|
`));await Ssn();let{teleportWithProgress:Tu}=await Promise.resolve().then(()=>(rNo(),nNo)),ai=await Tu(ii,be);qwe({sessionId:be}),hr=ai.messages}catch(Hr){Hr instanceof wy?process.stderr.write(Hr.formattedMessage+`
|
|
8963
8963
|
`):(ne(Hr),process.stderr.write(mt.red(`Error: ${We(Hr)}
|
|
8964
8964
|
`))),await si(1)}}}if(Lo){let Hr=Lo;try{let $s=performance.now(),Tu=await xQ(as??Hr,void 0);if(!Tu)return q("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),await $z(ii,`No conversation found with session ID: ${Hr}`);let ai=as?.fullPath??Tu.fullPath;po=await ATn(Tu,{forkSession:!!d.forkSession,sessionIdOverride:Hr,transcriptPath:ai},tu),po.restoredAgentDef&&(zo=po.restoredAgentDef),q("tengu_session_resumed",{entrypoint:"cli_flag",success:!0,resume_duration_ms:Math.round(performance.now()-$s)})}catch($s){q("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),ne($s),await $z(ii,`Failed to resume session ${Hr}`)}}if(G)try{let Hr=await G,$s=er(Hr,Tu=>!Tu.success);$s>0&&process.stderr.write(mt.yellow(`Warning: ${$s}/${Hr.length} file(s) failed to download.
|
|
8965
|
-
`))}catch(Hr){return await $z(ii,`Error downloading files: ${We(Hr)}`)}let Hi=po??(Array.isArray(hr)?{messages:hr,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:zo,initialState:Ql,contentReplacements:void 0}:void 0);Hi?await iqe(ii,{getFpsMetrics:kl,stats:Wr,initialState:Hi.initialState},{...Xl,mainThreadAgentDefinition:Hi.restoredAgentDef??zo,initialMessages:Hi.messages,initialFileHistorySnapshots:Hi.fileHistorySnapshots,initialContentReplacements:Hi.contentReplacements,initialAgentName:Hi.agentName,initialAgentColor:Hi.agentColor},Jae):await w0o(ii,{getFpsMetrics:kl,stats:Wr,initialState:Ql},S3(Un()),{...Xl,initialSearchQuery:Lr,forkSession:d.forkSession,filterByPr:ml})}else{let Xt=Rl&&xc.length===0?Rl:void 0;ps("action_after_hooks");let hr=null,po=hr?[hr,...xc]:xc.length>0?xc:void 0;await iqe(ii,{getFpsMetrics:kl,stats:Wr,initialState:Ql},{...Xl,initialMessages:po,pendingHookMessages:Xt},Jae)}}).version("8.8.62 (Clavue)","-v, --version","Output the version number"),t.option("-w, --worktree [name]","Create a new git worktree for this session (optionally specify a name)"),t.option("--tmux","Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."),$9()&&t.addOption(new pl("--advisor <model>","Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp()),t.addOption(new pl("--enable-auto-mode","Opt in to auto mode")),t.addOption(new pl("--agent-id <id>","Teammate agent ID").hideHelp()),t.addOption(new pl("--agent-name <name>","Teammate display name").hideHelp()),t.addOption(new pl("--team-name <name>","Team name for swarm coordination").hideHelp()),t.addOption(new pl("--agent-color <color>","Teammate UI color").hideHelp()),t.addOption(new pl("--plan-mode-required","Require plan mode before implementation").hideHelp()),t.addOption(new pl("--parent-session-id <id>","Parent session ID for analytics correlation").hideHelp()),t.addOption(new pl("--teammate-mode <mode>",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),t.addOption(new pl("--agent-type <type>","Custom agent type for this teammate").hideHelp()),t.addOption(new pl("--sdk-url <url>","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),t.addOption(new pl("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),t.addOption(new pl("--remote [description]","Create a remote session with the given description").hideHelp()),ps("run_main_options_built");let n=process.argv.includes("-p")||process.argv.includes("--print"),r=process.argv.some(u=>u.startsWith("cc://")||u.startsWith("cc+unix://"));if(n&&!r)return ps("run_before_parse"),await t.parseAsync(process.argv),ps("run_after_parse"),t;let o=t.command("mcp").description("Configure and manage MCP servers").configureHelp(e()).enablePositionalOptions();o.command("serve").description("Start the Clavue MCP server").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:u,verbose:d})=>{let{mcpServeHandler:A}=await Promise.resolve().then(()=>(TX(),vX));await A({debug:u,verbose:d})}),ROo(o),CV()&&POo(o),o.command("remove <name>").description("Remove an MCP server").option("-s, --scope <scope>","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").action(async(u,d)=>{let{mcpRemoveHandler:A}=await Promise.resolve().then(()=>(TX(),vX));await A(u,d)}),o.command("list").description("List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let{mcpListHandler:u}=await Promise.resolve().then(()=>(TX(),vX));await u()}),o.command("get <name>").description("Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async u=>{let{mcpGetHandler:d}=await Promise.resolve().then(()=>(TX(),vX));await d(u)}),o.command("add-json <name> <json>").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").action(async(u,d,A)=>{let{mcpAddJsonHandler:p}=await Promise.resolve().then(()=>(TX(),vX));await p(u,d,A)}),o.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async u=>{let{mcpAddFromDesktopHandler:d}=await Promise.resolve().then(()=>(TX(),vX));await d(u)}),o.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:u}=await Promise.resolve().then(()=>(TX(),vX));await u()});let i=t.command("auth").description("Manage authentication").configureHelp(e());i.command("login").description("Sign in to your Anthropic account").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use direct API billing instead of subscription auth").option("--claudeai","Use Claude subscription (default)").action(async({email:u,sso:d,console:A,claudeai:p})=>{let{authLogin:m}=await Promise.resolve().then(()=>(Doe(),c_t));await m({email:u,sso:d,console:A,claudeai:p})}),i.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").action(async u=>{let{authStatus:d}=await Promise.resolve().then(()=>(Doe(),c_t));await d(u)}),i.command("logout").description("Log out from your Anthropic account").action(async()=>{let{authLogout:u}=await Promise.resolve().then(()=>(Doe(),c_t));await u()});let a=s(()=>new pl("--cowork","Use cowork_plugins directory").hideHelp(),"coworkOption"),l=t.command("plugin").alias("plugins").description("Manage Clavue plugins").configureHelp(e());l.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(a()).action(async(u,d)=>{let{pluginValidateHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(a()).action(async u=>{let{pluginListHandler:d}=await Promise.resolve().then(()=>(VL(),WL));await d(u)});let c=l.command("marketplace").description("Manage Clavue marketplaces").configureHelp(e());if(c.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(a()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .clavue-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(u,d)=>{let{marketplaceAddHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),c.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(a()).action(async u=>{let{marketplaceListHandler:d}=await Promise.resolve().then(()=>(VL(),WL));await d(u)}),c.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(a()).action(async(u,d)=>{let{marketplaceRemoveHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),c.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(a()).action(async(u,d)=>{let{marketplaceUpdateHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(a()).action(async(u,d)=>{let{pluginInstallHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("uninstall <plugin>").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope <scope>","Uninstall from scope: user, project, or local","user").option("--keep-data","Preserve the plugin's persistent data directory (~/.clavue/plugins/data/{id}/)").addOption(a()).action(async(u,d)=>{let{pluginUninstallHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("enable <plugin>").description("Enable a disabled plugin").option("-s, --scope <scope>",`Installation scope: ${LT.join(", ")} (default: auto-detect)`).addOption(a()).action(async(u,d)=>{let{pluginEnableHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope <scope>",`Installation scope: ${LT.join(", ")} (default: auto-detect)`).addOption(a()).action(async(u,d)=>{let{pluginDisableHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("update <plugin>").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope <scope>",`Installation scope: ${Die.join(", ")} (default: user)`).addOption(a()).action(async(u,d)=>{let{pluginUpdateHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),t.command("provider [args...]").allowUnknownOption(!0).description("Open provider setup or run non-interactive provider profile actions").action(async u=>{let d=Array.isArray(u)?u:[];if(d.length>0){let{providerCommandHandler:f}=await Promise.resolve().then(()=>(ale(),ile));await f(d);return}let[{providerSetupHandler:A},{createRoot:p}]=await Promise.all([Promise.resolve().then(()=>(ale(),ile)),Promise.resolve().then(()=>(Xe(),Lge))]),m=await p(V2(!1));await A(m)}),t.command("team [args...]").description("Inspect local agent-team readiness and status").action(async u=>{let{teamCommandHandler:d}=await Promise.resolve().then(()=>(ale(),ile));await d(Array.isArray(u)?u:[])}),t.command("setup-token").description("Set up a long-lived authentication token (requires Claude subscription)").action(async()=>{let[{setupTokenHandler:u},{createRoot:d}]=await Promise.all([Promise.resolve().then(()=>(ale(),ile)),Promise.resolve().then(()=>(Xe(),Lge))]),A=await d(V2(!1));await u(A)}),t.command("agents").description("List configured agents").option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").action(async()=>{let{agentsHandler:u}=await Promise.resolve().then(()=>(CNo(),xNo));await u(),process.exit(0)}),qTt()!=="disabled"){let u=t.command("auto-mode").description("Inspect auto mode classifier configuration");u.command("defaults").description("Print the default auto mode environment, allow, and deny rules as JSON").action(async()=>{let{autoModeDefaultsHandler:d}=await Promise.resolve().then(()=>(YPt(),VPt));d(),process.exit(0)}),u.command("config").description("Print the effective auto mode config as JSON: your settings where set, defaults otherwise").action(async()=>{let{autoModeConfigHandler:d}=await Promise.resolve().then(()=>(YPt(),VPt));d(),process.exit(0)}),u.command("critique").description("Get AI feedback on your custom auto mode rules").option("--model <model>","Override which model is used").action(async d=>{let{autoModeCritiqueHandler:A}=await Promise.resolve().then(()=>(YPt(),VPt));await A(d),process.exit()})}return t.command("doctor").description("Check the health of your Clavue auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let[{doctorHandler:u},{createRoot:d}]=await Promise.all([Promise.resolve().then(()=>(ale(),ile)),Promise.resolve().then(()=>(Xe(),Lge))]),A=await d(V2(!1));await u(A)}),t.command("update").alias("upgrade").description("Check for updates and install if available").action(async()=>{let{update:u}=await Promise.resolve().then(()=>(RNo(),kNo));await u()}),t.command("install [target]").description("Install Clavue native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").action(async(u,d)=>{let{installHandler:A}=await Promise.resolve().then(()=>(ale(),ile));await A(u,d)}),ps("run_before_parse"),await t.parseAsync(process.argv),ps("run_after_parse"),ps("main_after_run"),Mke(),t}async function Soa({hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:o,print:i,outputFormat:a,inputFormat:l,numAllowedTools:c,numDisallowedTools:u,mcpClientCount:d,worktreeEnabled:A,skipWebFetchPreflight:p,githubActionInputs:m,dangerouslySkipPermissionsPassed:f,permissionMode:h,modeIsBypass:b,allowDangerouslySkipPermissionsPassed:E,systemPromptFlag:x,appendSystemPromptFlag:T,thinkingConfig:R,assistantActivationPath:I}){try{q("tengu_init",{entrypoint:"claude",hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:o,print:i,outputFormat:a,inputFormat:l,numAllowedTools:c,numDisallowedTools:u,mcpClientCount:d,worktree:A,skipWebFetchPreflight:p,...m&&{githubActionInputs:m},dangerouslySkipPermissionsPassed:f,permissionMode:h,modeIsBypass:b,inProtectedNamespace:MM(),allowDangerouslySkipPermissionsPassed:E,thinkingType:R.type,...x&&{systemPromptFlag:x},...T&&{appendSystemPromptFlag:T},is_simple:Xa()||void 0,is_coordinator:void 0,...I&&{assistantActivationPath:I},autoUpdatesChannel:yr().autoUpdatesChannel??"latest"})}catch(M){ne(M)}}function Eoa(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(L1)}function voa(e){if(typeof e!="object"||e===null)return{};let t=e,n=t.teammateMode;return{agentId:typeof t.agentId=="string"?t.agentId:void 0,agentName:typeof t.agentName=="string"?t.agentName:void 0,teamName:typeof t.teamName=="string"?t.teamName:void 0,agentColor:typeof t.agentColor=="string"?t.agentColor:void 0,planModeRequired:typeof t.planModeRequired=="boolean"?t.planModeRequired:void 0,parentSessionId:typeof t.parentSessionId=="string"?t.parentSessionId:void 0,teammateMode:n==="auto"||n==="tmux"||n==="in-process"?n:void 0,agentType:typeof t.agentType=="string"?t.agentType:void 0}}var INo,ooa,soa,ioa,aoa,Pxn,Djp,VTn=S(()=>{HF();jzt();r4t();Ufn();WSn();Ia();RAe();mIe();XM();yl();bV();sI();XSn();yL();dPo();Yn();pPo();gyt();U7();R4t();iO();Yye();S2();FE();H9();Bd();_i();zze();Cr();mn();vMe();Kv();Mv();oze();Ln();Zs();X1e();PN();a8();LIt();jt();eTn();hPo();FEt();S6();Yn();vt();pit();St();$A();k0o();K6();WTn();R0o();y2();yE();YTn();vOo();eS();l4();mve();eae();Gb();cSe();TOo();Ot();Bvn();lje();Pa();COo();LA();wt();DTn();To();OG();nE();Hy();qI();hS();JHe();v$e();JR();ZD();TQ();ys();Ynt();Mn();kq();gg();Sbe();kOo();hyt();LN();IOo();OOo();lAn();X_e();yE();sC();t_();GFe();STn();Yse();RN();Lc();MOo();b2();wj();xr();it();Ct();Ir();pp();FHe();OVt();FF();MI();Vze();Cp();Do();St();NOo();FOo();BOo();$Oo();jOo();qOo();WOo();YOo();QOo();JOo();eMo();jvn();nMo();gj();Dne();p_e();pxe();mDe();_E();Hx();iD();Fd();SPt();dg();wTe();Td();Jy();zU();B0();Hee();RC();ps("main_tsx_entry");nYn();y7n();INo=s(()=>(Du(),Qc(D4t)),"getTeammateUtils"),ooa=s(()=>(lon(),Qc(H1r)),"getTeammatePromptAddendum"),soa=s(()=>(joe(),Qc(_on)),"getTeammateModeSnapshot"),ioa=null,aoa=(z4(),Qc(KQ));ps("main_tsx_imports_loaded");s(loa,"logManagedSettings");s(coa,"isBeingDebugged");coa()&&process.exit(1);s(PNo,"logSessionTelemetry");s(uoa,"getCertEnvVarTelemetry");s(doa,"logStartupTelemetry");Pxn=11;s(Aoa,"runMigrations");s(poa,"prefetchSystemContextIfSafe");s(xPt,"startDeferredPrefetches");s(moa,"loadSettingsFromFlag");s(foa,"loadSettingSourcesFromFlag");s(goa,"eagerLoadSettings");s(hoa,"initializeEntrypoint");Djp=Nxt("KAIROS")?{sessionId:void 0,discover:!1}:void 0;s(_oa,"main");s(yoa,"getInputPrompt");s(boa,"run");s(Soa,"logTenguInit");s(Eoa,"resetCursor");s(voa,"extractTeammateOptions")});process.env.COREPACK_ENABLE_AUTO_PIN="0";if(process.env.CLAUDE_CODE_REMOTE==="true"){let e=process.env.NODE_OPTIONS||"";process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:"--max-old-space-size=8192"}async function Toa(){let e=process.argv.slice(2);if(e.length===1&&(e[0]==="--version"||e[0]==="-v"||e[0]==="-V")){console.log("8.8.62 (Clavue)");return}let{profileCheckpoint:t}=await Promise.resolve().then(()=>(HF(),y0n));if(t("cli_entry"),process.argv[2]==="--claude-in-chrome-mcp"){t("cli_claude_in_chrome_mcp_path");let{runClaudeInChromeMcpServer:i}=await Promise.resolve().then(()=>(Men(),Oen));await i();return}else if(process.argv[2]==="--chrome-native-host"){t("cli_chrome_native_host_path");let{runChromeNativeHost:i}=await Promise.resolve().then(()=>(jyo(),Hyo));await i();return}if((e.includes("--tmux")||e.includes("--tmux=classic"))&&(e.includes("-w")||e.includes("--worktree")||e.some(i=>i.startsWith("--worktree=")))){t("cli_tmux_worktree_fast_path");let{enableConfigs:i}=await Promise.resolve().then(()=>(mn(),LXn));i();let{isWorktreeModeEnabled:a}=await Promise.resolve().then(()=>(FEt(),yYr));if(a()){let{execIntoTmuxWorktree:l}=await Promise.resolve().then(()=>(RC(),iyo)),c=await l(e);if(c.handled)return;if(c.error){let{exitWithError:u}=await Promise.resolve().then(()=>(FF(),jPn));u(c.error)}}}e.length===1&&(e[0]==="--update"||e[0]==="--upgrade")&&(process.argv=[process.argv[0],process.argv[1],"update"]),e.includes("--bare")&&(process.env.CLAUDE_CODE_SIMPLE="1");let{startCapturingEarlyInput:r}=await Promise.resolve().then(()=>(vMe(),XJn));r(),t("cli_before_main_import");let{main:o}=await Promise.resolve().then(()=>(VTn(),ONo));t("cli_after_main_import"),await o(),t("cli_after_main_complete")}s(Toa,"main");Toa();
|
|
8965
|
+
`))}catch(Hr){return await $z(ii,`Error downloading files: ${We(Hr)}`)}let Hi=po??(Array.isArray(hr)?{messages:hr,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:zo,initialState:Ql,contentReplacements:void 0}:void 0);Hi?await iqe(ii,{getFpsMetrics:kl,stats:Wr,initialState:Hi.initialState},{...Xl,mainThreadAgentDefinition:Hi.restoredAgentDef??zo,initialMessages:Hi.messages,initialFileHistorySnapshots:Hi.fileHistorySnapshots,initialContentReplacements:Hi.contentReplacements,initialAgentName:Hi.agentName,initialAgentColor:Hi.agentColor},Jae):await w0o(ii,{getFpsMetrics:kl,stats:Wr,initialState:Ql},S3(Un()),{...Xl,initialSearchQuery:Lr,forkSession:d.forkSession,filterByPr:ml})}else{let Xt=Rl&&xc.length===0?Rl:void 0;ps("action_after_hooks");let hr=null,po=hr?[hr,...xc]:xc.length>0?xc:void 0;await iqe(ii,{getFpsMetrics:kl,stats:Wr,initialState:Ql},{...Xl,initialMessages:po,pendingHookMessages:Xt},Jae)}}).version("8.8.64 (Clavue)","-v, --version","Output the version number"),t.option("-w, --worktree [name]","Create a new git worktree for this session (optionally specify a name)"),t.option("--tmux","Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."),$9()&&t.addOption(new pl("--advisor <model>","Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp()),t.addOption(new pl("--enable-auto-mode","Opt in to auto mode")),t.addOption(new pl("--agent-id <id>","Teammate agent ID").hideHelp()),t.addOption(new pl("--agent-name <name>","Teammate display name").hideHelp()),t.addOption(new pl("--team-name <name>","Team name for swarm coordination").hideHelp()),t.addOption(new pl("--agent-color <color>","Teammate UI color").hideHelp()),t.addOption(new pl("--plan-mode-required","Require plan mode before implementation").hideHelp()),t.addOption(new pl("--parent-session-id <id>","Parent session ID for analytics correlation").hideHelp()),t.addOption(new pl("--teammate-mode <mode>",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),t.addOption(new pl("--agent-type <type>","Custom agent type for this teammate").hideHelp()),t.addOption(new pl("--sdk-url <url>","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),t.addOption(new pl("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),t.addOption(new pl("--remote [description]","Create a remote session with the given description").hideHelp()),ps("run_main_options_built");let n=process.argv.includes("-p")||process.argv.includes("--print"),r=process.argv.some(u=>u.startsWith("cc://")||u.startsWith("cc+unix://"));if(n&&!r)return ps("run_before_parse"),await t.parseAsync(process.argv),ps("run_after_parse"),t;let o=t.command("mcp").description("Configure and manage MCP servers").configureHelp(e()).enablePositionalOptions();o.command("serve").description("Start the Clavue MCP server").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:u,verbose:d})=>{let{mcpServeHandler:A}=await Promise.resolve().then(()=>(TX(),vX));await A({debug:u,verbose:d})}),ROo(o),CV()&&POo(o),o.command("remove <name>").description("Remove an MCP server").option("-s, --scope <scope>","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").action(async(u,d)=>{let{mcpRemoveHandler:A}=await Promise.resolve().then(()=>(TX(),vX));await A(u,d)}),o.command("list").description("List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let{mcpListHandler:u}=await Promise.resolve().then(()=>(TX(),vX));await u()}),o.command("get <name>").description("Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async u=>{let{mcpGetHandler:d}=await Promise.resolve().then(()=>(TX(),vX));await d(u)}),o.command("add-json <name> <json>").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").action(async(u,d,A)=>{let{mcpAddJsonHandler:p}=await Promise.resolve().then(()=>(TX(),vX));await p(u,d,A)}),o.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async u=>{let{mcpAddFromDesktopHandler:d}=await Promise.resolve().then(()=>(TX(),vX));await d(u)}),o.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:u}=await Promise.resolve().then(()=>(TX(),vX));await u()});let i=t.command("auth").description("Manage authentication").configureHelp(e());i.command("login").description("Sign in to your Anthropic account").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use direct API billing instead of subscription auth").option("--claudeai","Use Claude subscription (default)").action(async({email:u,sso:d,console:A,claudeai:p})=>{let{authLogin:m}=await Promise.resolve().then(()=>(Doe(),c_t));await m({email:u,sso:d,console:A,claudeai:p})}),i.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").action(async u=>{let{authStatus:d}=await Promise.resolve().then(()=>(Doe(),c_t));await d(u)}),i.command("logout").description("Log out from your Anthropic account").action(async()=>{let{authLogout:u}=await Promise.resolve().then(()=>(Doe(),c_t));await u()});let a=s(()=>new pl("--cowork","Use cowork_plugins directory").hideHelp(),"coworkOption"),l=t.command("plugin").alias("plugins").description("Manage Clavue plugins").configureHelp(e());l.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(a()).action(async(u,d)=>{let{pluginValidateHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(a()).action(async u=>{let{pluginListHandler:d}=await Promise.resolve().then(()=>(VL(),WL));await d(u)});let c=l.command("marketplace").description("Manage Clavue marketplaces").configureHelp(e());if(c.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(a()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .clavue-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(u,d)=>{let{marketplaceAddHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),c.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(a()).action(async u=>{let{marketplaceListHandler:d}=await Promise.resolve().then(()=>(VL(),WL));await d(u)}),c.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(a()).action(async(u,d)=>{let{marketplaceRemoveHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),c.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(a()).action(async(u,d)=>{let{marketplaceUpdateHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(a()).action(async(u,d)=>{let{pluginInstallHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("uninstall <plugin>").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope <scope>","Uninstall from scope: user, project, or local","user").option("--keep-data","Preserve the plugin's persistent data directory (~/.clavue/plugins/data/{id}/)").addOption(a()).action(async(u,d)=>{let{pluginUninstallHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("enable <plugin>").description("Enable a disabled plugin").option("-s, --scope <scope>",`Installation scope: ${LT.join(", ")} (default: auto-detect)`).addOption(a()).action(async(u,d)=>{let{pluginEnableHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope <scope>",`Installation scope: ${LT.join(", ")} (default: auto-detect)`).addOption(a()).action(async(u,d)=>{let{pluginDisableHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),l.command("update <plugin>").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope <scope>",`Installation scope: ${Die.join(", ")} (default: user)`).addOption(a()).action(async(u,d)=>{let{pluginUpdateHandler:A}=await Promise.resolve().then(()=>(VL(),WL));await A(u,d)}),t.command("provider [args...]").allowUnknownOption(!0).description("Open provider setup or run non-interactive provider profile actions").action(async u=>{let d=Array.isArray(u)?u:[];if(d.length>0){let{providerCommandHandler:f}=await Promise.resolve().then(()=>(ale(),ile));await f(d);return}let[{providerSetupHandler:A},{createRoot:p}]=await Promise.all([Promise.resolve().then(()=>(ale(),ile)),Promise.resolve().then(()=>(Xe(),Lge))]),m=await p(V2(!1));await A(m)}),t.command("team [args...]").description("Inspect local agent-team readiness and status").action(async u=>{let{teamCommandHandler:d}=await Promise.resolve().then(()=>(ale(),ile));await d(Array.isArray(u)?u:[])}),t.command("setup-token").description("Set up a long-lived authentication token (requires Claude subscription)").action(async()=>{let[{setupTokenHandler:u},{createRoot:d}]=await Promise.all([Promise.resolve().then(()=>(ale(),ile)),Promise.resolve().then(()=>(Xe(),Lge))]),A=await d(V2(!1));await u(A)}),t.command("agents").description("List configured agents").option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").action(async()=>{let{agentsHandler:u}=await Promise.resolve().then(()=>(CNo(),xNo));await u(),process.exit(0)}),qTt()!=="disabled"){let u=t.command("auto-mode").description("Inspect auto mode classifier configuration");u.command("defaults").description("Print the default auto mode environment, allow, and deny rules as JSON").action(async()=>{let{autoModeDefaultsHandler:d}=await Promise.resolve().then(()=>(YPt(),VPt));d(),process.exit(0)}),u.command("config").description("Print the effective auto mode config as JSON: your settings where set, defaults otherwise").action(async()=>{let{autoModeConfigHandler:d}=await Promise.resolve().then(()=>(YPt(),VPt));d(),process.exit(0)}),u.command("critique").description("Get AI feedback on your custom auto mode rules").option("--model <model>","Override which model is used").action(async d=>{let{autoModeCritiqueHandler:A}=await Promise.resolve().then(()=>(YPt(),VPt));await A(d),process.exit()})}return t.command("doctor").description("Check the health of your Clavue auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let[{doctorHandler:u},{createRoot:d}]=await Promise.all([Promise.resolve().then(()=>(ale(),ile)),Promise.resolve().then(()=>(Xe(),Lge))]),A=await d(V2(!1));await u(A)}),t.command("update").alias("upgrade").description("Check for updates and install if available").action(async()=>{let{update:u}=await Promise.resolve().then(()=>(RNo(),kNo));await u()}),t.command("install [target]").description("Install Clavue native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").action(async(u,d)=>{let{installHandler:A}=await Promise.resolve().then(()=>(ale(),ile));await A(u,d)}),ps("run_before_parse"),await t.parseAsync(process.argv),ps("run_after_parse"),ps("main_after_run"),Mke(),t}async function Soa({hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:o,print:i,outputFormat:a,inputFormat:l,numAllowedTools:c,numDisallowedTools:u,mcpClientCount:d,worktreeEnabled:A,skipWebFetchPreflight:p,githubActionInputs:m,dangerouslySkipPermissionsPassed:f,permissionMode:h,modeIsBypass:b,allowDangerouslySkipPermissionsPassed:E,systemPromptFlag:x,appendSystemPromptFlag:T,thinkingConfig:R,assistantActivationPath:I}){try{q("tengu_init",{entrypoint:"claude",hasInitialPrompt:e,hasStdin:t,verbose:n,debug:r,debugToStderr:o,print:i,outputFormat:a,inputFormat:l,numAllowedTools:c,numDisallowedTools:u,mcpClientCount:d,worktree:A,skipWebFetchPreflight:p,...m&&{githubActionInputs:m},dangerouslySkipPermissionsPassed:f,permissionMode:h,modeIsBypass:b,inProtectedNamespace:MM(),allowDangerouslySkipPermissionsPassed:E,thinkingType:R.type,...x&&{systemPromptFlag:x},...T&&{appendSystemPromptFlag:T},is_simple:Xa()||void 0,is_coordinator:void 0,...I&&{assistantActivationPath:I},autoUpdatesChannel:yr().autoUpdatesChannel??"latest"})}catch(M){ne(M)}}function Eoa(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(L1)}function voa(e){if(typeof e!="object"||e===null)return{};let t=e,n=t.teammateMode;return{agentId:typeof t.agentId=="string"?t.agentId:void 0,agentName:typeof t.agentName=="string"?t.agentName:void 0,teamName:typeof t.teamName=="string"?t.teamName:void 0,agentColor:typeof t.agentColor=="string"?t.agentColor:void 0,planModeRequired:typeof t.planModeRequired=="boolean"?t.planModeRequired:void 0,parentSessionId:typeof t.parentSessionId=="string"?t.parentSessionId:void 0,teammateMode:n==="auto"||n==="tmux"||n==="in-process"?n:void 0,agentType:typeof t.agentType=="string"?t.agentType:void 0}}var INo,ooa,soa,ioa,aoa,Pxn,Djp,VTn=S(()=>{HF();jzt();r4t();Ufn();WSn();Ia();RAe();mIe();XM();yl();bV();sI();XSn();yL();dPo();Yn();pPo();gyt();U7();R4t();iO();Yye();S2();FE();H9();Bd();_i();zze();Cr();mn();vMe();Kv();Mv();oze();Ln();Zs();X1e();PN();a8();LIt();jt();eTn();hPo();FEt();S6();Yn();vt();pit();St();$A();k0o();K6();WTn();R0o();y2();yE();YTn();vOo();eS();l4();mve();eae();Gb();cSe();TOo();Ot();Bvn();lje();Pa();COo();LA();wt();DTn();To();OG();nE();Hy();qI();hS();JHe();v$e();JR();ZD();TQ();ys();Ynt();Mn();kq();gg();Sbe();kOo();hyt();LN();IOo();OOo();lAn();X_e();yE();sC();t_();GFe();STn();Yse();RN();Lc();MOo();b2();wj();xr();it();Ct();Ir();pp();FHe();OVt();FF();MI();Vze();Cp();Do();St();NOo();FOo();BOo();$Oo();jOo();qOo();WOo();YOo();QOo();JOo();eMo();jvn();nMo();gj();Dne();p_e();pxe();mDe();_E();Hx();iD();Fd();SPt();dg();wTe();Td();Jy();zU();B0();Hee();RC();ps("main_tsx_entry");nYn();y7n();INo=s(()=>(Du(),Qc(D4t)),"getTeammateUtils"),ooa=s(()=>(lon(),Qc(H1r)),"getTeammatePromptAddendum"),soa=s(()=>(joe(),Qc(_on)),"getTeammateModeSnapshot"),ioa=null,aoa=(z4(),Qc(KQ));ps("main_tsx_imports_loaded");s(loa,"logManagedSettings");s(coa,"isBeingDebugged");coa()&&process.exit(1);s(PNo,"logSessionTelemetry");s(uoa,"getCertEnvVarTelemetry");s(doa,"logStartupTelemetry");Pxn=11;s(Aoa,"runMigrations");s(poa,"prefetchSystemContextIfSafe");s(xPt,"startDeferredPrefetches");s(moa,"loadSettingsFromFlag");s(foa,"loadSettingSourcesFromFlag");s(goa,"eagerLoadSettings");s(hoa,"initializeEntrypoint");Djp=Nxt("KAIROS")?{sessionId:void 0,discover:!1}:void 0;s(_oa,"main");s(yoa,"getInputPrompt");s(boa,"run");s(Soa,"logTenguInit");s(Eoa,"resetCursor");s(voa,"extractTeammateOptions")});process.env.COREPACK_ENABLE_AUTO_PIN="0";if(process.env.CLAUDE_CODE_REMOTE==="true"){let e=process.env.NODE_OPTIONS||"";process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:"--max-old-space-size=8192"}async function Toa(){let e=process.argv.slice(2);if(e.length===1&&(e[0]==="--version"||e[0]==="-v"||e[0]==="-V")){console.log("8.8.64 (Clavue)");return}let{profileCheckpoint:t}=await Promise.resolve().then(()=>(HF(),y0n));if(t("cli_entry"),process.argv[2]==="--claude-in-chrome-mcp"){t("cli_claude_in_chrome_mcp_path");let{runClaudeInChromeMcpServer:i}=await Promise.resolve().then(()=>(Men(),Oen));await i();return}else if(process.argv[2]==="--chrome-native-host"){t("cli_chrome_native_host_path");let{runChromeNativeHost:i}=await Promise.resolve().then(()=>(jyo(),Hyo));await i();return}if((e.includes("--tmux")||e.includes("--tmux=classic"))&&(e.includes("-w")||e.includes("--worktree")||e.some(i=>i.startsWith("--worktree=")))){t("cli_tmux_worktree_fast_path");let{enableConfigs:i}=await Promise.resolve().then(()=>(mn(),LXn));i();let{isWorktreeModeEnabled:a}=await Promise.resolve().then(()=>(FEt(),yYr));if(a()){let{execIntoTmuxWorktree:l}=await Promise.resolve().then(()=>(RC(),iyo)),c=await l(e);if(c.handled)return;if(c.error){let{exitWithError:u}=await Promise.resolve().then(()=>(FF(),jPn));u(c.error)}}}e.length===1&&(e[0]==="--update"||e[0]==="--upgrade")&&(process.argv=[process.argv[0],process.argv[1],"update"]),e.includes("--bare")&&(process.env.CLAUDE_CODE_SIMPLE="1");let{startCapturingEarlyInput:r}=await Promise.resolve().then(()=>(vMe(),XJn));r(),t("cli_before_main_import");let{main:o}=await Promise.resolve().then(()=>(VTn(),ONo));t("cli_after_main_import"),await o(),t("cli_after_main_complete")}s(Toa,"main");Toa();
|
package/dist/mao-command.js
CHANGED
|
@@ -1617,7 +1617,7 @@ async function ensureMaoRuntime(cwd, requestedModel = null) {
|
|
|
1617
1617
|
const profile = resolveActiveProfile()
|
|
1618
1618
|
if (!profile) {
|
|
1619
1619
|
throw new Error(
|
|
1620
|
-
'No active
|
|
1620
|
+
'No active Clavue provider profile is available. Use `/provider` or run `clavue provider`, then retry `/mao`.',
|
|
1621
1621
|
)
|
|
1622
1622
|
}
|
|
1623
1623
|
|
|
@@ -1628,8 +1628,8 @@ async function ensureMaoRuntime(cwd, requestedModel = null) {
|
|
|
1628
1628
|
probe.status === 404
|
|
1629
1629
|
? 'The active provider does not expose `/v1/responses` for `/mao`.'
|
|
1630
1630
|
: probe.status === 401 || probe.status === 403
|
|
1631
|
-
? 'The active
|
|
1632
|
-
: 'The active
|
|
1631
|
+
? 'The active Clavue provider credential was rejected by `/v1/responses`.'
|
|
1632
|
+
: 'The active Clavue provider did not pass the `/v1/responses` preflight check.'
|
|
1633
1633
|
throw new Error(
|
|
1634
1634
|
`${prefix}\nProfile: ${profile.name}\nModel: ${model}\nDetail: ${probe.message}\nNext step: switch to a Responses-capable profile via \`/provider\`, or pass a different \`--model\` to \`/mao\`.`,
|
|
1635
1635
|
)
|
|
@@ -1654,12 +1654,12 @@ async function buildSetupReport(cwd, requestedModel = null) {
|
|
|
1654
1654
|
|
|
1655
1655
|
if (!codex.available) {
|
|
1656
1656
|
nextSteps.push(
|
|
1657
|
-
'Reinstall or update `
|
|
1657
|
+
'Reinstall or update `clavue` so the bundled Codex runtime is present.',
|
|
1658
1658
|
)
|
|
1659
1659
|
}
|
|
1660
1660
|
if (!profile) {
|
|
1661
|
-
nextSteps.push('Activate a
|
|
1662
|
-
nextSteps.push('If you have not configured one yet, run `
|
|
1661
|
+
nextSteps.push('Activate a Clavue provider profile with `/provider`.')
|
|
1662
|
+
nextSteps.push('If you have not configured one yet, run `clavue provider`.')
|
|
1663
1663
|
} else if (probe && !probe.ok) {
|
|
1664
1664
|
nextSteps.push(
|
|
1665
1665
|
'Switch `/provider` to a Responses-capable GPT route before using `/mao`.',
|
|
@@ -2212,8 +2212,8 @@ function buildHelpText() {
|
|
|
2212
2212
|
return [
|
|
2213
2213
|
'Usage: /mao [setup|review|adversarial-review|task|rescue|status|result|cancel] ...',
|
|
2214
2214
|
'',
|
|
2215
|
-
'First-party Codex runtime owned by
|
|
2216
|
-
'Auth and provider config come only from the active
|
|
2215
|
+
'First-party Codex runtime owned by Clavue.',
|
|
2216
|
+
'Auth and provider config come only from the active Clavue provider profile. No separate `codex login` flow or standalone Codex install is used here.',
|
|
2217
2217
|
'Use `/mao` as the canonical command. `/codex` remains available only as a compatibility alias.',
|
|
2218
2218
|
'',
|
|
2219
2219
|
'Examples:',
|
package/dist/provider-command.js
CHANGED
|
@@ -190,8 +190,8 @@ function buildValidationGuidance(profile, validation, routeMatrix) {
|
|
|
190
190
|
) {
|
|
191
191
|
return [
|
|
192
192
|
'Guidance:',
|
|
193
|
-
'- This gateway is currently verified for native
|
|
194
|
-
'- One or more non-primary slots are degraded here.
|
|
193
|
+
'- This gateway is currently verified for native Clavue workflows on gpt-5.4.',
|
|
194
|
+
'- One or more non-primary slots are degraded here. Run `clavue provider` and choose reconfigure to switch the full slot routing back to gpt-5.4.',
|
|
195
195
|
]
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -199,7 +199,7 @@ function buildValidationGuidance(profile, validation, routeMatrix) {
|
|
|
199
199
|
return [
|
|
200
200
|
'Guidance:',
|
|
201
201
|
'- The provider can answer chat requests, but some native workflows may still degrade on the current routing.',
|
|
202
|
-
'-
|
|
202
|
+
'- Run `clavue provider` to adjust the active profile and model slots, then rerun `clavue provider validate`.',
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -428,12 +428,7 @@ function buildValidationGuidanceWithCommands(profile, validation, routeMatrix, c
|
|
|
428
428
|
return guidance.map(line =>
|
|
429
429
|
line
|
|
430
430
|
.replace(/`\/provider validate`/g, `\`${commandPrefix} validate\``)
|
|
431
|
-
.replace(
|
|
432
|
-
/`myclaude provider`/g,
|
|
433
|
-
commandPrefix === 'myclaude provider'
|
|
434
|
-
? '`myclaude provider`'
|
|
435
|
-
: '`myclaude provider`',
|
|
436
|
-
),
|
|
431
|
+
.replace(new RegExp('`my' + 'claude provider`', 'g'), '`clavue provider`'),
|
|
437
432
|
)
|
|
438
433
|
}
|
|
439
434
|
|
|
@@ -502,7 +497,7 @@ export async function call(args, context) {
|
|
|
502
497
|
return {
|
|
503
498
|
type: 'text',
|
|
504
499
|
value:
|
|
505
|
-
commandPrefix === '
|
|
500
|
+
commandPrefix === 'clavue provider'
|
|
506
501
|
? 'No provider profiles are configured yet. Run `clavue provider` with no arguments to create one.'
|
|
507
502
|
: 'No provider profiles are configured yet. Run `clavue provider` outside the session to create one.',
|
|
508
503
|
}
|
package/dist/provider-setup.js
CHANGED
|
@@ -7,8 +7,8 @@ import { createInterface } from 'node:readline/promises'
|
|
|
7
7
|
import { stdin, stdout } from 'node:process'
|
|
8
8
|
import { fileURLToPath } from 'node:url'
|
|
9
9
|
|
|
10
|
-
const APP_VERSION = '8.8.
|
|
11
|
-
const APP_NPM_PACKAGE_NAME = '
|
|
10
|
+
const APP_VERSION = '8.8.64'
|
|
11
|
+
const APP_NPM_PACKAGE_NAME = 'clavue'
|
|
12
12
|
export const CURRENT_PROVIDER_PROFILE_ID = '__current_provider__'
|
|
13
13
|
const SUPPORTED_LANGUAGES = new Set(['en', 'zh'])
|
|
14
14
|
const PROVIDER_CAPABILITY_CACHE_TTL_MS = 60 * 60 * 1000
|