@fungi.computer/spore 0.17.1 → 0.17.3
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/THIRD_PARTY_NOTICES
CHANGED
|
@@ -589,7 +589,7 @@ SOFTWARE.
|
|
|
589
589
|
|
|
590
590
|
---
|
|
591
591
|
|
|
592
|
-
@fungi.computer/agar 0.
|
|
592
|
+
@fungi.computer/agar 0.23.0, @fungi.computer/almanac 0.2.1, @fungi.computer/approvals 0.2.4, @fungi.computer/bird-dog 0.3.7, @fungi.computer/cairn 0.1.0, @fungi.computer/carrier 0.2.5, @fungi.computer/cli-version 0.0.2, @fungi.computer/cordyceps 0.4.3, @fungi.computer/corral 0.1.43, @fungi.computer/gills 0.4.0, @fungi.computer/graft 0.2.37, @fungi.computer/knapsack 0.4.20, @fungi.computer/lantern 0.4.2, @fungi.computer/maosaico 0.1.2, @fungi.computer/mule 0.3.0, @fungi.computer/mycelium 0.4.7, @fungi.computer/nacre 0.8.3, @fungi.computer/parakeet 0.14.2, @fungi.computer/puffball 0.12.0, @fungi.computer/seam 0.2.6, @fungi.computer/shiitake 0.21.2, @fungi.computer/shiitake-extensions 0.11.12, @fungi.computer/spore 0.17.3, @fungi.computer/sprite 0.2.2, @fungi.computer/stipe 0.1.1, @fungi.computer/truffle 0.16.2, @fungi.computer/veil 0.8.2, @fungi.computer/watchdog 0.1.4, @fungi.computer/whistle 0.3.0, @fungi.computer/zookeeper 0.0.44
|
|
593
593
|
|
|
594
594
|
MIT License
|
|
595
595
|
|
package/dist/cli.js
CHANGED
|
@@ -2247,7 +2247,7 @@ ${l.stderr.trim()}`);await hAt(r),e(`fungi updated ${n.version} \u2192 ${a}.`)}a
|
|
|
2247
2247
|
`)),...e.language===void 0?{}:{filetype:e.language},fg:i.foreground,syntaxStyle:o,selectionBg:i.selection,selectionFg:i.selectionForeground,wrapMode:"word"}),je(iZ,{hidden:a,presentation:r})]})}}}function sar(e,t,n=!1){let{colors:r}=t,i=zpt(e,n);return i==="neutral"?r.foreground:r[i]}function LCt({caption:e,tone:t,open:n,presentation:r}){let i=Kge-4;return Gn("text",{selectable:!1,fg:r.colors.foreground,wrapMode:"none",width:e===void 0?3:Kge,flexShrink:0,children:[e===void 0?null:Gn("span",{attributes:2,children:[gc(e,i).padStart(i)," "]}),je("span",{fg:t,children:"\u25CF "}),je("span",{attributes:2,children:n===void 0?" ":n?"\u25BE":"\u25B8"})]})}function aar(e){return e===void 0?"":` \xB7 ${Bpt(e)}`}function tar({call:e,disclosureId:t,disclosure:n,nested:r,terminalWidth:i,inset:o,toggle:s,presentation:a}){let{colors:c}=a,u=qY()?.[e.kind],l=iDe(e),d=bN(n,t,l),p=e.status==="running",f=i-2*o-(r?6:4)-(kp-2);return Gn("box",{flexShrink:0,children:[Gn("box",{flexDirection:"row",height:1,onMouseDown:(m)=>{m.preventDefault(),s(t,l)},children:[Gn("text",{selectable:!1,fg:c.foreground,wrapMode:"none",flexGrow:1,flexShrink:1,marginLeft:-1,children:[je(WY,{glyph:u}),je("span",{attributes:1,children:br(p?e.activeVerb:e.verb)})," ",MCt(br(e.label),Math.max(0,i-2*o-Kge-kp-3-Rv(p?e.activeVerb:e.verb)-(e.exitCode===void 0?0:Rv(` \xB7 exit ${String(e.exitCode)}`)))),e.exitCode===void 0?null:je("span",{fg:e.recovered===!0?c.foreground:c.error,children:` \xB7 exit ${String(e.exitCode)}`})]}),je(LCt,{caption:aar(e.durationMs).replace(/^ \u00B7 /u,""),tone:sar(e.status,a,e.recovered===!0),open:d,presentation:a})]}),d?Gn("box",{marginLeft:kp,marginTop:1,children:[e.error===void 0?null:je("text",{fg:e.recovered===!0?c.foreground:c.error,marginBottom:1,children:br(e.error)}),e.sections.map((m,h)=>je(syo,{section:m,full:n.mode==="expanded",presentation:a,width:f},`${m.kind}:${String(h)}`))]}):null,e.live===void 0?null:je("box",{marginLeft:kp,flexShrink:0,children:jpt(e,d).map((m,h)=>je("text",{fg:c.foreground,attributes:2,height:1,wrapMode:"none",children:br(m)},String(h)))})]})}function ayo({group:e,disclosure:t,inset:n,terminalWidth:r,toggle:i,presentation:o}){let{colors:s}=o,a=qY(),c=rDe(e),u=bN(t,e.id,c),l=e.status==="running"?e.active:void 0,d=a?.search,p=e.status==="completed",f=e.calls.length===1?e.calls[0]:void 0;if(f!==void 0)return je("box",{id:tO(e.id),flexShrink:0,marginBottom:1,paddingX:n,children:je(tar,{call:f,disclosure:t,disclosureId:f.id,inset:n,nested:!1,presentation:o,terminalWidth:r,toggle:i})});let m=je("box",{children:Hpt(e,u).map((h)=>je(tar,{call:h,disclosure:t,disclosureId:h.id,inset:n,nested:!0,presentation:o,terminalWidth:r,toggle:i},h.id))});return Gn("box",{id:tO(e.id),flexShrink:0,marginBottom:1,paddingX:n,children:[Gn("box",{flexDirection:"row",height:1,onMouseDown:(h)=>{h.preventDefault(),i(e.id,c)},children:[Gn("text",{selectable:!1,fg:s.foreground,wrapMode:"none",flexGrow:1,flexShrink:1,marginLeft:-1,children:[je(WY,{glyph:d}),l===void 0?null:Gn("span",{attributes:1,children:[br(l.activeVerb)," "]}),MCt(br((l===void 0?e.summary:l.label)+` \xB7 ${String(e.calls.length)} ${e.calls.length===1?"call":"calls"}`+(e.failedCount>0?` \xB7 ${String(e.failedCount)} failed`:"")+(e.recoveredCount>0?` \xB7 ${String(e.recoveredCount)} recovered`:"")),Math.max(0,r-2*n-Kge-2-kp-(l===void 0?0:Rv(l.activeVerb)+1)))]}),je(LCt,{caption:aar(e.durationMs).replace(/^ \u00B7 /u,""),tone:sar(e.status,o),open:u,presentation:o})]}),m,p&&e.calls.length>3?je("text",{marginLeft:kp,height:1,selectable:!1,fg:s.foreground,onMouseDown:(h)=>{h.preventDefault(),i(e.id,c)},children:u?"Show less":`Show all ${String(e.calls.length)} calls`}):null]})}function cyo(e,t){return t===null?"compacted \xB7 the agent's memory starts below":`compacted ${a9(e)} \u2192 ${a9(t)}`}function uyo(e,t){let n=` ${t} `,r=Math.max(0,e-n.length),i=Math.floor(r/2),o=r-i;return`${"\u2500".repeat(i)}${n}${"\u2500".repeat(o)}`}function lyo({id:e,inset:t,terminalWidth:n,presentation:r,tokensBefore:i,tokensAfter:o}){return je("box",{id:tO(e),flexShrink:0,marginTop:1,marginBottom:1,paddingX:t,children:je("text",{fg:r.colors.foreground,attributes:2,wrapMode:"none",children:uyo(Math.max(0,n-2*t),cyo(i,o))})})}function dyo({id:e,inset:t,presentation:n,result:r,diagnostic:i}){let{colors:o,dimForeground:s}=n,a=i===null?nar[r]:`${nar[r]}: ${$y(i)}`;return je("box",{id:tO(e),flexShrink:0,paddingX:t,height:1,marginBottom:1,children:je("text",{fg:r==="failed"?o.error:s,attributes:2,wrapMode:"none",children:br(`\xB7 ${a}`)})})}function FCt(e){return e.author?.kind==="agent"}function rar(e){return e.kind==="user_message"&&!FCt(e)}function pyo(e,t,n){return t!==void 0&&!n&&rar(e)&&rar(t)}function iar(e,t){let n=e.status==="pending"||e.status==="queued",r=n&&e.delivery==="followUp";return{cue:r,foreground:n?r?t.dimForeground:t.colors.accent:t.colors.foreground}}function fyo({item:e,disclosure:t,inset:n,terminalWidth:r,toggle:i,presentation:o,stacksOnNext:s}){let{colors:a,surface:c}=o,u=qY()?.error,l=qY()?.agent;if(e.kind==="compaction_divider")return je(lyo,{id:e.id,inset:n,terminalWidth:r,presentation:o,tokensBefore:e.tokensBefore,tokensAfter:e.tokensAfter});if(e.kind==="compaction_notice")return je(dyo,{id:e.id,inset:n,presentation:o,result:e.result,diagnostic:e.diagnostic});if(e.kind==="tool_group")return je(ayo,{presentation:o,group:e,disclosure:t,inset:n,terminalWidth:r,toggle:i});if(e.kind==="user_message"&&FCt(e)){let{foreground:p}=iar(e,o),f=bN(t,e.id,!1),m=e.author?.name??"",h=Math.max(0,r-2*n-kp);return Gn("box",{id:tO(e.id),flexShrink:0,marginBottom:1,paddingX:n,children:[je("box",{flexDirection:"row",height:1,onMouseDown:(g)=>{g.preventDefault(),i(e.id,!1)},children:Gn("text",{selectable:!1,fg:a.foreground,wrapMode:"none",flexGrow:1,flexShrink:1,marginLeft:-1,children:[je(WY,{glyph:l}),je("span",{fg:o.dimForeground,attributes:2,children:gc(br(f?m:`${m} \xB7 ${e.text}`),h)})]})}),f?je("text",{marginLeft:kp,fg:p,attributes:e.status==="confirmed"?0:2,selectionBg:a.selection,selectionFg:a.selectionForeground,children:br(e.text)}):null]})}if(e.kind==="user_message"){let{cue:p,foreground:f}=iar(e,o);return je("box",{id:tO(e.id),flexDirection:"row",flexShrink:0,marginBottom:s?0:1,backgroundColor:c,paddingX:n,paddingY:1,children:je("text",{marginLeft:kp,flexGrow:1,flexShrink:1,fg:f,attributes:e.status==="confirmed"?1:2,...p?{wrapMode:"none"}:{},selectionBg:a.selection,selectionFg:a.selectionForeground,children:p?gc(br(e.text),Math.max(0,r-2*n-kp)):br(e.text)})})}if(!iN(e))return null;let d=e.repeatCount===void 0?e.text:`${e.text} x${String(e.repeatCount)}`;return Gn("box",{id:tO(e.id),flexShrink:0,marginBottom:1,paddingX:n,children:[e.thinking?je("box",{marginLeft:kp,marginBottom:e.text?1:0,children:je("text",{fg:a.foreground,attributes:2,children:bN(t,e.id,!1)?br(e.thinking):"Thinking"})}):null,e.text?Gn("box",{flexDirection:"row",children:[e.isError?je("text",{width:ULe,marginLeft:-1,flexShrink:0,selectable:!1,wrapMode:"none",children:je(WY,{glyph:u})}):je("text",{width:kp,flexShrink:0,fg:a.info,wrapMode:"none",children:c7(e.pending?"\u25CF":"")}),je("box",{flexGrow:1,flexShrink:1,children:e.isError&&e.providerError!==void 0?je("text",{fg:a.error,wrapMode:"word",children:br(d)}):je(FTt,{content:d,presentation:o,foreground:e.isError?a.error:a.foreground,streaming:e.pending})}),e.isError&&e.providerError===void 0?je(LCt,{tone:a.error,presentation:o}):null]}):null,e.isError&&e.errorDetail?je("box",{marginLeft:kp,children:je("text",{fg:a.foreground,attributes:2,children:br(e.errorDetail)})}):null,e.isError&&e.providerError!==void 0&&bN(t,e.id,!1)?Gn("box",{marginLeft:kp,flexDirection:"column",children:[je("text",{fg:a.error,children:"Provider details (latest response)"}),je("text",{fg:a.error,children:br(e.providerError)})]}):null]})}function hyo(e,t){let n=e.viewport.y,r=n+e.viewport.height;return e.getChildren().filter((o)=>o.id.startsWith(Jge)&&t.has(o.id.slice(Jge.length))&&o.y+o.height>n&&o.y<r).at(-1)?.id.slice(Jge.length)}function gyo(e,t,n){if(n==="older"){let o=Math.max(0,e.start-Qsr),s=Math.min(e.end,o+Xsr);return{start:o,end:s}}let r=Math.min(t,e.end+Qsr);return{start:Math.max(e.start,r-Xsr),end:r}}function _yo({emptyState:e,detailsRequest:t,groupRequest:n,inputEnabled:r,presentation:i,sessionAddress:o,terminalWidth:s}){let a=EU(),c=kU(),u=KT(),l=JT(),d=ys(()=>TU(l,a.commandAnchors,a.positionAnchors),[l,a.commandAnchors,a.positionAnchors]),{rendering:p}=kf(),f=1,m=Or(null),[h,g]=ti(()=>AB(a.settled.length)),_=Or(!0),y=_.current?AB(a.settled.length):Ysr(h,a.settled.length),x=Or(y);x.current=y;let w=Or(a.settled.length);w.current=a.settled.length;let[b,E]=ti(!1),A=Or(!1),R=Or(void 0),F=Or(void 0),z=Or(void 0),U=Or(!1),[V,ee]=ti(Wpt),oe=Or(t);oe.current=t;let ue=Or(t),be=Or(n);be.current=n;let _e=Or(n),q=zc((J)=>{if(A.current===J)return;A.current=J,E(J)},[]),K=zc(()=>{let J=m.current;if(J!==null)R.current=NCt(J)},[]),X=zc(()=>{if(U.current||z.current!==void 0)return;let J=m.current;if(J===null)return;let te=J.scrollTop>=Math.max(0,J.scrollHeight-J.viewport.height-1),ve=x.current.end===w.current;if(te&&ve){_.current=!0,R.current=void 0,q(!1);let ce=AB(w.current);if(!Zsr(x.current,ce))g(ce);return}if(_.current)return;_.current=!1,q(!0),K()},[K,q]),Y=zc((J,te)=>{let ve=m.current;if(ve===null||F.current!==void 0)return!1;let ce=x.current,de={anchor:NCt(ve),movement:te,previousHeight:ve.scrollHeight,previousTop:ve.scrollTop};if(J==="older"&&ce.start===0){if(!a.hasMoreHistory||a.loadingOlderHistory)return!1;return z.current={direction:J,change:de},a.loadOlderHistory(),!0}if(J==="newer"&&ce.end===w.current){if(!a.hasNewerHistory||a.loadingOlderHistory)return!1;return z.current={direction:J,change:de},a.loadNewerHistory(),!0}let Se=gyo(ce,w.current,J);if(Zsr(ce,Se))return!1;return F.current=de,_.current=!1,q(!0),g(Se),!0},[a,q]);Vn(()=>{let J=AB(w.current);_.current=!0,R.current=void 0,F.current=void 0,z.current=void 0,q(!1),g(J),ue.current=oe.current,_e.current=be.current},[o,q]),Vn(()=>{if(_.current){g(AB(a.settled.length));return}let J=z.current;if(J!==void 0){if(a.loadingOlderHistory)return;z.current=void 0,F.current=J.change,g(J.direction==="older"?{start:0,end:Math.min(oar,a.settled.length)}:AB(a.settled.length));return}g((te)=>Ysr(te,a.settled.length))},[a.loadingOlderHistory,a.settled]),Vn(()=>{if(ue.current===t)return;ue.current=t,K(),ee(Vpt)},[K,t]),Eh(()=>{let J=2,te,ve=()=>{if(J-=1,J>0){te=p.afterFrame(ve),p.requestFrame();return}let ce=m.current;if(ce===null)return;U.current=!0;let de=F.current;if(de!==void 0){if(F.current=void 0,!(de.anchor!==void 0&&ear(ce,de.anchor)))ce.scrollTo(de.previousTop+ce.scrollHeight-de.previousHeight);if(de.movement!==0)ce.scrollBy(de.movement,"viewport");R.current=NCt(ce)}else if(_.current)ce.scrollTo(ce.scrollHeight);else if(R.current!==void 0)ear(ce,R.current);U.current=!1,X()};return te=p.afterFrame(ve),p.requestFrame(),()=>{te?.()}},[V,X,i,p,o,a.settled,a.tail,a.loadingOlderHistory,y.end,y.start,s]);let fe=zc((J,te)=>{K(),ee((ve)=>Gpt(ve,J,te))},[K]);Vn(()=>{if(_e.current===n)return;_e.current=n;let J=m.current,te=new Set(a.settled.filter((de)=>de.kind==="tool_group"||de.kind==="user_message"&&FCt(de)).map((de)=>de.id)),ve=J===null?void 0:hyo(J,te),ce=a.settled.find((de)=>de.id===ve);if(ce?.kind==="user_message")fe(ce.id,!1);if(ce?.kind==="tool_group"){let de=ce.calls.length===1?ce.calls[0]:void 0;fe(de?.id??ce.id,de===void 0?rDe(ce):iDe(de))}},[n,a.settled,fe]),w6((J)=>{if(!r||J.name!=="pageup"&&J.name!=="pagedown")return!1;let te=m.current;if(te===null)return!1;let ve=J.name==="pageup";if(ve)a.pinVisibleHistory(),_.current=!1,q(!0);if(!((ve?te.scrollTop<=te.viewport.height:te.scrollTop>=te.scrollHeight-2*te.viewport.height)&&Y(ve?"older":"newer",ve?-1:1)))te.scrollBy(ve?-1:1,"viewport");return X(),J.preventDefault(),!0});let G=zc((J)=>{let te=m.current,ve=J.scroll?.direction;if(te===null||ve!=="up"&&ve!=="down")return;if(ve==="up")a.pinVisibleHistory(),_.current=!1,q(!0);if(ve==="up"?te.scrollTop<=te.viewport.height:te.scrollTop>=te.scrollHeight-2*te.viewport.height)Y(ve==="up"?"older":"newer",0);X()},[X,Y,a,q]),Z=zc((J)=>{let te=m.current;if(te===null||J.x<te.x+te.width-2)return;a.pinVisibleHistory(),_.current=!1,q(!0)},[a,q]),le=zc(()=>{let J=m.current;a.jumpToLatest(),z.current=void 0,_.current=!0,R.current=void 0,q(!1),g(AB(w.current)),J?.scrollTo(J.scrollHeight)},[a,q]),Pe=ys(()=>a.settled.slice(y.start,y.end),[a.settled,y.end,y.start]),xe=ys(()=>y.end===a.settled.length?[...Pe,...a.tail]:Pe,[a.settled.length,a.tail,y.end,Pe]),Le=ys(()=>xe.map((J,te)=>Gn(LIe,{children:[je(myo,{stacksOnNext:pyo(J,xe[te+1],(d.after.get(J.id)?.length??0)>0),presentation:i,item:J,disclosure:V,inset:1,terminalWidth:s,toggle:fe},J.id),d.after.get(J.id)?.map(({entryId:ve,cell:ce})=>je(nZ,{id:tO(JSON.stringify([ve,ce.id])),rows:ce.rows,presentation:i},JSON.stringify([ve,ce.id])))]},J.id)),[V,i,s,fe,xe,d]);return Gn("box",{flexGrow:1,flexShrink:1,minHeight:0,paddingTop:1,children:[Gn("scrollbox",{ref:m,flexGrow:1,flexShrink:1,minHeight:0,stickyScroll:!0,stickyStart:"bottom",scrollX:!1,onMouseDown:Z,onMouseScroll:G,contentOptions:{minHeight:0},scrollbarOptions:{showArrows:!1,onChange:X,trackOptions:{foregroundColor:i.colors.surface,backgroundColor:i.colors.background}},children:[u.observation.status==="unavailable"?Gn("text",{fg:i.colors.error,marginX:1,children:[c7("\u25CF"),br(u.observation.reason)," \xB7 /reconnect to retry"]}):null,y.start===0?d.before.map(({entryId:J,cell:te})=>je(nZ,{id:tO(JSON.stringify([J,te.id])),rows:te.rows,presentation:i},JSON.stringify([J,te.id]))):null,xe.length===0&&d.before.length===0&&!a.hasMoreHistory?Gn("box",{flexDirection:"column",marginX:1,children:[je("text",{fg:i.colors.foreground,attributes:2,children:"Start a conversation."}),je("text",{fg:i.colors.foreground,attributes:2,children:br(`Model: ${e.model??"No model selected"}`)}),e.folder===void 0?null:je("text",{fg:i.colors.foreground,attributes:2,children:br(`Folder: ${e.folder}`)}),e.signInRequired?je("text",{fg:i.colors.info,children:"Sign in to start: type /login"}):null]}):je(yk,{children:Le})]}),u.viewState.kind==="error"?Gn("box",{flexDirection:"column",flexShrink:0,paddingX:1,children:[je("text",{fg:i.colors.error,flexShrink:0,width:"100%",wrapMode:"word",children:br(`Stopped: ${$y(u.viewState.cause)}`)}),je("text",{fg:i.colors.info,flexShrink:0,width:"100%",wrapMode:"word",children:e.signInRequired&&u.viewState.cause.startsWith("model:rejected:")?"/login \xB7 sign in, then send your message again":c.failure==="admission"?"/retry \xB7 or edit and submit the draft":"/retry \xB7 /continue \xB7 or type a new instruction"})]}):null,b?je("text",{flexShrink:0,height:1,wrapMode:"none",bg:i.colors.background,fg:i.colors.info,marginX:1,onMouseDown:(J)=>{J.preventDefault(),le()},children:"Jump to latest \u2193"}):null]})}var oar=60,Qsr=60,Xsr=240,Jge="tui-timeline-row:",nar,myo,car;var uar=C(async()=>{Bc();Gi();bf();ZB();await Pc([Qa(),Ksr(),Qa(),OCt(),Qa(),Qa(),Qa(),Qa()]);nar={nothing_to_compact:"nothing to compact",failed:"compaction failed",stale:"compaction skipped: the context moved on",insufficient:"compaction skipped: the summary would not fit"};myo=HK(fyo);car=HK(_yo)});function lar(e){let{observation:t,reconnect:n,onObservationUnavailable:r,rebindService:i,timing:o=xyo,clock:s=yyo,lastReplyAt:a}=e,[c,u]=ti(),[l,d]=ti(!1);return Vn(()=>{if(t==="unavailable")d(!0);else if(t==="live")d(!1)},[t]),Vn(()=>{if(!l)return;let p=new AbortController,f=()=>!p.signal.aborted,m,h,g,_=a===void 0||a===0?s.now():a,y=Math.max(0,s.now()-_),x=y>=o.appearAfterMs,w=y>=o.stuckAfterMs,b=()=>{u(g!==void 0?{phase:"incompatible",message:g}:!x?void 0:w?{phase:"stuck",alive:h,seconds:Math.max(0,Math.floor((s.now()-_)/1000)),lastError:m}:{phase:"restarting"})},E=0,A,R=async()=>{try{let oe=await r?.();if(!f()||oe)return;let ue=await i?.(p.signal);if(!f())return;if(ue?.kind==="unavailable")m=void 0,h=ue.alive;else{if(ue?.kind==="rebound")h=!0;let be=await n();if(be.kind==="reconnected"||!f())return;m=be.kind==="failed"?be.cause:void 0}}catch(oe){if(Ai("session-observation-recovery",oe),!f())return;if(oe instanceof Error&&(oe.name==="LocalServiceUpdated"||oe.name==="LocalServiceIncompatible")){g=oe.message,z(),U(),b();return}m=oe instanceof Error?oe.message:String(oe)}b(),F()};function F(){let oe=Math.min(o.firstAttemptAfterMs*2**E,o.maxRetryDelayMs),ue=Math.min(o.maxRetryDelayMs,oe*(0.8+0.4*s.random()));E+=1,A=s.schedule(()=>{R()},ue)}F();let z=s.schedule(()=>{x=!0,b()},Math.max(0,o.appearAfterMs-y)),U=s.schedule(()=>{x=!0,w=!0,b()},Math.max(0,o.stuckAfterMs-y)),V=()=>{if(!f())return;if(w)b();ee=s.schedule(V,1000)},ee=s.schedule(V,1000);return()=>{p.abort(),z(),U(),A?.(),ee(),u(void 0)}},[l,n,r,i,o,s,a]),c}function dar({view:e,colors:t,viewport:n,onClose:r}){let i=e.phase==="incompatible"?{title:"Can't use the service",summary:e.message}:e.phase==="restarting"?{title:"Reconnecting to the service",summary:"Your conversation will resume."}:{title:e.alive===!1?"The service stopped":`The service is busy (no reply for ${String(e.seconds)}s)`,summary:e.alive===!1?"Run `fungi resume` in another terminal. This conversation keeps trying and keeps your draft.":"Your conversation will resume; your draft is kept.",facts:e.lastError===void 0?[]:[{label:"Error",value:e.lastError}]};return je(jY,{colors:t,onClose:r,children:je(Z_,{content:i,colors:t,width:K1(n.width),compact:n.height<14,full:!0})})}var yyo,xyo;var par=C(async()=>{Bc();Gi();await Qa();yyo={now:Date.now,random:Math.random,schedule(e,t){let n=setTimeout(e,t);return()=>{clearTimeout(n)}}},xyo={firstAttemptAfterMs:250,appearAfterMs:1000,stuckAfterMs:30000,maxRetryDelayMs:30000}});import{ScrollBoxRenderable as vtc}from"@opentui/core";function vyo(e){Ai("mcp-approval-answer",e)}function mar({session:e,draftIdentity:t,...n}){let r=RA(),i=zc(({action:o,...s})=>{r.show(o===void 0?s:{...s,action:{label:o.label,run:o.onSelect}})},[r]);return je(uft,{session:e,draftStorage:DSt,draftIdentity:t,clients:n.clients,interactionStore:n.interactionStore,authorOf:yR,onToast:i,children:je(Eyo,{...n,session:e})})}function Qge({color:e,inset:t,children:n,oneLine:r=!1}){return Gn("box",{flexDirection:"row",marginX:t,children:[je("text",{width:kp,flexShrink:0,fg:e,children:c7("\u25CF")}),je("text",{flexGrow:1,flexShrink:1,fg:e,wrapMode:r?"none":"word",children:n})]})}function Eyo({commands:e,interactionStore:t,mcpApprovals:n,applicationCommands:r,onExit:i,onStopAll:o,session:s,onOpen:a,initialTheme:c="terminal",onThemeConfirm:u=dge,themeError:l,modelSource:d,sandboxSource:p,folder:f,onTitled:m,reloadSources:h,onResume:g,onNew:_,onForked:y,inputHandoff:x,onObservationUnavailable:w,onRebindService:b,initialCommandError:E,initialCommandNotice:A}){let R=Eut(),F=kf();cft(ys(()=>({label:"Add it with /login",onSelect:()=>{e.execute({namespace:"account",id:"login"},{origin:"slash"}).catch((bn)=>{Ai("open-login-from-secret-refusal",bn)})}}),[e]));let z=o===void 0?void 0:async()=>{try{F.toast(Nsr(await o()))}catch(bn){Ai("session-stop-all",bn),F.toast(Lsr(bn))}},U=Q5(),V=ka(F.dialogs.open.subscribe,F.dialogs.open.read),ee={show:F.dialogs.show,dismiss:F.dialogs.dismiss,isOpen:V},oe=kU();Vn(()=>F.sessions.registerDraftCheckpoint?.(s,oe.checkpointDraft),[F.sessions,s,oe.checkpointDraft]);let ue=KT(),be=lft(),_e=JT(),q=EU(),K=ys(()=>TU(_e,q.commandAnchors,q.positionAnchors),[_e,q.commandAnchors,q.positionAnchors]),X=Osr(e,a),Y=_e.flatMap(({entryId:bn,value:xi})=>xi.panel.filter((Xs)=>Xs.tone==="attention"&&(Xs.actions?.length??0)>0).map((Xs)=>({entryId:bn,row:Xs,key:JSON.stringify([bn,Xs.id])}))),fe=(bn)=>bn.actions?.some((xi)=>xi.awaiting!==void 0)===!0,G=Y.filter(({row:bn})=>!fe(bn)),Z=Or(!1),[le,Pe]=ti(null),[xe,Le]=ti(!1),J=Math.max(0,G.findIndex((bn)=>bn.key===le)),te=G[J],ve=xe&&te!==void 0;Vn(()=>{if(G.length===0)Le(!1)},[G.length]),w6((bn)=>{if(ee.isOpen||!U||Z.current)return!1;if(bn.name==="up"&&bn.meta&&te!==void 0)return Le(!0),!0;if(!ve)return!1;if(bn.name==="escape"||bn.name==="down"&&bn.meta)return Le(!1),!0;if(bn.name==="up"||bn.name==="down"){let xi=G[(J+(bn.name==="up"?-1:1)+G.length)%G.length];if(xi!==void 0)Pe(xi.key);return!0}if(bn.name==="return"){let xi=te.row.actions?.[0];if(xi!==void 0)Le(!1),X.execute(te.entryId,xi);return!0}return!1});let ce=lar({observation:ue.observation.status,reconnect:ue.reconnect,onObservationUnavailable:w,rebindService:b,lastReplyAt:be}),[de,Se]=ti(!1);Vn(()=>{if(ce===void 0)Se(!1)},[ce===void 0]);let Oe=ce===void 0?_e:[],he=yTt(ee,{commands:e,initialTheme:c,initialError:l,confirm:u}),{presentation:Re}=he;BTt(Re);let{colors:Ze,surface:nt}=Re,tt=vTt({source:d,commands:e}),{status:kt,refresh:Pt}=OTt({source:p,commands:e,dialog:ee,colors:Ze});Vn(()=>{if(p!==void 0)Pt()},[p,ue.status,ue.commandId,Pt]),Gsr({commands:e,refreshModels:tt.refresh,refreshColors:Re.refresh,hostSources:h});let ct=wft({commands:e,origin:"slash",keys:{scroll:"PgUp/PgDn",queue:"Tab"},busy:far.has(ue.status),interactionStore:t,showCommands:async()=>{let bn=await e.execute({namespace:"shell",id:"command-line"},{origin:"slash"});if(bn.status!=="handled")throw Error(bn.status==="failed"?bn.error.message:"Commands are unavailable.")}}),{store:Ft}=ct,kn=ct.interactions.inspection,Ut=kn===void 0?void 0:_e.find((bn)=>bn.entryId===kn.entryId)?.value.panel.find((bn)=>bn.id===kn.rowId&&bn.inspection!==void 0);Z.current=Ut!==void 0;let Ir=Or(null),lt=Ut?.inspection?.rows,{width:Zt,height:Kn}=$Tt(),[_r,dt]=ti();Eh(()=>{if(lt===void 0)return;let bn=F.rendering.afterFrame(()=>{let xi=Ir.current;if(xi!==null)dt({rows:lt,width:Zt,height:xi.scrollHeight})});return F.rendering.requestFrame(),bn},[F.rendering,lt,Zt]);let Qt=Math.max(1,Math.min(12,Math.floor(Kn/2)-1,_r!==void 0&&_r.rows===lt&&_r.width===Zt?_r.height:lt?.length??1)),gn=[Ut?.inspection?.title,Ut?.detail].filter(Boolean).join(" \xB7 "),In="\u2191/\u2193 scroll \xB7 Esc back to draft";w6((bn)=>{if(!U||ee.isOpen||ct.interactions.open!==void 0||Ut===void 0)return!1;if(bn.name==="escape")return Ft.inspect(void 0),!0;let xi=bn.name==="up"||bn.name==="pageup"?-1:bn.name==="down"||bn.name==="pagedown"?1:0;if(xi===0)return!1;return Ir.current?.scrollBy(xi,bn.name.startsWith("page")?"viewport":"step"),!0}),Vn(()=>{if(E!==void 0)Ft.report({tone:"error",message:E});else if(A!==void 0)Ft.report({tone:"info",message:A})},[E,A,Ft]);let xn=xft(ct.awaiting,oe.draft),nr=Or(void 0),rr=()=>{let bn=nr.current;if(bn===void 0)return!1;return bn(),!0};w6((bn)=>{if(ee.isOpen||!U||Z.current)return!1;if(bn.name==="up"&&bn.meta&&ct.awaiting.total>0)return ct.store.awaiting.focus(),!0;return!1});let zr=Zt-2,Qr={store:ct.store,enabled:U,home:Cnr(),width:zr,noteLimit:i3e,onFailure:vyo};vDe({...Qr,source:n}),vDe({...Qr,source:MTt({session:s,enabled:U})}),RTt({dialog:ee,colors:Ze,slash:ct,inputHandoff:x,enabled:U});let Li=1,wu=Or(oe.draft);wu.current=oe.draft;let Wt=Or(ct);Wt.current=ct;let[_n,Pn]=ti(0),[Vr,qr]=ti(0);Wsr({session:s,commands:e,resume:g,create:_,onForked:y,onTitled:m});let ri=ue.status==="idle"?_e.find(({value:bn})=>bn.waiting!==null):void 0,Wr=q.queued.prompts.length>0||ue.viewState.kind==="queued",lo=ct.interactions.notice,pt=jsr({notice:lo!==void 0,dismissNotice:()=>{Ft.report(void 0)},commandId:ue.commandId,status:ue.status,queued:Wr,waitingLabel:ri?.value.waiting?.cancel.label,interaction:X.selecting?"actions":ee.isOpen||xn!==void 0||ct.interactions.open!==void 0||Ut!==void 0||ct.open?"prompt":null,cancel:oe.cancel,stopAll:z,onCancelFailure:(bn)=>{Ft.report({tone:"error",message:`Cancellation could not reach the session: ${bn instanceof Error?bn.message:String(bn)}. Press Ctrl+C again to exit; you can resume later.`})},cancelWaiting:async()=>{if(!Wr&&ri?.value.waiting!==null&&ri?.value.waiting!==void 0){await X.execute(ri.entryId,ri.value.waiting.cancel,!0);return}await oe.cancel()},exit:i,dismissInteraction:()=>ee.dismiss()||rr()||(ct.open||ct.interactions.open!==void 0||Ut!==void 0)&&Wt.current.dismiss()}),Tt=oe.failure==="failed"||oe.failure==="interrupted"||oe.failure==="admission",vt=ue.viewState.kind==="error"&&oe.failure!=="admission";Bsr({serviceStatusOpen:ce!==void 0,showServiceStatus:()=>{Se(!1)},collapseServiceStatus:()=>{if(ce===void 0||de)return!1;return Se(!0),!0},canCancel:ue.status!=="queued"&&far.has(ue.status),canRetry:Tt,canContinue:vt,commands:e,application:r,cancellation:pt,stopAll:z,reconnect:ue.reconnect,retry:()=>{if(!Tt)return!1;return oe.retry(),!0},continue:async()=>{if(!vt)return!1;return await s.command({type:"prompt",delivery:"followUp",requestId:byo.request.generate(),text:"Continue the previous task. First address the error that stopped it."}),!0},details:()=>{Pn((bn)=>bn+1)},toolGroup:()=>{qr((bn)=>bn+1)}});let ur=Math.max(1,Math.min(6,Math.floor(Kn/3))),jn=pt.pending?{kind:"cancelling"}:ue.viewState,Tr=_e.flatMap(({value:bn},xi)=>bn.chips.map((Xs)=>({chip:Xs,entryOrder:xi}))).sort((bn,xi)=>bn.chip.order-xi.chip.order||bn.entryOrder-xi.entryOrder),to=(Y.length>0||ct.awaiting.total>0)&&(jn.kind==="idle"||jn.kind==="waiting_for_you"),gt=tt.selectedModel??q.model,Nr=gt===void 0?void 0:DZ(gt,tt.selectedReasoning),pe=jkt({width:Zt-2*Li,status:`\u25CF ${S7e(jn,to)}`,compactStatus:`\u25CF ${S7e(jn,to)}`,model:Nr,context:ue.context===void 0?void 0:l9e(ue.context)}),Jr=Nr,mi=tt.signInRequired,Vt=ys(()=>({model:Jr,folder:f,signInRequired:mi}),[Jr,f,mi]),Eo=wyo[jn.kind],Ou=ys(()=>[{slot:"state",order:0,text:pe.statusText,tone:Eo},{slot:"model",order:1,text:pe.modelText,tone:"muted"},...kt===void 0?[]:[{slot:"chips",order:0,text:kt.mode==="full-access"?"full access":kt.mode==="workspace"?"workspace \xB7 sandboxed":"read-only \xB7 sandboxed",tone:kt.available?"muted":"warning"}]],[pe.statusText,pe.modelText,Eo,kt]);return xge(Ou),Gn("box",{position:"relative",backgroundColor:Ze.background,flexDirection:"column",height:"100%",width:"100%",children:[je(car,{emptyState:Vt,detailsRequest:_n,groupRequest:Vr,inputEnabled:U&&!ee.isOpen&&Ut===void 0,presentation:Re,sessionAddress:s.address,terminalWidth:Zt}),Gn("box",{flexShrink:0,children:[ct.open&&!ee.isOpen&&xn===void 0?je(NTt,{slash:ct,colors:Ze,maxRows:ur,width:Zt-2}):null,xn===void 0?null:je(qTt,{item:xn,position:ct.awaiting.position,total:ct.awaiting.total,onLater:()=>{ct.store.awaiting.later(xn.key)},colors:Ze,surface:nt,width:Zt-2*Li,rows:Kn,active:U&&!ee.isOpen,escapeRef:nr},xn.key),Gn("box",{flexDirection:"row",backgroundColor:nt,paddingX:1,paddingY:1,visible:xn===void 0,children:[Gn("text",{fg:Ze.primary,width:2,flexShrink:0,children:["\u203A"," "]}),je(Psr,{focused:U&&!ee.isOpen&&!ve&&xn===void 0,readOnly:oe.recallState.kind==="recalling",inputHandoff:x,maxHeight:ur,colors:Ze,onKeyDown:(bn)=>{let xi=Wt.current;if(U&&!ee.isOpen&&!ve&&!xi.open&&bn.name==="up"&&bn.eventType==="press"&&!bn.repeated&&!bn.ctrl&&!bn.meta&&!bn.shift&&!bn.option&&!bn.super&&!bn.hyper&&wu.current===""&&(oe.images?.length??0)===0){bn.preventDefault(),oe.recall();return}if(bn.name==="tab"&&!bn.shift&&!bn.ctrl&&!bn.meta){if(bn.preventDefault(),xi.open)xi.complete();else if(!wu.current.startsWith("/"))xi.submit("followUp");return}if(xi.open&&(bn.name==="up"||bn.name==="down"))bn.preventDefault(),xi.move(bn.name==="up"?-1:1)},onChange:(bn)=>{wu.current=bn,oe.setDraft(bn)},onSubmit:()=>{Wt.current.submit("steer")},value:oe.draft})]}),oe.admissionError!==void 0?je(Qge,{color:Ze.warning,inset:Li,children:oe.admissionError==="offline_queue_full"?"One prompt is already queued; it sends when the service is back.":"Too many prompts are still awaiting admission. Try again shortly."}):null,oe.recallState.kind==="recalling"?je("text",{fg:Ze.foreground,attributes:2,children:"Recalling queued message\u2026"}):null,(oe.images?.length??0)>0?Gn("text",{fg:Ze.foreground,attributes:2,children:[String(oe.images?.length)," attached image(s)"]}):null,je(vge,{inset:Li}),Oe.map(({entryId:bn,value:xi})=>{let Xs=xi.panel.length>0?xi.panel:Tr.filter((on)=>_e[on.entryOrder]?.entryId===bn).map(({chip:on})=>on.row),Xa=Xs.filter((on)=>!(kn?.entryId===bn&&kn.rowId===on.id)&&!Y.some((sr)=>sr.entryId===bn&&sr.row===on)),_c=Xs.flatMap((on)=>{let sr=JSON.stringify([bn,on.id]);if(!fe({...on})||sr===xn?.key)return[];let qi=ct.awaiting.items.findIndex((Yt)=>Yt.key===sr),yr=[qi>=0&&ct.awaiting.total>1?`${String(qi+1)} of ${String(ct.awaiting.total)}`:void 0,"Alt+\u2191 answer"].filter(Boolean).join(" \xB7 ");return[{...on,title:gc(br(on.title),Math.max(1,Zt-2*Li-kp-Rv(yr)-3)),detail:yr}]}),Wc=K.omitted.find((on)=>on.entryId===bn),Pu=Xs.length===0?[]:[...Wc===void 0?[]:[{id:`omitted:${bn}`,title:`${String(Wc.count)} earlier change${Wc.count===1?"":"s"} omitted`,tone:"muted"}],...K.unanchored.filter((on)=>on.entryId===bn).flatMap(({cell:on})=>on.rows.map((sr)=>({...sr,id:`unanchored:${on.id}:${sr.id}`})))],hl=te?.entryId===bn?te.row:void 0,Yu=hl===void 0?[]:[{...hl,title:`${G.length>1?`${String(J+1)}/${String(G.length)} \xB7 `:""}${hl.title}`,detail:[hl.detail,ve?`Enter ${hl.actions?.[0]?.label.toLowerCase()??"select"}${G.length>1?" \xB7 \u2191/\u2193 cycle":""} \xB7 Esc back to draft`:`Alt+\u2191 ${hl.actions?.[0]?.label.toLowerCase()??"select"}`].filter(Boolean).join(" \xB7 ")}];return Xa.length===0&&Yu.length===0&&_c.length===0&&Pu.length===0?null:je(nZ,{id:`client-panel:${JSON.stringify([R,bn])}`,rows:[...Xa,...Pu,...Yu,..._c],presentation:Re,compactWidth:Zt-2*Li,expandedRowId:hl?.id,focusedRowId:ve?hl?.id:void 0,onOpen:a===void 0?void 0:(on)=>{Promise.resolve(a(on)).catch((sr)=>{Ai("client-row-open",sr)})}},bn)}),Ut?.inspection===void 0?null:Gn("box",{flexDirection:"column",flexShrink:1,height:Qt+1,children:[Gn("box",{flexDirection:"row",justifyContent:"space-between",marginX:Li,height:1,children:[je("text",{fg:Ze.foreground,wrapMode:"none",children:gc(br(gn),Math.max(0,Zt-4-Rv(In)))}),je("text",{fg:Ze.foreground,attributes:2,wrapMode:"none",children:In})]}),je("scrollbox",{ref:Ir,height:Qt,flexShrink:0,contentOptions:{minHeight:0,flexGrow:0},scrollX:!1,horizontalScrollbarOptions:{visible:!1},scrollbarOptions:{showArrows:!1},children:je(nZ,{rows:Ut.inspection.rows,presentation:Re})})]}),he.error?je(Qge,{color:Ze.error,inset:Li,children:br(he.error)}):null,lo!==void 0&&!ee.isOpen?je(Qge,{color:Ze[Syo[lo.tone]],inset:Li,children:br(lo.message)}):null,tt.loginNotice!==void 0&&!ee.isOpen?je(Qge,{color:Ze.info,inset:Li,children:tt.loginNotice}):null,ce!==void 0&&de?je(Qge,{color:Ze.warning,inset:Li,oneLine:!0,children:ce.phase==="incompatible"?`${ce.message} \xB7 Ctrl+B shows details`:ce.phase==="stuck"&&ce.alive===!1?"The service stopped. Run `fungi resume`. \xB7 Ctrl+B shows details":ce.phase==="stuck"&&ce.alive===!0?`Service busy (no reply for ${String(ce.seconds)}s) \xB7 Ctrl+B shows details`:"Reconnecting to the service... \xB7 Ctrl+B shows details"}):null]}),ce===void 0||de?null:je(dar,{view:ce,viewport:{width:Zt,height:Kn},colors:Ze,onClose:()=>{Se(!0)}})]})}var byo,wyo,far,Syo;var har=C(async()=>{Bc();bf();bf();Gi();Hsr();Vsr();ACt();await Pc([Qa(),Qa(),OCt(),Qa(),Qa(),Msr(),qsr(),Qa(),Qa(),Qa(),Qa(),Qa(),Qa(),Qa(),uar(),Qa(),par()]);byo=Wa({family:"tui-error-recovery",version:1,kinds:{request:{prefix:"request"}}}),wyo={idle:"success",waiting_for_you:"success",responding:"success",sending:"success",streaming:"success",thinking:"warning",queued:"warning",retrying:"warning",cancelling:"warning",running_tool:"warning",compacting:"warning",connecting:"warning",disconnected:"error",error:"error"};far=new Set(["cancelling","queued","retrying","sending","streaming","thinking"]),Syo={info:"info",success:"success",error:"error"}});var k7e,gar,kyo,Tyo,_ar;var yar=C(async()=>{Gi();await Pc([Qa(),har(),Qa()]);k7e=D().min(1).max(256),gar=D().max(4096).optional(),kyo=Nt([se({kind:Ee("conversation"),agentId:k7e,sessionId:k7e,title:gar}),se({kind:Ee("conversation"),agentId:k7e,sessionId:nh(),createRequestId:k7e,title:gar})]),Tyo=Wa({family:"tui-session-create-request",version:1,kinds:{request:{prefix:"request"}}}),_ar={kind:"conversation",instantiate:(e)=>{let t=kyo.safeParse(e);if(!t.success)return;let n=t.data,r=n.title?.trim(),i=r===void 0||r.length===0?void 0:r;return{key:n.sessionId===null?JSON.stringify([n.agentId,null,n.createRequestId]):JSON.stringify([n.agentId,n.sessionId]),title:i??"New conversation",render:async(o)=>{let s,a=await o.sessions.acquire(n,o.signal);if(o.signal.aborted)return null;let c=n.sessionId??(await a.read()).sessionId;o.signal.throwIfAborted();let u=o.sessions.describe?.(a),l=u?.resume,d=u?.forked,p=u?.observationUnavailable,f=u?.agentName?.trim(),h=`${f===void 0||f.length===0?"Agent":f} \xB7 New conversation`;o.setTitle(i??h);let g=async()=>{let w=(await u?.sessionTitle?.(o.signal))?.trim();if(!o.signal.aborted)o.setTitle(w===void 0||w.length===0?h:w)},_=jTt(o),y=wge(_,{exit:void 0,ctrlC:()=>(o.exit(),Promise.resolve())});return o.onDispose(y.dispose),ul(a7,{kit:o},ul(mar,{session:a,draftIdentity:{agentId:n.agentId,sessionId:c},commands:_,applicationCommands:{lease:y,exit:o.exit},onExit:o.exit,initialTheme:u?.themeName,onThemeConfirm:u?.saveTheme,themeError:u?.themeError,clients:u?.clients,interactionStore:u?.interactions,mcpApprovals:u?.mcpApprovals,modelSource:u?.models,sandboxSource:u?.sandbox,onStopAll:u?.stopAll,folder:u?.folder,onTitled:async(x)=>{if(x===null)await g();else o.setTitle(x)},reloadSources:u?.reload,initialCommandError:u?.initialError,initialCommandNotice:u?.initialNotice,onObservationUnavailable:p===void 0?void 0:()=>p(o.paneId),onRebindService:u?.rebindService,inputHandoff:u?.inputHandoff,onResume:l===void 0?void 0:()=>l(o.paneId),onNew:async()=>{s??=Tyo.request.generate();let x=await o.replace({kind:"conversation",agentId:n.agentId,sessionId:null,createRequestId:s});if(x.kind==="refused")throw Error(x.reason);s=void 0},onForked:d===void 0?(x)=>o.replace({kind:"conversation",agentId:n.agentId,sessionId:x}).then((w)=>{if(w.kind==="refused")throw Error(w.reason)}):(x)=>d(x,o.paneId),onOpen:(x)=>o.open({kind:"conversation",...kge(x)}).then((w)=>{if(w.kind==="refused")o.toast({variant:"error",duration:"until-dismissed",message:w.reason})})}))}}}}});var xar;var bar=C(async()=>{await Pc([Rsr(),yar(),sAt()]);xar=[_ar,Isr,Fnr]});function war(e,t){let n=[...new Set(t)].flatMap((o)=>e.filter((s)=>s.commandId===o)).slice(0,3),r=new Set(n.map((o)=>o.commandId)),i=(o,s=o.category)=>({commandId:o.commandId,command:o.command,name:o.title,description:o.description,group:s});return[...n.map((o)=>i(o,"Recent")),...e.filter((o)=>!r.has(o.commandId)).map((o)=>i(o))]}function Ear(e){let t=Or(e);t.current=e;let n=Or([]),r=(s)=>{Promise.resolve().then(s).catch((a)=>(t.current.toast({variant:"error",duration:"until-dismissed",message:"Pane command failed. Try again."}),Ai("pane-shell-command",a)))},i=(s)=>{let{commandId:a}=s;r(async()=>{let c=await t.current.host.execute(s.command,{origin:"keyboard"});if(c.status==="handled")n.current=[a,...n.current.filter((u)=>u!==a)].slice(0,3);else t.current.toast({variant:"error",duration:"until-dismissed",message:c.status==="failed"?Jb(c.error.message):"Pane command is unavailable."})})},o=()=>{let s=t.current,a=war(s.host.active().palette,n.current);s.dialog.show((c)=>je(Wp,{title:"Commands",colors:s.colors,searchable:!0,descriptionWrap:!1,collapsedGroups:["Panes","Advanced"],collapsedLabel:"More commands",visibleLimit:6,rowLimit:9,choices:a,onCancel:c.dismiss,onSelect:(u)=>{let l=a[u];if(l!==void 0)c.dismiss(),i(l)}}))};Vn(()=>{let s=()=>t.current.registry.read().find((m)=>m.focused)?.paneId,a=(m)=>{let h=t.current.registry.read(),g=h.findIndex((_)=>_.focused);return h[(g+m+h.length)%h.length]?.paneId},c=(m)=>{let h=a(m);if(h!==void 0)t.current.registry.focus(h)},u=(m)=>{let h=s(),g=a(m);if(h!==void 0&&g!==void 0)t.current.registry.swap(h,g)},l=(m,h,g,_,y,x)=>({description:x,id:m,title:h,category:"Panes",projections:{bindings:{values:g,order:_},palette:{order:10+_},help:{order:_}},handler:y}),d=[{id:"open-app",title:"Open pane",category:"Panes",description:"Choose a terminal, program, conversation or App.",projections:{bindings:{values:["<leader>o"],order:0},palette:{order:0}},handler:()=>{r(t.current.openPane)}},{id:"show-command-palette",title:"Show commands",category:"Panes",handler:o},{id:"command-line",title:"All commands",category:"Panes",projections:{bindings:{values:["<leader><leader>","<leader>:"],order:7}},handler:o},l("zoom","Zoom pane",["alt+enter","<leader>z"],2,()=>{let m=s();if(m!==void 0)t.current.registry.toggleZoom(m)},"Alt+Enter inserts a newline in the composer; Ctrl K z zooms from there."),l("focus-previous","Focus left",["alt+left","<leader>h"],3,()=>{c(-1)}),l("focus-next","Focus right",["alt+right","<leader>l"],4,()=>{c(1)}),l("swap-previous","Move pane left",["alt+shift+left","<leader>{"],5,()=>{u(-1)}),l("swap-next","Move pane right",["alt+shift+right","<leader>}"],6,()=>{u(1)}),{id:"pane-close",title:"Close pane",category:"Panes",projections:{palette:{order:1},bindings:{values:["<leader>x"],order:1}},handler:()=>{let m=s();return m===void 0?Promise.resolve():t.current.registry.close(m)}},...[["beside",["<leader>v","<leader>%"]],["below",["<leader>s",'<leader>"']]].map(([m,h])=>({id:`pane-open-${m}`,title:`Open pane ${m}`,category:"Panes",projections:{palette:{order:1},bindings:{values:[...h],order:12}},handler:()=>{r(()=>t.current.openPane(m))}})),...[["main-left","Main on left"],["main-top","Main on top"],["columns","Equal columns"],["rows","Equal rows"],["grid","Grid"]].map(([m,h])=>({id:`layout-${m}`,title:`Layout: ${h}`,category:"Panes",projections:{palette:{order:2}},handler:()=>{t.current.registry.setLayout(m)}})),{id:"layout-next",title:"Next layout",category:"Panes",projections:{palette:{order:2},bindings:{values:["<leader> "],order:8}},handler:()=>{t.current.registry.cycleLayout()}},...[-4,4].map((m)=>({id:m<0?"pane-shrink":"pane-grow",title:m<0?"Shrink main pane":"Grow main pane",category:"Panes",projections:{palette:{order:3},bindings:{values:[m<0?"<leader><":"<leader>>"],order:m<0?9:10}},handler:()=>{t.current.registry.resizeBy(m)}})),{id:"pane-equalize",title:"Equalize panes",category:"Panes",projections:{palette:{order:3},bindings:{values:["<leader>="],order:11}},handler:()=>{t.current.registry.equalize()}}],p=new Set(d.flatMap((m)=>(m.projections?.bindings?.values??[]).map(Sar))),f=t.current.registry.launchers.flatMap((m)=>{if(m.binding===void 0)return[];let h=Sar(m.binding),g=!p.has(h);if(g)p.add(h);else Ai("pane-launcher-binding-taken",Error(`${m.target.kind} asked for ${m.binding}, which is taken`));return[{id:`open-${m.target.kind.replaceAll(":","-")}`,title:`Open ${m.name.toLowerCase()}`,category:"Panes",description:m.description,projections:g?{bindings:{values:[m.binding],order:13},palette:{order:1}}:{palette:{order:1}},handler:()=>{r(async()=>{let _=await t.current.registry.open(m.target,!0,{direction:"beside",afterPaneId:s()??null});if(_.kind==="refused")t.current.toast({variant:"error",message:_.reason})})}}]});return e.host.registerShellCommands([...d,...f])},[e.host,e.registry])}function Sar(e){return e.trim()}var kar=C(async()=>{Bc();HJ();Gi();await Qa()});function nO(e){let t=e,n=new Set;return{value:{read:()=>t,subscribe:(i)=>(n.add(i),()=>{n.delete(i)})},set:(i)=>{if(Object.is(t,i))return;t=i;for(let o of n)o()},clear:()=>{n.clear()}}}function Ayo(e,t,n,r){console.error(`App window ${n} failed`,{windowId:e,generation:t,phase:n},sh(r))}function Cyo(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Iyo(e,t){if(e===null||t===null)return e===t;return e.canGoBack===t.canGoBack&&e.canGoForward===t.canGoForward&&e.title===t.title&&JSON.stringify([e.crumbs,e.primary,e.menu,e.status])===JSON.stringify([t.crumbs,t.primary,t.menu,t.status])}function Tar(e){let t=(J,te,ve,ce)=>{if(e.onFailure!==void 0)e.onFailure({windowId:J,generation:te,phase:ve,cause:ce});else Ayo(J,te,ve,ce)},n=new Map,r=new Set,i=new Set,o=new Map,s=!1,a,c=(J,te)=>{let ve=n.get(J)?.generation??null,de=(o.get(J)??Promise.resolve()).then(te),Se=de.then(()=>{if(o.get(J)===Se)o.delete(J)},(Oe)=>{if(t(J,ve,"mutation",Oe),o.get(J)===Se)o.delete(J)});return o.set(J,Se),de},u=()=>({windows:Array.from(n.values(),(J)=>{let te={windowId:J.launch.windowId,launch:J.launch,container:J.container,status:J.status,generation:J.generation,navigation:J.status==="ready"?J.navigation:null,statusItems:J.statusItems},ve=J.error===void 0?te:{...te,error:J.error};return J.cleanupError===void 0?ve:{...ve,cleanupError:J.cleanupError}})}),l=u(),d=()=>{l=u();for(let J of Array.from(i))J()},p=()=>l,f=(J)=>n.get(J.launch.windowId)===J,m=(J)=>f(J)&&!J.controller.signal.aborted&&!J.retiring&&!J.disposed,h=(J)=>J.closeRequested,g=(J,te)=>f(J)&&!J.disposed&&J.visibilityVersion===te,_=(J,te)=>te.signal.aborted||h(J)||!m(J),y=(J)=>{if(r.delete(J),!J.retiring)J.retiring=!0,J.controller.abort();for(let te of J.attachmentWaiters)te(!1);J.attachmentWaiters.clear()},x=async(J)=>{if(J.disposed)return;if(J.disposal){await J.disposal;return}for(let ve of J.attachmentWaiters)ve(!1);J.attachmentWaiters.clear();let te=(async()=>{if(!J.host&&J.mountPromise)await J.mountPromise;let ve=J.host;if(!ve){J.disposed=!0;return}let ce=J.hostOperation;if(ce)try{await ce}catch(de){if(J.error===void 0)J.status="error",J.error=de,d()}if(await ve.dispose(),J.host===ve)J.host=void 0;J.disposed=!0})();J.disposal=te;try{await te}catch(ve){throw J.disposal=void 0,J.cleanupError=ve,d(),ve}},w=async(J,te)=>{try{await te.dispose()}catch(ve){if(J.cleanupError=ve,f(J)&&J.error===void 0)J.status="error",J.error=ve,d();throw ve}},b=async(J,te,ve)=>{let ce=Promise.resolve().then(()=>te.setVisibility(ve));J.hostOperation=ce;try{await ce}finally{if(J.hostOperation===ce)J.hostOperation=void 0}},E=async(J,te)=>{if(!g(J,te)||J.retiring)return;let ve=J.host;if(!ve)return;let ce=J.visibility;try{await b(J,ve,ce)}catch(de){if(!g(J,te))return;J.status="error",J.error=de,d();try{await x(J)}catch(Se){throw J.cleanupError=Se,d(),Se}}},A=async(J)=>{if(performance.mark("fungi.app-open.window-mount-start"),e.waitForAttachment&&!e.isAttached?.(J.container)){if(performance.mark("fungi.app-open.window-wait-for-attachment"),!await new Promise((ce)=>{J.attachmentWaiters.add(ce)}))return;performance.mark("fungi.app-open.window-attached")}let te;try{performance.mark("fungi.app-open.window-host-mount-start"),te=await e.mount(J.container,J.launch,J.controller.signal,{onDeliveryPending:()=>{if(!m(J)||J.deliveryPending)return;J.deliveryPending=!0,J.status=J.visibility==="hidden"?"minimized":"getting-ready",d()},onComputerChoice:()=>Promise.resolve().then(()=>{if(!m(J)||J.status!=="ready"||J.computerChoice===void 0)throw new xg("Computer choice is unavailable for this window",{code:"CAPABILITY_DENIED",retryable:!1});J.computerChoice()}),onNavigationState:(ve)=>{if(!m(J)||Iyo(J.navigation,ve))return;J.navigation=ve,d()},onStatusItems:(ve)=>{if(!m(J)||Cyo(J.statusItems,ve))return;J.statusItems=ve,d()}}),performance.mark("fungi.app-open.window-host-mount-ready")}catch(ve){if(!m(J)){if(ve!==J.controller.signal.reason)t(J.launch.windowId,J.generation,"mount",ve);return}J.status=J.visibility==="hidden"?"minimized":"error",J.error=ve,d();return}if(!m(J)){await w(J,te);return}if(J.host=te,J.visibility==="hidden")await E(J,J.visibilityVersion);if(!m(J)){await x(J);return}if(J.status!=="error")J.status=J.visibility==="hidden"?"minimized":"ready",J.error=void 0,J.cleanupError=void 0,d()},R=(J)=>{let te=A(J);return J.mountPromise=te,te.catch((ve)=>{t(J.launch.windowId,J.generation,"mount",ve);return}),te},F=(J,te)=>({launch:J,container:e.createContainer(J),generation:te,status:"loading",deliveryPending:!1,controller:new AbortController,host:void 0,disposed:!1,retiring:!1,disposal:void 0,mountPromise:void 0,hostOperation:void 0,reconfigureController:void 0,closeRequested:!1,error:void 0,cleanupError:void 0,visibility:"visible",attachmentWaiters:new Set,visibilityVersion:0,navigation:null,statusItems:[],computerChoice:void 0}),z=(J)=>{let te=n.get(J.windowId),ve=!s&&!te?F(J,1):void 0,ce;if(ve)n.set(J.windowId,ve),d(),ce=R(ve);return c(J.windowId,async()=>{if(s){if(ve&&n.get(J.windowId)===ve)y(ve),await x(ve),n.delete(J.windowId),d();return}let Se=n.get(J.windowId);if(ve){if(Se!==ve)return;return}if(Se){if(ce=Se.mountPromise,Se.visibility==="hidden"&&!Se.retiring){let he=++Se.visibilityVersion;if(Se.visibility="visible",Se.status=Se.error!==void 0?"error":Se.host?"ready":Se.deliveryPending?"getting-ready":"loading",d(),Se.error===void 0)await E(Se,he)}else d();return}let Oe=F(J,1);n.set(J.windowId,Oe),d(),ce=R(Oe)}).then(async()=>{if(ce)await ce})},U=(J)=>{if(s)return;let te=n.get(J);if(!te||te.disposed||te.retiring)return;for(let ve of te.attachmentWaiters)ve(!0);te.attachmentWaiters.clear()},V=(J,te)=>{let ve=n.get(J);if(s)return Promise.resolve();if(ve&&!ve.retiring&&ve.error!==void 0)return ve.visibility=te,ve.status=te==="hidden"?"minimized":"error",d(),Promise.resolve();if(!ve||ve.disposed||ve.retiring||ve.status==="error")return c(J,async()=>{let de=n.get(J);if(!de||de.disposed||de.retiring||de.status==="error")return;let Se=++de.visibilityVersion;de.visibility=te,de.status=te==="hidden"?"minimized":de.host?"ready":de.deliveryPending?"getting-ready":"loading",d(),await E(de,Se)});let ce=++ve.visibilityVersion;return ve.visibility=te,ve.status=te==="hidden"?"minimized":ve.host?"ready":ve.deliveryPending?"getting-ready":"loading",d(),c(J,()=>E(ve,ce))},ee=(J)=>V(J,"hidden"),oe=(J)=>V(J,"visible"),ue=async()=>{if(s)return;let J=[...n.values()].filter((te)=>!te.retiring&&te.visibility==="visible");for(let te of J)r.add(te);await Promise.all(J.map((te)=>ee(te.launch.windowId)))},be=async()=>{let J=[...r];r.clear(),await Promise.all(J.filter((te)=>n.get(te.launch.windowId)===te).map((te)=>oe(te.launch.windowId)))},_e=async(J)=>{if(s)return!0;let te=J.host?.requestClose;if(!te)return!0;try{return await te()}catch(ve){if(f(J))J.status="error",J.error=ve,d();throw ve}},q=(J)=>{let te=n.get(J),ve=te!==void 0;if(te?.reconfigureController?.abort(),te)te.closeRequested=!0;return c(J,async()=>{if(!ve)return;let ce=n.get(J);if(!ce)return;let de;try{de=await _e(ce)}catch(Se){throw ce.closeRequested=!1,Se}if(!de){ce.closeRequested=!1;return}y(ce);try{await x(ce)}catch(Se){if(f(ce)){if(ce.status="error",ce.error===void 0)ce.error=Se;ce.cleanupError=Se,d()}throw Se}if(!f(ce))return;n.delete(J),d()})},K=(J,te)=>c(J,async()=>{if(s)return;let ce=n.get(J);if(!ce||ce.disposed||ce.retiring)return;if(h(ce))return;let de={...te(ce.launch),windowId:J};if(e.validateReconfiguration?.(ce.launch,de),e.isChromeOnlyChange?.(ce.launch,de)===!0){ce.launch=de,d();return}let Se=new AbortController;ce.reconfigureController=Se;try{let Oe=ce.mountPromise;if(!ce.host&&Oe)await La(ii({try:()=>Oe,catch:(Ze)=>Ze}),{signal:Se.signal});if(_(ce,Se))return;let he=ce.host;if(!he)throw Error("The App host is not ready for reconfiguration.");let Re=Promise.resolve().then(()=>he.reconfigure(de,Se.signal));ce.hostOperation=Re;try{await Re}finally{if(ce.hostOperation===Re)ce.hostOperation=void 0}if(_(ce,Se))return;ce.launch=de,ce.status=ce.visibility==="hidden"?"minimized":"ready",ce.error=void 0,ce.cleanupError=void 0,d()}catch(Oe){if(_(ce,Se))return;throw Oe}finally{if(ce.reconfigureController===Se)ce.reconfigureController=void 0}}),X=(J,te)=>K(J,()=>te),Y=(J,te)=>{let ve;return c(J,async()=>{if(s)return;let de=n.get(J),Se=!1;if(de){if(!await _e(de))return;Se=r.has(de),y(de);try{await x(de)}catch(Re){if(f(de)){if(de.status="error",de.error===void 0)de.error=Re;de.cleanupError=Re,d()}throw Re}}let Oe={...te,windowId:J},he=F(Oe,de?de.generation+1:1);if(de?.visibility==="hidden")he.visibility="hidden",he.status="minimized";if(Se)r.add(he);n.set(J,he),d(),ve=R(he)}).then(async()=>{if(ve)await ve})},fe=async(J)=>{let te=n.get(J);if(!te||!m(te)||te.status!=="ready"||te.navigation?.canGoBack!==!0)return!1;let ve=te.host?.requestBack;return ve?await ve():!1},G=async(J)=>{let te=n.get(J);if(!te||!m(te)||te.status!=="ready"||te.navigation?.canGoForward!==!0)return!1;let ve=te.host?.requestForward;return ve?await ve():!1},Z=async(J,te)=>{let ve=n.get(J);if(!ve||!m(ve)||ve.status!=="ready")return!1;if(ve.navigation===null||!nat(ve.navigation,te))return!1;let ce=ve.host?.activateNavigation;return ce?await ce(te):!1},le=async(J,te)=>{let ve=n.get(J);if(!ve||!m(ve)||ve.status!=="ready")return!1;if(!Vst(ve.statusItems,te))return!1;let ce=ve.host?.activateStatus;return ce?await ce(te):!1},Pe=(J,te)=>{let ve=n.get(J);if(!ve||!m(ve))throw new xg("App window is unavailable",{code:"DISCONNECTED",retryable:!1});return ve.computerChoice=te,()=>{if(ve.computerChoice===te)ve.computerChoice=void 0}},xe=async()=>{s=!0;for(let J of n.values())J.closeRequested=!0,J.reconfigureController?.abort();try{await Promise.allSettled(o.values());let J=[],te=await Promise.allSettled([...n.keys()].map((ve)=>q(ve)));for(let ve of te)if(ve.status==="rejected")J.push(ve.reason);if(J.length>0)throw AggregateError(J,"Failed to dispose App windows")}finally{i.clear()}};return{open:z,attach:U,minimize:ee,restore:oe,hideAll:ue,restoreHidden:be,close:q,reconfigure:X,update:K,activateNavigation:Z,activateStatus:le,registerComputerChoice:Pe,replace:Y,back:fe,forward:G,dispose:()=>{if(a)return a;let J=xe();return a=J,J.then(()=>{if(a===J)a=void 0},()=>{if(a===J)a=void 0}),J},read:p,subscribe:(J)=>(i.add(J),()=>i.delete(J))}}var dnc;var Aar=C(()=>{$k();vr();tr();Vht();dnc=Wu(re({...sat.fields,retryable:Be(!0)}))});function Iar(e){return"init"in e}function $Ct(e){return typeof e.write==="function"}function Ryo(e){return!!e.onMount}function Car(e){return"v"in e||"e"in e}function T7e(e){if("e"in e)throw e.e;if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!("v"in e))throw Error("[Bug] atom state is not initialized");return e.v}function A7e(e){return typeof(e==null?void 0:e.then)==="function"}function Dyo(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t==="RangeError"||t==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function Rar(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function Dar(e,t,n){let r=n.get(e),i=r==null?void 0:r.t,o=t.p;if(!(i==null?void 0:i.size))return o;if(!o.size)return i;let s=new Set(i);for(let a of o)s.add(a);return s}function Oyo(e){return!!e.INTERNAL_onInit}function Oar(...e){let t={get(s){return r(n,t,s)},set(s,...a){return i(n,t,s,...a)},sub(s,a){return o(n,t,s,a)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Pyo,Myo,Nyo,Lyo,Fyo,$yo,zyo,Uyo,jyo,Byo,qyo,Wyo,Hyo,Gyo,Vyo,Kyo,Jyo,void 0,new WeakMap,Qyo,Xyo,[0]].map((s,a)=>e[a]||s);Yyo.set(t,Object.freeze(n));let r=n[21],i=n[22],o=n[23];return t}var Pyo=(e,t,n,...r)=>n.read(...r),Myo=(e,t,n,...r)=>n.write(...r),Nyo=(e,t,n)=>n.INTERNAL_onInit(t),Lyo=(e,t,n,r)=>{var i;return(i=n.onMount)==null?void 0:i.call(n,r)},Fyo=(e,t,n)=>{var r;let i=e[0],o=i.get(n);if(!o){let s=e[6],a=e[9];if(o={d:new Map,p:new Set,n:0},i.set(n,o),(r=s.i)==null||r.call(s,n),Oyo(n))a(e,t,n)}return o},$yo=(e,t)=>{var n;let r=e[1],i=e[3],o=e[4],s=e[5],a=e[6],c=e[13];if(!a.f&&!i.size&&!o.size&&!s.size)return;let u=[],l=(d)=>{try{d()}catch(p){u.push(p)}};do{if(a.f)l(a.f);let d=new Set;for(let p of i){let f=(n=r.get(p))==null?void 0:n.l;if(f)for(let m of f)d.add(m)}i.clear();for(let p of s)d.add(p);s.clear();for(let p of o)d.add(p);o.clear();for(let p of d)l(p);if(i.size)c(e,t)}while(i.size||s.size||o.size);if(u.length)throw AggregateError(u)},zyo=(e,t)=>{let n=e[1],r=e[2],i=e[3],o=e[11],s=e[14],a=e[17];if(!i.size)return;let c=[],u=[],l=new WeakSet,d=new WeakSet,p=[],f=[];for(let m of i)p.push(m),f.push(o(e,t,m));while(p.length){let m=p.length-1,h=p[m],g=f[m];if(d.has(h)){p.pop(),f.pop();continue}if(l.has(h)){if(r.get(h)===g.n)c.push(h),u.push(g);else if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&r.has(h))throw Error("[Bug] invalidated atom exists");d.add(h),p.pop(),f.pop();continue}l.add(h);for(let _ of Dar(h,g,n))if(!l.has(_))p.push(_),f.push(o(e,t,_))}for(let m=c.length-1;m>=0;--m){let h=c[m],g=u[m],_=!1;for(let y of g.d.keys())if(y!==h&&i.has(y)){_=!0;break}if(_)r.set(h,g.n),s(e,t,h),a(e,t,h);r.delete(h)}},zCt,Uyo=(e,t,n)=>{var r,i;let o=e[1],s=e[2],a=e[3],c=e[6],u=e[7],l=e[11],d=e[12],p=e[13],f=e[14],m=e[16],h=e[17],g=e[20],_=e[26],y=e[28],x=l(e,t,n),w=y[0];if(Car(x)){if(o.has(n)&&s.get(n)!==x.n||x.m===w)return x.m=w,x;let ue=!1;for(let[be,_e]of x.d)if(f(e,t,be).n!==_e){ue=!0;break}if(!ue)return x.m=w,x}let b=!0,E=new Set(x.d.keys()),A=()=>{for(let ue of E)x.d.delete(ue)},R=()=>{if(o.has(n)){let ue=!a.size;if(h(e,t,n),ue)p(e,t),d(e,t)}},F=(ue)=>{var be;if(ue===n){let q=l(e,t,ue);if(!Car(q))if(Iar(ue))g(e,t,ue,ue.init);else throw Error("no atom init");return T7e(q)}let _e=f(e,t,ue);try{return T7e(_e)}finally{if(E.delete(ue),x.d.set(ue,_e.n),A7e(x.v))Rar(n,x.v,_e);if(o.has(n))(be=o.get(ue))==null||be.t.add(n);if(!b)R()}},z,U,V={get signal(){if(!z)z=new AbortController;return z.signal},get setSelf(){if((import.meta.env?import.meta.env.MODE:void 0)!=="production")console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3.");if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!$Ct(n))console.warn("setSelf function cannot be used with read-only atom");if(!U&&$Ct(n))U=(...ue)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&b)console.warn("setSelf function cannot be called in sync");if(!b)try{return m(e,t,n,ue)}finally{p(e,t),d(e,t)}};return U}},ee=x.n,oe=s.get(n)===ee;try{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")zCt.delete(t);let ue=u(e,t,n,F,V);if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&zCt.has(t))console.warn("Detected store mutation during atom read. This is not supported.");if(g(e,t,n,ue),A7e(ue)){_(e,t,ue,()=>z==null?void 0:z.abort());let be=()=>{A(),R()};ue.then(be,be)}else A();return(r=c.r)==null||r.call(c,n),x.m=w,x}catch(ue){if(Dyo(ue))throw ue;return delete x.v,x.e=ue,++x.n,x.m=w,x}finally{if(b=!1,x.n!==ee&&oe)s.set(n,x.n),a.add(n),(i=c.c)==null||i.call(c,n)}},jyo=(e,t,n)=>{let r=e[1],i=e[2],o=e[11],s=[n];while(s.length){let a=s.pop(),c=o(e,t,a);for(let u of Dar(a,c,r)){let l=o(e,t,u);if(i.get(u)!==l.n)i.set(u,l.n),s.push(u)}}},Byo=(e,t,n,r)=>{let i=e[3],o=e[6],s=e[8],a=e[11],c=e[12],u=e[13],l=e[14],d=e[15],p=e[16],f=e[17],m=e[20],h=e[28],g=!0,_=(x)=>T7e(l(e,t,x)),y=(x,...w)=>{var b;let E=a(e,t,x);try{if(x===n){if(!Iar(x))throw Error("atom not writable");if((import.meta.env?import.meta.env.MODE:void 0)!=="production")zCt.add(t);let A=E.n,R=w[0];if(m(e,t,x,R),f(e,t,x),A!==E.n)++h[0],i.add(x),d(e,t,x),(b=o.c)==null||b.call(o,x);return}else return p(e,t,x,w)}finally{if(!g)u(e,t),c(e,t)}};try{return s(e,t,n,_,y,...r)}finally{g=!1}},qyo=(e,t,n)=>{var r;let i=e[1],o=e[3],s=e[6],a=e[11],c=e[15],u=e[18],l=e[19],d=a(e,t,n),p=i.get(n);if(p&&d.d.size>0){for(let[f,m]of d.d)if(!p.d.has(f)){let h=a(e,t,f);if(u(e,t,f).t.add(n),p.d.add(f),m!==h.n)o.add(f),c(e,t,f),(r=s.c)==null||r.call(s,f)}for(let f of p.d)if(!d.d.has(f)){p.d.delete(f);let m=l(e,t,f);m==null||m.t.delete(n)}}},Wyo=(e,t,n)=>{var r;let i=e[1],o=e[4],s=e[6],a=e[10],c=e[11],u=e[12],l=e[13],d=e[14],p=e[16],f=e[18],m=c(e,t,n),h=i.get(n);if(!h){d(e,t,n);for(let g of m.d.keys())f(e,t,g).t.add(n);if(h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(n,h),$Ct(n)&&Ryo(n)){let g=()=>{let _=!0,y=(...x)=>{try{return p(e,t,n,x)}finally{if(!_)l(e,t),u(e,t)}};try{let x=a(e,t,n,y);if(x)h.u=()=>{_=!0;try{x()}finally{_=!1}}}finally{_=!1}};o.add(g)}(r=s.m)==null||r.call(s,n)}return h},Hyo=(e,t,n)=>{var r,i;let o=e[1],s=e[5],a=e[6],c=e[11],u=e[19],l=c(e,t,n),d=o.get(n);if(!d||d.l.size)return d;let p=!1;for(let f of d.t)if((r=o.get(f))==null?void 0:r.d.has(n)){p=!0;break}if(!p){if(d.u)s.add(d.u);d=void 0,o.delete(n);for(let f of l.d.keys()){let m=u(e,t,f);m==null||m.t.delete(n)}(i=a.u)==null||i.call(a,n);return}return d},Gyo=(e,t,n,r)=>{let i=e[11],o=e[27],s=i(e,t,n),a="v"in s,c=s.v;if(A7e(r))for(let u of s.d.keys())Rar(n,r,i(e,t,u));if(s.v=r,delete s.e,!a||!Object.is(c,s.v)){if(++s.n,A7e(c))o(e,t,c)}},Vyo=(e,t,n)=>{let r=e[14];return T7e(r(e,t,n))},Kyo=(e,t,n,...r)=>{let i=e[3],o=e[12],s=e[13],a=e[16],c=i.size;try{return a(e,t,n,r)}finally{if(i.size!==c)s(e,t),o(e,t)}},Jyo=(e,t,n,r)=>{let i=e[12],o=e[13],s=e[18],a=e[19],u=s(e,t,n).l;return u.add(r),o(e,t),i(e,t),()=>{u.delete(r),a(e,t,n),o(e,t),i(e,t)}},Qyo=(e,t,n,r)=>{let i=e[25],o=i.get(n);if(!o){o=new Set,i.set(n,o);let s=()=>i.delete(n);n.then(s,s)}o.add(r)},Xyo=(e,t,n)=>{let i=e[25].get(n);i==null||i.forEach((o)=>o())},Yyo;var Par=C(()=>{zCt=new WeakSet,Yyo=new WeakMap});function Nar(e,t){let n=`atom${++Zyo}`,r={toString(){return(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};if(typeof e==="function")r.read=e;else r.init=e,r.read=e1o,r.write=t1o;if(t)r.write=t;return r}function e1o(e){return e(this)}function t1o(e,t,n){return t(this,typeof n==="function"?n(e(this)):n)}function Lar(){if(Mar)return Mar();return Oar()}var Zyo=0,Mar;var Far=C(()=>{Par()});var UCt,C7e=(e,t,n)=>Math.min(Math.max(e,t),n),BCt=(e,t,n)=>{let r=C7e(e.width,n.width,Math.max(n.width,t.width)),i=C7e(e.height,n.height,Math.max(n.height,t.height));return{width:r,height:i,x:C7e(e.x,0,Math.max(0,t.width-r)),y:C7e(e.y,0,Math.max(0,t.height-i))}},jCt=(e,t,n)=>{let r=t.width/2,i=t.height/2,o=e==="left"?{x:0,y:0,width:r,height:t.height}:e==="right"?{x:r,y:0,width:r,height:t.height}:e==="top-left"?{x:0,y:0,width:r,height:i}:e==="top-right"?{x:r,y:0,width:r,height:i}:e==="bottom-left"?{x:0,y:i,width:r,height:i}:{x:r,y:i,width:r,height:i};return BCt(o,t,n)},qCt=()=>{let e=Lar(),t=()=>e.get(UCt),n=0,r=(a)=>{n+=1,e.set(UCt,a(t()))},i=(a,c,u)=>{r((l)=>{let d=new Map(l.frames);return d.set(a,c),{...l,frames:d,participating:new Set(l.participating).add(a),tiles:l.tiles.includes(a)?l.tiles:[...l.tiles,a],minima:new Map(l.minima).set(a,u),order:l.order.includes(a)?l.order:[...l.order.filter((p)=>p!==l.zoomed),a,...l.zoomed?[l.zoomed]:[]]}})},o=(a)=>t().frames.has(a),s=(a,c)=>{let u=t().gesture;return u?.kind==="frame"&&u.id===a&&u.pointerId===c};return{get version(){return n},get frames(){return t().frames},get order(){return t().order},get tiles(){return t().tiles},get minima(){return t().minima},get participating(){return t().participating},get mainSize(){return t().mainSize},get zoomed(){return t().zoomed},get gesture(){return t().gesture},get restore(){return t().restore},subscribe:(a)=>e.sub(UCt,a),register:i,setParticipation:(a,c)=>{if(!t().frames.has(a))return;r((u)=>{if(u.participating.has(a)===c)return u;let d=new Set(u.participating);if(c)d.add(a);else d.delete(a);let p=c?u.tiles.includes(a)?u.tiles:[...u.tiles,a]:u.tiles.filter((m)=>m!==a),f=c?u.order.includes(a)?u.order:[...u.order,a]:u.order.filter((m)=>m!==a);return{...u,participating:d,tiles:p,order:f,zoomed:c||u.zoomed!==a?u.zoomed:null,gesture:!c&&u.gesture?.kind==="frame"&&u.gesture.id===a?null:u.gesture}})},setMinima:(a,c)=>{let u=t().minima.get(a);if(!u||u.width===c.width&&u.height===c.height)return;r((l)=>({...l,minima:new Map(l.minima).set(a,c)}))},unregister:(a)=>{r((c)=>{if(!c.frames.has(a))return c;let u=new Map(c.frames);u.delete(a);let l=new Map(c.restore);l.delete(a);let d=c.order.filter((g)=>g!==a),p=c.tiles.filter((g)=>g!==a),f=new Map(c.minima);f.delete(a);let m=new Set(c.participating);m.delete(a);let h=c.gesture?.kind==="frame"&&c.gesture.id===a?null:c.gesture;return{...c,frames:u,restore:l,order:d,tiles:p,minima:f,participating:m,gesture:h,zoomed:c.zoomed===a?null:c.zoomed}})},begin:(a,c)=>{if(!o(a)||!t().participating.has(a))return;r((u)=>({...u,gesture:{kind:"frame",id:a,pointerId:c,start:u.frames.get(a)??{x:0,y:0,width:0,height:0}},order:[...u.order.filter((l)=>l!==a),a]}))},move:(a,c,u,l,d,p=null)=>{if(o(a)&&t().participating.has(a)&&s(a,c))r((f)=>({...f,frames:new Map(f.frames).set(a,BCt(u,l,d)),gesture:f.gesture?.kind==="frame"?{...f.gesture,snap:p?{side:p,frame:jCt(p,l,d)}:null}:f.gesture}))},end:(a,c)=>{if(s(a,c))r((u)=>{let l=u.gesture;if(l?.kind!=="frame"||!l.snap)return{...u,gesture:null};return{...u,frames:new Map(u.frames).set(a,l.snap.frame),restore:new Map(u.restore).set(a,u.restore.get(a)??l.start),gesture:null}})},cancel:(a,c)=>{let u=t().gesture;if(u?.kind==="frame"&&u.id===a&&u.pointerId===c)r((l)=>{let d=new Map(l.frames);return d.set(a,u.start),{...l,frames:d,gesture:null}})},snap:(a,c,u,l)=>{if(!o(a)||!t().participating.has(a))return;r((d)=>{let p=new Map(d.restore);p.set(a,d.frames.get(a)??jCt(c,u,l));let f=new Map(d.frames);return f.set(a,jCt(c,u,l)),{...d,frames:f,restore:p,order:[...d.order.filter((m)=>m!==a),a]}})},restoreFrame:(a,c,u)=>{if(!o(a)||!t().participating.has(a))return;r((l)=>{let d=l.restore.get(a);if(!d)return l;let p=new Map(l.frames);p.set(a,BCt(d,c,u));let f=new Map(l.restore);return f.delete(a),{...l,frames:p,restore:f}})},focus:(a)=>{if(!o(a))return;r((c)=>({...c,order:[...c.order.filter((u)=>u!==a),a],zoomed:c.zoomed===null?null:a}))},swap:(a,c)=>{if(!o(a)||!o(c)||!t().participating.has(a)||!t().participating.has(c))return;r((u)=>({...u,tiles:u.tiles.map((l)=>l===a?c:l===c?a:l)}))},zoom:(a)=>{if(a!==null&&(!o(a)||!t().participating.has(a)))return;r((c)=>({...c,zoomed:a,order:a===null?c.order:[...c.order.filter((u)=>u!==a),a]}))},resizeMain:(a)=>{r((c)=>({...c,mainSize:a}))},beginDivider:(a)=>{if(t().gesture)return!1;return r((c)=>({...c,gesture:{kind:"divider",pointerId:a,start:c.mainSize}})),!0},finishDivider:(a,c)=>{let u=t().gesture;if(u?.kind!=="divider"||u.pointerId!==a)return;r((l)=>({...l,gesture:null,mainSize:c?u.start:l.mainSize}))},destroy:()=>{r((a)=>({...a,gesture:null,restore:new Map}))}}};var $ar=C(()=>{Far();UCt=Nar({frames:new Map,order:[],tiles:[],minima:new Map,participating:new Set,mainSize:void 0,zoomed:null,gesture:null,restore:new Map})});function I7e(e,t,n,r,i){let o=i.layout??"main-left";if(o==="columns"||o==="rows"||o==="grid")return n1o(e,t,n,r,i,o);if(o==="main-top"){let s=zar(e,new Map([...t].map(([a,c])=>[a,{width:c.height,height:c.width}])),n,{width:r.height,height:r.width},i);return{frames:new Map([...s.frames].map(([a,c])=>[a,{x:c.y,y:c.x,width:c.height,height:c.width}])),tabGroups:s.tabGroups,divider:s.divider&&{...s.divider,axis:"y"}}}return zar(e,t,n,r,i)}function n1o(e,t,n,r,i,o){let s=new Map,a=[];if(!e.length)return{frames:s,tabGroups:a,divider:null};let c=Math.max(0,i.gap??8),u=e.reduce((y,x)=>({width:Math.max(y.width,t.get(x)?.width??0),height:Math.max(y.height,t.get(x)?.height??0)}),{width:0,height:0}),l=(y,x)=>x+c===0?e.length:Math.min(e.length,Math.max(1,Math.floor((y+c)/(x+c)))),d=l(r.width,u.width),p=l(r.height,u.height),f=u.width>r.width||u.height>r.height?1:o==="columns"?d:o==="rows"?p:Math.min(e.length,d*p),m=o==="columns"?f:o==="rows"?1:Math.min(d,Math.max(Math.ceil(Math.sqrt(f)),Math.ceil(f/p))),h=Math.ceil(f/m),g=(r.width-c*(m-1))/m,_=(r.height-c*(h-1))/h;for(let y=0;y<f;y++){let x=e.slice(y,y===f-1?void 0:y+1),w=x.length===1?x[0]:[...n].reverse().find((b)=>x.includes(b))??x[0];if(w)s.set(w,{x:y%m*(g+c),y:Math.floor(y/m)*(_+c),width:g,height:_});if(x.length>1)a.push(x)}return{frames:s,tabGroups:a,divider:null}}function zar(e,t,n,r,i){let o=new Map,s=[],a={x:0,y:0,...r},[c,...u]=e,l=(w,b)=>{let E=[...n].reverse().find((A)=>w.includes(A))??w[0];if(E)o.set(E,b);if(w.length>1)s.push(w)};if(!c)return{frames:o,tabGroups:s,divider:null};if(!u.length)return o.set(c,a),{frames:o,tabGroups:s,divider:null};let d=Math.max(0,i.gap??8),p=t.get(c)?.width??0,f=Math.max(...u.map((w)=>t.get(w)?.width??0)),m=r.width-d-f;if(p>m)return l([...e],a),{frames:o,tabGroups:s,divider:null};let h=Math.min(m,Math.max(p,i.mainSize??r.width/2)),g={axis:"x",position:h,min:p,max:m};o.set(c,{...a,width:h});let _={...a,x:h+d,width:r.width-h-d},x=u.map((w)=>t.get(w)?.height??0).reduce((w,b)=>w+b,0)+d*(u.length-1);if(x>r.height)l(u,_);else{let w=(r.height-x)/u.length,b=0;for(let E of u){let A=(t.get(E)?.height??0)+w;o.set(E,{..._,y:b,height:A}),b+=A+d}}return{frames:o,tabGroups:s,divider:g}}var Uar=C(()=>{$ar()});function jar(e){let t=new Map(e.kinds.map((E)=>[E.kind,E]));if(t.size!==e.kinds.length)throw Error("Pane kinds must have distinct identities");let n=qCt(),r=new Map,i=new Map,o=new Set,s=nO([]),a=e.viewport,c=!1,u=()=>c,l,d="main-left",p=0,f=new AbortController,m=()=>{let E={layout:d,gap:0};if(n.mainSize!==void 0)E.mainSize=n.mainSize;let A=I7e(n.tiles,n.minima,n.order,a,E);if(n.zoomed!==null&&n.participating.has(n.zoomed))A.frames=new Map([[n.zoomed,{x:0,y:0,...a}]]);let R=n.order.at(-1)??null;e.commands.focus(r.get(R??"")?.commandScope??null);let F=[];for(let z of g.read().windows){let U=r.get(z.windowId);if(U===void 0)continue;let V=A.frames.get(z.windowId),ee=V??{x:0,y:0,...U.viewport.value.read()};U.focused.set(R===z.windowId);let oe={width:Math.floor(ee.width)-(g.read().windows.length>1&&n.zoomed===null&&ee.x+ee.width<a.width?1:0),height:Math.max(1,Math.floor(ee.height))};if(oe.width!==U.viewport.value.read().width||oe.height!==U.viewport.value.read().height)U.viewport.set(oe);F.push({paneId:z.windowId,title:U.title,frame:{x:Math.floor(ee.x),y:Math.floor(ee.y),width:Math.floor(ee.width),height:Math.floor(ee.height)},visible:V!==void 0,focused:R===z.windowId,zoomed:n.zoomed===z.windowId,node:U.node,state:z.status==="error"?"error":z.status==="loading"?"loading":"ready",error:z.error,status:[...U.status.values()],presentation:U.theme.value.read()})}s.set(F)};async function h(E,A){let R=new AbortController,F=AbortSignal.any([A,f.signal,R.signal]),z=E.windowId,U=`${z}:${String(++p)}`,V=e.commands.mountPane(U),ee=nO(a),oe=nO(!1),ue=new Set,be=new Set,_e=nO(e.theme.read()),q=new Map,K=()=>{_e.set([...q.values()].at(-1)??e.theme.read()),m()},X=new Map,Y=nO([]),fe=(Oe)=>{let he={...Oe,text:Jb(Oe.text)};if(he.compact!==void 0)he.compact=Jb(he.compact);return he},G=()=>{Y.set([...X.values()]),m()},Z=new Set,le=new Set;le.add(e.theme.subscribe(()=>{if(q.size===0)K()}));let Pe=new Set,xe=!0;function Le(Oe){return{read:Oe.read,subscribe:(he)=>{if(!xe)return()=>{return};let Re=Oe.subscribe(he);return le.add(Re),()=>{le.delete(Re),Re()}}}}let J=e.apps,te={paneId:z,setTitle:(Oe)=>{if(!xe)return;if(ce.title=Jb(Oe),ce.node!==null&&r.get(z)?.kit===te)m()},exit:e.exit,rendering:{afterFrame:(Oe)=>{if(!xe)return()=>{return};let he=e.rendering.afterFrame(()=>{if(le.delete(he),xe)Oe()});return le.add(he),()=>{le.delete(he),he()}},requestFrame:()=>{if(xe)e.rendering.requestFrame()},isFocused:(Oe)=>xe&&oe.value.read()&&e.rendering.isFocused(Oe)},viewport:Le(ee.value),input:{focused:Le(oe.value),onKey:(Oe)=>{if(xe)ue.add(Oe);return()=>{ue.delete(Oe)}},onPaste:(Oe)=>{if(xe)be.add(Oe);return()=>{be.delete(Oe)}},requestFocus:()=>{if(xe)n.focus(z)}},commands:V,dialogs:{dismiss:()=>xe&&e.dialogs.dismiss(),open:Le(e.dialogs.open),show:(Oe,he)=>{if(!xe)throw Error("Pane has closed");let Re=e.dialogs.show(Oe,he);return Pe.add(Re),Re}},status:{items:Le(Y.value),contribute:(Oe)=>{if(!xe)throw Error("Pane has closed");let he=Symbol();return X.set(he,fe(Oe)),G(),{update:(Re)=>{if(xe&&X.has(he))X.set(he,fe(Re)),G()},dispose:()=>{if(X.delete(he))G()}}}},replace:(Oe)=>xe?w(z,Oe):Promise.resolve({kind:"refused",reason:"Pane has closed"}),open:(Oe)=>xe?x(Oe):Promise.resolve({kind:"refused",reason:"Pane has closed"}),toast:(Oe)=>{if(xe)e.toast({...Oe,key:Oe.duration==="until-dismissed"?JSON.stringify([z,Oe.key??Oe.message]):void 0})},apps:J===void 0?void 0:{signedIn:(Oe)=>J.signedIn(AbortSignal.any([F,Oe])),read:(Oe)=>J.read(AbortSignal.any([F,Oe])),requestGill:(Oe,he,Re)=>J.requestGill(Oe,he,AbortSignal.any([F,Re])),openUi:(Oe,he)=>J.openUi(Oe,AbortSignal.any([F,he]))},sessions:{...e.sessions,acquire:(Oe,he)=>e.sessions.acquire(Oe,AbortSignal.any([F,he]))},theme:Le(_e.value),presentTheme:(Oe)=>{if(!xe)throw Error("Pane has closed");let he=Symbol();return q.set(he,Oe),K(),{update:(Re)=>{if(xe&&q.has(he))q.set(he,Re),K()},dispose:()=>{if(q.delete(he)&&xe)K()}}},signal:F,onDispose:(Oe)=>{if(xe)le.add(Oe);else Oe()},guardClose:(Oe)=>{if(xe)Z.add(Oe);return()=>{Z.delete(Oe)}},guardQuit:(Oe)=>{if(xe)o.add(Oe);let he=()=>{o.delete(Oe)};return le.add(he),he}},ve=()=>{if(!xe)return;xe=!1,R.abort();let Oe=[],he=(Re)=>{try{Re()}catch(Ze){Oe.push(Ze)}};for(let Re of Pe)he(Re.dismiss);for(let Re of le)he(Re);if(he(V.dispose),ce.node=null,ue.clear(),be.clear(),X.clear(),Y.clear(),q.clear(),_e.clear(),Z.clear(),le.clear(),ee.clear(),oe.clear(),r.get(z)?.kit===te){if(r.delete(z),i.get(E.identity)===z)i.delete(E.identity);n.unregister(z)}if(Oe.length>0)throw AggregateError(Oe,"Pane cleanup failed")},ce={kit:te,title:Jb(E.instance.title),node:null,commandScope:U,viewport:ee,focused:oe,keys:ue,pastes:be,status:X,theme:_e},de=r.get(z);try{if(de===void 0){if(r.set(z,ce),n.register(z,{x:0,y:0,...a},e.minima),E.focus)n.focus(z)}if(ce.node=await E.instance.render(te),!F.aborted){if(r.set(z,ce),de!==void 0)n.focus(z);m()}}catch(Oe){try{ve()}catch(he){throw AggregateError([Oe,he],"Pane mount and cleanup failed",{cause:he})}throw Oe}let Se;return{reconfigure:async(Oe,he)=>{if(Se!==void 0){if(await Se.requestClose?.()===!1)throw Error("Pane close was declined")}else for(let nt of Z)if(!await nt())throw Error("Pane close was declined");let Re=await h(Oe,he===void 0?A:AbortSignal.any([A,he])),Ze=Se;if(Se=Re,Ze!==void 0)await Ze.dispose();else ve()},setVisibility:(Oe)=>{if(Se!==void 0)return Se.setVisibility(Oe);n.setParticipation(z,Oe==="visible")},requestClose:async()=>{if(Se!==void 0)return await Se.requestClose?.()??!0;for(let Oe of Z)if(!await Oe())return!1;return!0},dispose:()=>{if(Se===void 0)ve();else return Se.dispose()}}}let g=Tar({createContainer:({windowId:E})=>({paneId:E}),mount:(E,A,R)=>h(A,R),onFailure:({cause:E})=>{Ai("pane-lifetime",E)}}),_=g.subscribe(m),y=n.subscribe(m);async function x(E,A=!0,R){if(c)return{kind:"refused",reason:"Workspace has closed"};let F=t.get(E.kind)?.instantiate(E);if(F===void 0)return{kind:"refused",reason:"Pane target is not supported"};let z=JSON.stringify([E.kind,F.key]),U=i.get(z);if(U!==void 0){if(A)n.focus(U);return{kind:"focused",paneId:U}}let V=r1o.pane.generate();i.set(z,V),await g.open({windowId:V,instance:F,identity:z,focus:A});let ee=g.read().windows.find((oe)=>oe.windowId===V);if(u()||ee===void 0)return{kind:"refused",reason:"Workspace closed while opening pane"};if(ee.status==="error")throw i.delete(z),await g.close(V),Error("Pane mount failed",{cause:ee.error});if(R!==void 0){let oe=R.afterPaneId===null?-1:n.tiles.indexOf(R.afterPaneId);for(let ue=n.tiles.indexOf(V);oe>=0&&ue>oe+1;ue-=1){let be=n.tiles[ue-1];if(be!==void 0)n.swap(V,be)}d=R.direction==="beside"?"columns":"rows",m()}return{kind:"opened",paneId:V}}async function w(E,A){let R=g.read().windows.find((ee)=>ee.windowId===E);if(c||R===void 0)return{kind:"refused",reason:"Pane has closed"};let F=t.get(A.kind)?.instantiate(A);if(F===void 0)return{kind:"refused",reason:"Pane target is not supported"};let z=JSON.stringify([A.kind,F.key]),U=i.get(z);if(U!==void 0&&U!==E)return{kind:"refused",reason:"That conversation is already open in another pane"};if(z===R.launch.identity)return{kind:"focused",paneId:E};try{await g.reconfigure(E,{windowId:E,instance:F,identity:z,focus:!0})}catch(ee){throw Error("Pane mount failed",{cause:ee})}if(g.read().windows.find((ee)=>ee.windowId===E)?.launch.identity!==z)return{kind:"refused",reason:"Pane closed while preparing replacement"};return i.delete(R.launch.identity),i.set(z,E),m(),{kind:"opened",paneId:E}}let b=()=>r.get(n.order.at(-1)??"");return{toast:e.toast,launchers:e.kinds.flatMap((E)=>E.launcher===void 0?[]:[E.launcher]),open:x,canQuit:async()=>{for(let E of o)if(!await E())return!1;return!0},close:g.close,replace:w,focus:n.focus,swap:n.swap,zoom:n.zoom,toggleZoom:(E)=>{n.zoom(n.zoomed===E?null:E)},resizeBy:(E)=>{let A={layout:d,gap:0};if(n.mainSize!==void 0)A.mainSize=n.mainSize;let F=I7e(n.tiles,n.minima,n.order,a,A).divider;if(F!==null)n.resizeMain(Math.max(F.min,Math.min(F.max,F.position+E)))},resize:(E)=>{n.resizeMain(Math.max(0,E))},equalize:()=>{n.resizeMain(void 0)},setLayout:(E)=>{d=E,m()},cycleLayout:()=>{d=i1o[d],m()},viewport:(E)=>{a=E,m()},read:s.value.read,subscribe:s.value.subscribe,key:(E)=>{if(e.dialogs.open.read()||E.defaultPrevented)return!1;for(let A of b()?.keys??[])if(A(E))return E.preventDefault(),!0;return!1},paste:(E)=>{if(e.dialogs.open.read()||E.defaultPrevented)return;for(let A of b()?.pastes??[])A(E)},dispose:()=>{if(l!==void 0)return l;return c=!0,f.abort(),l=g.dispose().finally(()=>{_(),y(),n.destroy(),s.clear()}),l}}}var r1o,i1o;var Bar=C(async()=>{KC();Aar();Uar();HJ();await Qa();r1o=Wa({family:"tui-pane",version:1,kinds:{pane:{prefix:"tui_pane"}}}),i1o={"main-left":"main-top","main-top":"columns",columns:"rows",rows:"grid",grid:"main-left"}});import{CliRenderEvents as qar}from"@opentui/core";function War(e){return je("box",{width:"100%",height:"100%",position:"relative",children:je(hge,{children:je(o1o,{...e})})})}function o1o(e){let t=md(x7e),n=bw(),r=Ep(),i=e.dialog,o=IA(e.theme,{refreshOnReturnToTerminal:!1}),s=ys(()=>({colors:o.colors,surface:o.surface,syntax:o.syntax,dimForeground:o.dimForeground,nativeDefaults:o.nativeDefaults}),[o.colors,o.surface,o.syntax,o.dimForeground,o.nativeDefaults]),a=RA(),[c]=ti(()=>({theme:nO(s),open:nO(i.isOpen),dialog:{current:i}}));c.dialog.current=i;let[u]=ti(()=>jar({kinds:e.kinds??[...xar,...e.additionalKinds??[]],commands:e.commandHost,viewport:r,minima:{width:40,height:12},sessions:e.sessions,apps:e.apps,theme:c.theme.value,exit:e.exit,toast:a.show,dialogs:{open:c.open.value,show:(...m)=>c.dialog.current.show(...m),dismiss:()=>c.dialog.current.dismiss()},rendering:{afterFrame:(m)=>(n.once(qar.FRAME,m),()=>{n.off(qar.FRAME,m)}),requestFrame:()=>{n.requestRender()},isFocused:(m)=>n.currentFocusedRenderable===m}}));Vn(()=>{c.theme.set(s)},[c,s]),Eh(()=>{c.open.set(i.isOpen)},[c,i.isOpen]),Vn(()=>{u.viewport(r)},[u,r.width,r.height]),Vn(()=>(e.onRegistry(u),()=>{u.dispose().catch((m)=>Ai("pane-workspace-close",m))}),[u,e.onRegistry]);let l={registry:u,host:e.commandHost,dialog:i,colors:o.colors,openPane:e.openPane,toast:a.show};Ear(l),NY((m)=>{u.key(m)}),itr((m)=>{u.paste(m)});let d=ka(u.subscribe,u.read),p=d.length>1,f=d.find((m)=>m.focused)?.presentation??o;return je(o7.Provider,{value:f.colors,children:Gn("box",{width:"100%",height:"100%",position:"relative",children:[d.length===0?je(Vge,{state:"empty",message:"No panes open. Ctrl K: pane commands \xB7 Ctrl C: exit.",colors:f.colors}):null,d.map((m)=>je("box",{position:"absolute",visible:m.visible,border:p&&!m.zoomed&&m.frame.x+m.frame.width<r.width?["right"]:[],borderColor:f.colors.surface,left:m.frame.x,top:m.frame.y,width:m.frame.width,height:m.frame.height,onMouseDown:()=>{u.focus(m.paneId)},children:m.state==="loading"?je(Vge,{state:"loading",message:`Opening ${m.focused?"\u25B8 ":" "}${m.title}${m.zoomed?" \xB7 zoomed":""}\u2026`,colors:f.colors}):m.node},m.paneId)),t,je(_ge,{dialog:i,colors:f.colors})]})})}var Har=C(async()=>{Bc();DCt();Gi();await Pc([s7(),Lh(),bar(),Qa(),kar(),Bar(),SCt()])});function HCt(e){return{commands:e.commands,toolSigils:e.toolSigils,apps:e.apps,paneKinds:e.paneKinds,commandHost:e.commandHost,setQuitGuard:e.setQuitGuard,acquireSession:e.acquireSession,onExit:e.onExit,chooseConversation:e.chooseConversation,openConversation:e.openConversation,initialTheme:e.initialTheme}}function WCt(e){return e.target??{kind:"conversation",agentId:e.session.address,sessionId:e.session.address}}function Gar(e){return JSON.stringify([e.agentId,e.sessionId])}function s1o(e){return e.sessionId===null?{agentId:e.agentId,sessionId:null,createRequestId:e.createRequestId}:{agentId:e.agentId,sessionId:e.sessionId}}function a1o(e){return{clients:e.clients,interactions:e.interactionStore,mcpApprovals:e.mcpApprovals,models:e.modelSource,sandbox:e.sandboxSource,stopAll:e.onStopAll,sessionTitle:e.sessionTitle,folder:e.folder,reload:e.reloadSources,observationUnavailable:e.onObservationUnavailable,rebindService:e.onRebindService,themeName:e.initialTheme,saveTheme:e.onThemeConfirm,themeError:e.themeError,initialError:e.initialCommandError,initialNotice:e.initialCommandNotice,resume:e.onResume,create:e.onNew,forked:e.onForked,inputHandoff:e.inputHandoff}}function Var({entries:e,requested:t,dialog:n,configuration:r,registerDraftCheckpoint:i}){let o=e[0],s=r??(o===void 0?void 0:HCt(o.props));if(s===void 0)throw Error("Workspace requires its host configuration");return je(c1o,{registerDraftCheckpoint:i,initial:s,entries:e,requested:t,dialog:n})}function c1o({initial:e,entries:t,requested:n,dialog:r,registerDraftCheckpoint:i}){let o=Or(void 0);Vn(()=>()=>o.current?.abort(),[]);let[s,a]=ti(e.initialTheme??"terminal"),c=IA(s,{refreshOnReturnToTerminal:!1}),u=Or(s);u.current=s;let l=Or(t);l.current=t;let[d]=ti(()=>e.commandHost??y7e(e.commands)),[p,f]=ti(),m=zc((x)=>{f(x)},[]);Vn(()=>(e.setQuitGuard?.(p?.canQuit),()=>e.setQuitGuard?.(void 0)),[e.setQuitGuard,p]);let[h]=ti(()=>({retired:new WeakSet,contexts:new WeakMap})),g=(x)=>({...x,themeName:u.current,saveTheme:async(w)=>{await x.saveTheme?.(w),u.current=w,a(w)}}),[_]=ti(()=>({registerDraftCheckpoint:i,acquire:async(x,w)=>{if(w.aborted)throw w.reason;let b=l.current.find(({props:z})=>Gar(WCt(z))===Gar(x)&&!h.retired.has(z.session)),E,A;if(b===void 0){let z=e.acquireSession;if(z===void 0)throw Error("That Session is not available through Local");let U=await z(s1o(x),w);E=U.session,A=U.close,h.contexts.set(E,U.context)}else E=b.props.session,A=b.props.onClose;let R=()=>{h.retired.add(E),h.contexts.delete(E);let z=A?.();if(z!==void 0)Promise.resolve(z).catch((U)=>Ai("pane-session-close",U))};if((()=>w.aborted)())R();else w.addEventListener("abort",R,{once:!0});return E},describe:(x)=>{let w=h.contexts.get(x);if(w!==void 0)return g(w);let b=l.current.find((E)=>E.props.session===x)?.props;if(b===void 0)throw Error("Session observation was retired");return g(a1o(b))}}));Vn(()=>{let x=l.current.find((b)=>b.request===n);if(p===void 0||x===void 0)return;(x.props.replacePaneId===void 0?p.open(WCt(x.props),!0,x.props.openPlacement):p.replace(x.props.replacePaneId,WCt(x.props))).then((b)=>{if(b.kind==="refused")p.toast({variant:"error",duration:"until-dismissed",message:b.reason})}).catch((b)=>(Ai("conversation-pane-open",b),p.toast({variant:"error",duration:"until-dismissed",message:b instanceof Error?b.message:"Conversation pane could not open"}),{kind:"refused",reason:"Conversation pane could not open"}))},[p,n]),Vn(()=>()=>{if(e.commandHost===void 0)d.dispose()},[d,e.commandHost]);let y=async(x)=>{let w=x===void 0?void 0:{direction:x,afterPaneId:p?.read().find((U)=>U.focused)?.paneId??null};o.current?.abort();let b=new AbortController;o.current=b;let E=[...e.openConversation===void 0?[]:[{name:"New conversation",description:"Start a conversation in a new pane",open:async(U)=>{U.dismiss(),await e.openConversation?.(w)}}],...e.chooseConversation===void 0?[]:[{name:"Resume conversation",description:"Open a saved conversation",open:async(U)=>{U.dismiss(),await e.chooseConversation?.(w)}}]],A=(p?.launchers??[]).map((U)=>({name:U.name,description:U.description,open:async(V)=>{V.dismiss();let ee=await p?.open(U.target,!0,w);if(ee?.kind==="refused")throw Error(ee.reason)}})),R=e.apps;if(R===void 0||!await R.signedIn(b.signal)){if(b.signal.aborted)return;z("Open pane",[...E,...A]);return}if(b.signal.aborted)return;let F=[...E,...A,{name:"Apps",description:"Open an App pane or hand off to its App",open:async(U)=>{let V=await R.read(b.signal);if(b.signal.aborted||!U.isCurrent())return;let ee=V.apps.flatMap((oe)=>oe.gills.length===0?[{name:oe.displayName??oe.appId,description:"Open in your browser",open:async(ue)=>{ue.dismiss(),await R.openUi(oe.surfaceId,b.signal)}}]:oe.gills.map((ue)=>({name:`${oe.displayName??oe.appId} \xB7 ${ue.title}`,description:oe.availability==="available"?"Open App pane":"Unavailable",open:async(be)=>{be.dismiss();let _e=await p?.open({kind:"gill",surfaceId:oe.surfaceId,viewId:ue.id,title:ue.title},!0,w);if(_e?.kind==="refused")throw Error(_e.reason)}})));if(ee.length===0)throw Error("This Team has no Apps yet");z("Apps",ee)}}];function z(U,V){r.show((ee)=>je(Wp,{title:U,choices:V,searchable:!0,colors:c.colors,onCancel:()=>{b.abort(),ee.dismiss()},onSelect:(oe)=>{let ue=V[oe];if(ue===void 0)return;ue.open(ee).catch((be)=>{if(b.signal.aborted)return{kind:"retired",cause:be};return ee.dismiss(),Ai("pane-picker-open",be),p?.toast({variant:"error",duration:"until-dismissed",message:be instanceof Error?be.message:"The pane could not open"}),{kind:"failed",cause:be}})}}))}z("Open pane",F)};return je($Le.Provider,{value:e.toolSigils,children:je(gge,{children:je(War,{commandHost:d,sessions:_,apps:e.apps,additionalKinds:e.paneKinds,theme:s,exit:()=>e.onExit?.(),onRegistry:m,dialog:r,openPane:y})})})}var Kar=C(async()=>{Bc();wCt();Gi();await Pc([Qa(),Qa(),Har()])});function Jar({sessions:e,onCancel:t,onSelect:n,themeError:r}){let i=b6(),o=Ep(),s=o.height<14,a=K1(o.width),c=Date.now(),u=e.map((l)=>PZ(l.updatedAt,c));return Gn("box",{flexDirection:"column",rowGap:s?0:1,children:[je(Z_,{content:{title:"Resume a conversation",summary:r??"Pick one to continue where you left off."},width:a,compact:s,colors:i}),je(Wp,{searchable:!0,descriptionWrap:!1,descriptionWidth:Math.max(...u.map((l)=>Bun.stringWidth(l)),1),colors:i,choices:e.map((l,d)=>({name:l.title.trim()||"Untitled",description:u[d]})),onCancel:t,onSelect:n})]})}var Qar=C(async()=>{Bc();bf();await Pc([Lh(),xB(),J5(),s7(),pge()])});import{homedir as u1o}from"os";function GCt(e){let t=u1o();return e===t||e.startsWith(`${t}/`)?`~${e.slice(t.length)}`:e}function d1o(e){let t=`${String(e.sessionCount)} conversation${e.sessionCount===1?"":"s"}`;return e.updatedAt===void 0?t:`${t} \xB7 ${new Date(e.updatedAt).toLocaleDateString()}`}function Xar({sessions:e,agents:t=[],notice:n,folder:r,loadSummary:i,choose:o}){let s=b6(),{height:a,width:c}=Ep(),u=t.map(({agentId:_})=>_).join(","),l=Or({agentsKey:u,index:0}),[d,p]=ti("loading");Vn(()=>{let _=new AbortController;return i(_.signal).then((y)=>{if(!_.signal.aborted)p(y)},()=>{if(!_.signal.aborted)p({account:void 0,model:void 0})}),()=>{_.abort()}},[i]);let f=a>=34&&c>=72,m=Math.max(1,Math.min(84,c-4)),h=d!=="loading"&&(d.account!==void 0||d.model!==void 0),g=(_,y,x=!1)=>Gn("box",{flexDirection:"row",height:1,flexShrink:0,children:[je("text",{fg:s.foreground,attributes:2,width:9,flexShrink:0,children:_}),je("text",{fg:s.foreground,attributes:x?2:0,wrapMode:"none",children:gc(br(y),Math.max(0,m-9))})]});return je("box",{flexDirection:"column",height:a,alignItems:"center",paddingX:2,paddingTop:1,backgroundColor:s.background,children:Gn("box",{flexDirection:"column",width:"100%",maxWidth:84,flexShrink:1,flexGrow:1,minHeight:0,children:[Gn("box",{flexDirection:"column",flexShrink:0,children:[f?je("text",{fg:s.primary,alignSelf:"center",children:l1o}):null,je("text",{fg:s.foreground,attributes:2,marginBottom:1,alignSelf:"center",children:f?"Your ideas, growing.":"fungi \xB7 Your ideas, growing."}),d==="loading"?Gn(yk,{children:[g("Account","Checking\u2026",!0),g("Model","Checking\u2026",!0)]}):Gn(yk,{children:[g("Account",d.account??"Not signed in",!h),g("Model",d.model??"None yet",d.model===void 0)]}),g("Folder",GCt(r)),n===void 0?null:je("text",{fg:s.info,marginTop:1,wrapMode:"word",children:br(n)}),d!=="loading"&&!h?je("text",{fg:s.info,marginTop:1,children:"Sign in to start: run fungi login, or type /login in a session."}):null]}),je("box",{flexDirection:"column",flexGrow:1,minHeight:0,marginTop:1,children:t.length>1?je(Wp,{title:"Agents in this folder",colors:s,descriptionWrap:!1,choices:t.map((_)=>({name:zDe(_,t),description:d1o(_)})),hints:[{keys:"Enter",label:"open",priority:0},{keys:"a",label:"archive",priority:1},{keys:"\u2191\u2193",label:"choose",priority:1},{keys:"Esc",label:"quit",priority:2}],onHighlight:(_)=>{l.current={agentsKey:u,index:_}},onKey:(_)=>{if(_.name!=="a"||_.ctrl||_.meta)return!1;return o({kind:"archive",index:l.current.agentsKey===u?l.current.index:0}),!0},onSelect:(_)=>{o({kind:"agent",index:_})},onCancel:()=>{o(void 0)}},`agents-${u}`):je(Wp,{title:e.length===0?"No conversations in this folder yet":"Recent conversations",colors:s,descriptionWrap:!1,choices:[{name:"+ New session",description:"n"},...e.map((_)=>({name:_.title.trim()||"Untitled",description:new Date(_.updatedAt).toLocaleDateString()}))],hints:[{keys:"Enter",label:"open",priority:0},{keys:"n",label:"new session",priority:0},{keys:"\u2191\u2193",label:"choose",priority:1},{keys:"Esc",label:"quit",priority:2}],onKey:(_)=>{if(_.name!=="n"||_.ctrl||_.meta)return!1;return o({kind:"new"}),!0},onSelect:(_)=>{o(_===0?{kind:"new"}:{kind:"resume",index:_-1})},onCancel:()=>{o(void 0)}},"conversations")})]})})}var l1o;var VCt=C(async()=>{Bc();Obt();Gi();e7();ay();await Pc([Lh(),J5(),s7()]);l1o=Nme.replace(/^\n+|\n+$/gu,"")});import{readFile as p1o,realpath as f1o}from"fs/promises";import{basename as m1o,dirname as Yar,join as h1o}from"path";import{createRequire as g1o}from"module";function _1o(e){let t=new AbortController,n=()=>t.signal.aborted,r=!1,{running:i,running:o}=e,s=async()=>{if(await e.policy()==="off"||n())return;let d=wB.parse(await e.installed());if(n())return;if(Bun.semver.order(d,o)>0)e.notify({kind:"restart",version:d}),o=d;let p=wB.parse(await e.registry(t.signal));if(n())return;if(Bun.semver.order(p,d)>0&&Bun.semver.order(p,i)>0)e.notify({kind:"available",version:p}),i=p},a=async()=>{if(r||n())return;r=!0;try{await s()}catch(d){e.reportFailure(d)}finally{r=!1}},c=()=>{a()},l=(e.schedule??((d,p)=>{let f=setInterval(d,p);return f.unref(),()=>{clearInterval(f)}}))(c,600000);return c(),()=>{t.abort(),l()}}function ecr(e){let t=process.env.FUNGI_LAUNCHER;if(t===void 0||m1o(t)!=="fungi.cjs")return()=>{return};let n;return _1o({running:y1o,policy:async()=>{let r=await gB();if(r.error!==void 0)throw Error(r.error);return r.update??"notify"},installed:async()=>{if(n===void 0){await Promise.resolve().then(() => Cge());n=(await WLe()).launcher}let r=await f1o(n);return Zar.parse(JSON.parse(await p1o(h1o(Yar(Yar(r)),"package.json"),"utf8"))).version},registry:BLe,notify:e,reportFailure:(r)=>{Ai("update-check",r)}})}var Zar,y1o;var tcr=C(()=>{qn();dAt();zY();gy();Zar=se({version:wB}),y1o=Zar.parse(g1o(import.meta.url)("../package.json")).version});function x1o(e,t){if(e.kind==="available")return{variant:"info",message:`Fungi ${e.version} is available: run fungi update`};return{variant:"info",message:"Update installed: restart to update",duration:"until-dismissed",action:{label:"Restart to update",run:t}}}function ncr({restart:e,watch:t=ecr}){let n=RA();return Vn(()=>t((r)=>{n.show(x1o(r,e))}),[n,t,e]),null}var rcr=C(async()=>{Gi();tcr();await Qa()});function v1o({store:e}){return Gn(gge,{children:[je(b1o,{store:e}),je(ncr,{restart:e.restartUpdate})]})}function b1o({store:e}){let t=ka(e.subscribe,e.read),n=t.entries,r=IA(t.picker?.initialTheme??t.landing?.initialTheme??t.configuration?.initialTheme??"terminal"),i=NLe();Vn(()=>{let c=t.picker;if(c===void 0)return;let u=i.show((l)=>je(Jar,{...c,onSelect:(d)=>{c.onSelect(d),l.dismiss()},onCancel:l.dismiss}),{onDismiss:()=>{if(e.read().picker===c){let l={...e.read()};delete l.picker,e.update(l)}c.onCancel()}});return()=>{u.dismiss()}},[t.picker,i.show,e]);let o=n!==void 0&&t.queryClient!==void 0,s=o?t.recovery:void 0,a=o?t.serviceUpdated:void 0;if(Vn(()=>{if(s===void 0)return;let c=i.show(()=>je(scr,{...s}),{beforeDismiss:()=>!1});return()=>{c.dismiss()}},[s,i.show]),Vn(()=>{if(a===void 0)return;let c=i.show(()=>je(ocr,{...a}),{onDismiss:()=>{if(e.read().serviceUpdated===a)a.exit()}});return()=>{c.dismiss()}},[a,i.show,e]),n===void 0&&t.recovery!==void 0)return je(o7.Provider,{value:r.colors,children:je(scr,{...t.recovery})});if(n===void 0&&t.serviceUpdated!==void 0)return je(o7.Provider,{value:r.colors,children:je(ocr,{...t.serviceUpdated})});if(n===void 0&&t.landing!==void 0)return je(o7.Provider,{value:r.colors,children:je(Xar,{...t.landing})});if(n===void 0||t.queryClient===void 0)return Gn("box",{flexDirection:"column",flexGrow:1,children:[je(Vge,{state:"loading",message:"Connecting to Local Shiitake\u2026 Ctrl+C to exit.",colors:r.colors}),i.isOpen?je(S1o,{dialog:i,colors:r.colors}):null]});return je(Tut,{client:t.queryClient,children:je(Var,{registerDraftCheckpoint:e.registerCheckpoint,entries:n,configuration:t.configuration,requested:t.requested??0,dialog:i})})}function ocr({message:e,exit:t}){let n=b6(),r=Ep(),i=r.height<14;return Gn("box",{flexDirection:"column",flexGrow:1,rowGap:i?0:1,children:[je(Z_,{content:{title:"Fungi was updated",summary:e},width:K1(r.width),compact:i,colors:n}),je(Wp,{colors:n,choices:[{name:"Exit this window"}],onSelect:t,onCancel:t})]})}function acr(e,t,n){let r=m7(e);r.update({...r.read(),serviceUpdated:{message:t,exit:n}})}function w1o({message:e,retry:t,exit:n}){let r=b6(),i=Ep(),[o,s]=ti(!1),a=i.height<14,c=K1(i.width),u={title:"Connection unavailable",summary:"Your saved conversations are unchanged.",details:[{label:"Error",value:e}]};if(o)return Gn("box",{flexDirection:"column",flexGrow:1,rowGap:a?0:1,focusable:!0,focused:!0,onKeyDown:(l)=>{if(l.name==="d"||l.name==="escape")l.preventDefault(),s(!1)},children:[je(yB,{content:u,width:c,maxRows:i.height-8,colors:r}),je(AA,{hints:[{keys:"d",label:"back",priority:0},{keys:"Esc",label:"back",priority:1}],width:c,colors:r})]});return Gn("box",{flexDirection:"column",flexGrow:1,rowGap:a?0:1,children:[je(Z_,{content:u,width:c,compact:a,colors:r}),je(Wp,{colors:r,choices:[{name:"Retry connection"},{name:"Exit"}],hints:[{keys:"\u2191\u2193",label:"choose",priority:1},{keys:"Enter",label:"select",priority:0},{keys:"d",label:"details",priority:2},{keys:"Ctrl+C",label:"exit",priority:2}],onKey:(l)=>{if(l.name!=="d"||l.ctrl||l.meta||l.option)return!1;return s(!0),!0},onSelect:(l)=>{if(l===0)t();else if(l===1)n()},onCancel:()=>{return}})]})}function scr({error:e,retry:t,exit:n}){let r=b6(),i=Ep();if(!(e instanceof nm))return je(w1o,{message:e.message,retry:t,exit:n});let o=i.height<14;return Gn("box",{flexDirection:"column",flexGrow:1,rowGap:o?0:1,children:[je(Z_,{content:{title:e.reason==="newer"?"This Agent was saved by a newer Fungi":"Fungi cannot read this Agent",summary:e.message},width:K1(i.width),compact:o,full:!0,colors:r}),je(Wp,{colors:r,choices:e.reason==="newer"?[{name:"Exit"}]:[{name:"Start a new Agent"},{name:"Exit"}],onSelect:(s)=>{if(e.reason==="newer")n();else if(s===0)t();else if(s===1)n()},onCancel:n})]})}function ccr(e,t,n,r){let i=m7(e);i.update({...i.read(),recovery:{error:t,retry:n,exit:r}})}function S1o({dialog:e,colors:t}){return je(_ge,{dialog:e,colors:t})}function m7(e){let t=icr.get(e);if(t!==void 0)return t;let n={},r=!1,i,o=Csr(),s=new Set,a={registerCheckpoint:(c,u)=>o.register(c.address,u),checkpointDrafts:o.checkpoint,restartUpdate:async()=>{if(i===void 0)throw Error("Restart is unavailable in this window. Your current draft has not been changed.");await i()},bindUpdateRestart:(c)=>{if(i!==void 0)throw Error("This terminal already owns an update restart action");return i=c,()=>{if(i===c)i=void 0}},read:()=>n,subscribe:(c)=>(s.add(c),()=>{s.delete(c)}),update:(c)=>{if(n=c,!r)r=!0,e.render(je(v1o,{store:a}));for(let u of s)u()}};return icr.set(e,a),a}function ucr(e){m7(e).update({})}function lcr(e,t){return m7(e).bindUpdateRestart(t)}function KCt(e,t){m7(e).checkpointDrafts(t)}function dcr(e,t,n){let r=m7(e),i=r.read(),o=(i.requested??0)+1,s=i.entries?.filter((a)=>a.props.session.address!==n.session.address)??[];r.update({entries:[...s,{props:{...n,onClose:()=>{let a=r.read();return r.update({...a,entries:a.entries?.filter((c)=>c.props.session.address!==n.session.address)??[]}),n.onClose?.()}},request:o}],configuration:i.configuration??HCt(n),queryClient:t,requested:o})}function pcr(e,t){let n=m7(e);n.update({...n.read(),landing:{...t,choose:(r)=>{let i={...n.read()};delete i.landing,n.update(i),t.choose(r)}}})}function fcr(e,t){let n=m7(e);n.update({...n.read(),picker:t})}var icr;var JCt=C(async()=>{Bc();A3();Gi();rge();DCt();await Pc([s7(),aw(),Lh(),PTt(),Kar(),Qar(),xB(),J5(),pge(),MLe(),VCt(),rcr(),RCt()]);icr=new WeakMap});import QCt from"process";import{StringDecoder as E1o}from"string_decoder";function k1o(e){return Buffer.byteLength(e,"utf8")}async function T1o(e=QCt.stdin,t){if(e.isTTY===!0)throw Error("fungi run requires a prompt or piped stdin");let n="",r=0,i=new E1o("utf8"),o=e[Symbol.asyncIterator](),s,a=t===void 0?void 0:new Promise((c,u)=>{s=()=>{let l=t.reason;u(l instanceof Error?l:Error("fungi run cancelled",{cause:l}))},t.addEventListener("abort",s,{once:!0})});try{t?.throwIfAborted();for(;;){let c=o.next(),u=a===void 0?await c:await Promise.race([c,a]);if(u.done===!0)break;let l=Buffer.isBuffer(u.value)?u.value:Buffer.from(u.value);if(r+=l.byteLength,r>hcr)throw Error("fungi run prompt is too large");n+=i.write(l)}}finally{if(s!==void 0&&t!==void 0)t.removeEventListener("abort",s);try{await o.return?.()}catch(c){Ai("one-shot-prompt-iterator-close",c)}}if(n+=i.end(),n.length===0)throw Error("fungi run prompt is empty");return n}function mcr(e){if(e.role!=="assistant")return"";return e.content.filter((t)=>t.type==="text").map((t)=>t.text).join("")}function A1o(e){if(e.kind==="heartbeat"||e.kind==="activity"||e.kind==="progress"||e.kind==="tool_output")return[];return e.kind==="reset"?e.baseline.messages:e.messages}function C1o(e){if(e.kind==="heartbeat"||e.kind==="activity"||e.kind==="progress"||e.kind==="tool_output")return[];return e.kind==="reset"?e.baseline.terminals:e.terminals}function $A(e,t){return e instanceof Error?e:Error(t,{cause:e})}function I1o(e){if(e.length===0)return;let t=e[0];if(e.length===1&&t!==void 0)throw t;throw AggregateError(e,"fungi run failed")}function R1o(e,t){return new Promise((n,r)=>{try{e.write(t,(i)=>{if(i===void 0||i===null)n();else r(i)})}catch(i){r($A(i,"fungi run output failed"))}})}async function D1o(e,t,n){try{await e.watch.close()}catch(r){n($A(r,"fungi run Session watch close failed"))}try{await e.changes.return?.()}catch(r){t.push($A(r,"fungi run Session watch stop failed"))}}function O1o(e,t,n){let{correlatedSequence:r,finalAssistant:i}=e;for(let s of A1o(t)){if(s.commandId===n&&s.value.role==="user"&&(r===void 0||s.sequence<r))r=s.sequence,i=void 0;if(r!==void 0&&s.value.role==="assistant"&&s.commandId===n&&s.sequence>r&&(i===void 0||s.sequence>i.sequence))i=s}let o=e.terminal;for(let s of C1o(t))if(s.commandId===n)o=s;return{correlatedSequence:r,finalAssistant:i,terminal:o}}function gcr(e){if(e.requested)throw Error("fungi run cancelled")}async function P1o(e,t,n){let r={correlatedSequence:void 0,finalAssistant:void 0,terminal:void 0};for await(let i of{[Symbol.asyncIterator]:()=>e}){if(gcr(n),i.kind==="heartbeat"||i.kind==="progress"||i.kind==="tool_output")continue;r=O1o(r,i,t);let o=r.terminal;if(o===void 0)continue;if(o.outcome!=="completed")throw Error(o.outcome==="failed"?$y(o.diagnostic):`fungi run ${o.outcome}`);if(r.finalAssistant===void 0)throw Error("fungi run settled without a durable assistant result");return r.finalAssistant}throw Error(n.requested?"fungi run cancelled":"fungi run Session watch ended before settlement")}async function R7e(e,t={}){let n=t.stdout??QCt.stdout,r=t.signals??QCt,i=t.requestId??GUe(),o=new AbortController,s={requested:!1,accepted:!1,abortStarted:!1},a=t.abortOnSignal??!0,c=[],u,l=()=>{if(s.requested)return;s.requested=!0,d(),o.abort()},d=()=>{if(!s.requested||!a||!s.accepted||s.abortStarted)return;s.abortStarted=!0;try{s.abortPromise=Promise.resolve(e.abort()).then(()=>{return},(f)=>{s.abortFailure=$A(f,"fungi run cancellation abort failed")})}catch(f){s.abortFailure=$A(f,"fungi run cancellation abort failed")}},p=Yh(Ct(function*(){yield*Ra(Gt(()=>{r.on("SIGINT",l),r.on("SIGTERM",l)}),()=>Gt(()=>{r.off("SIGINT",l),r.off("SIGTERM",l)}));let f=t.prompt??(yield*ii({try:()=>T1o(t.stdin,o.signal),catch:(y)=>$A(y,"fungi run prompt failed")}));if(f.length===0)throw Error("fungi run prompt is empty");if(k1o(f)>hcr)throw Error("fungi run prompt is too large");let m=yield*Ra(ii({try:async()=>{let y=await e.watch();return{watch:y,changes:y.changes[Symbol.asyncIterator]()}},catch:(y)=>$A(y,"fungi run watch failed")}),(y)=>cf(()=>D1o(y,c,(x)=>{u=x}))),{changes:h}=m,g=yield*eg(Ct(function*(){let y=yield*ii({try:()=>e.command({type:"prompt",delivery:"followUp",requestId:i,text:f}),catch:(x)=>$A(x,"fungi run prompt failed")});if(y.commandId.length===0)throw Error("fungi run acceptance correlation failed");if(s.accepted=!0,s.requested)d();return y}));gcr(s);let _=yield*ii({try:()=>P1o(h,g.commandId,s),catch:(y)=>$A(y,"fungi run failed")});yield*ii({try:()=>R1o(n,`${n.isTTY===!0?br(mcr(_.value)):mcr(_.value)}
|
|
2248
2248
|
`),catch:(y)=>$A(y,"fungi run output failed")})}));try{await e0(p,{signal:o.signal})}catch(f){c.unshift(s.requested?Error("fungi run cancelled"):$A(f,"fungi run failed"))}if(s.abortPromise!==void 0)await s.abortPromise;if(s.abortFailure!==void 0)c.push(s.abortFailure);if(u!==void 0)c.push(u);I1o(c)}var hcr=262144;var XCt=C(()=>{ay();td();vr();ZB();v7e();gy()});async function _cr(e,t,n,r={}){let[i,o]=await Promise.all([O1(r),t.length>1?null:S_t({models:e,databasePath:t[0]?.databasePath,signal:n})]);return{account:i===void 0?o===null?void 0:`Signed in with ${o.providerId}`:`Fungi \xB7 ${i.team?.name??"no Team chosen"}`,model:o===null?void 0:DZ({provider:o.providerId,model:o.modelId},o.reasoning)}}var ycr=C(async()=>{bf();await vA()});import{pathToFileURL as M1o}from"url";function xcr(e,t,n=!1){return ii({try:async()=>{let r=await Bun.resolve(e,t).catch((o)=>{if(n&&o instanceof Error&&"code"in o&&o.code==="ERR_MODULE_NOT_FOUND")return;throw o});if(r===void 0)return;let i=N1o(await import(M1o(r).href));return aU(i.default)},catch:(r)=>Error(`Client extension unavailable: ${e}`,{cause:r})})}var N1o;var vcr=C(()=>{vr();tr();AR();N1o=en(re({default:Sa}))});function L1o(e,t,n,r,i){return eH(ZW((o)=>Ra(Gt(()=>{let s=()=>{Ax(o)};if(r.addEventListener("abort",s,{once:!0}),r.aborted)s();let a={state:"unknown"},c,u,l=()=>{let m=n?.snapshot().open?.host.snapshot(),h=m?.status==="prompting"||m?.status==="working"&&m.handoff!==void 0?{state:"blocked"}:a.state==="blocked"?a:m?.status==="working"?{state:"working"}:a;if(h.state===c?.state&&h.header===c.header)return;c=h,ch(o,h)},d=()=>{u?.(),u=n?.snapshot().open?.host.subscribe(l),l()},p=n?.subscribe(d),f=Jpt(t,e,(m)=>{a=m,l()},i);return d(),()=>{r.removeEventListener("abort",s),f(),p?.(),u?.()}}),(s)=>Gt(s)),{bufferSize:1,strategy:"sliding"}).pipe(z7t(()=>!r.aborted)))}function bcr(e){return Ct(function*(){let t=(e.clients??[]).map((o)=>aU(o)),n=new Set(t.map((o)=>o.id));if(n.size!==t.length)return yield*it(Error("Duplicate builtin client extension"));let r=e.entries.map((o)=>({entry:o,root:e.invocationRoot})),i=yield*ws(r,({entry:o,root:s})=>xcr(o,s).pipe(mt((a)=>{if(a===void 0)return rt(void 0);if(n.has(a.id))return it(Error(`Duplicate client extension: ${a.id}`));return n.add(a.id),rt(a)}),Cs((a)=>Gt(()=>{e.onError(a);return})))).pipe(Mn((o)=>[...t,...o.filter((s)=>s!==void 0)]),Qy);return{entries:U0(i),attach:(o,s)=>yI(i).pipe(lxe,mt((a)=>ws(a,(c)=>c.attach===void 0?Ln:Yh(Ct(function*(){let u=new AbortController;yield*oh(()=>Gt(()=>{u.abort()}));let l=c.attach?.({activity:L1o(o,e.queryClient,s,u.signal,e.questionExtensionId),signal:u.signal,onError:e.onError});if(l!==void 0)yield*l}).pipe(Wn(Z4))).pipe(zl((u)=>Gt(()=>{if(af(u))return;let l=gu(u);e.onError(l instanceof Error?l:Error("Client extension attachment failed",{cause:u}))})),Qy),{discard:!0})),Wn(Z4),Qy,xm)}})}var wcr=C(()=>{bf();AR();Lc();vr();SS();Wf();_I();vcr()});var Scr;var Ecr=C(()=>{qn();Scr=Ke({error:Ee("App execution unavailable"),reason:un(["exec_isolation_required","execution_not_admitted","artifact_unavailable","disabled"])})});function kcr(e,t){let n=Scr.safeParse(e);if(!n.success||n.data.reason!=="exec_isolation_required"&&n.data.reason!=="disabled")return;return A1n({viewId:t.id,title:t.title,state:"error",rows:[],reason:n.data.reason,error:n.data.reason==="disabled"?`${t.title} is disabled.`:`${t.title} isn't available on this preview.`})}var Tcr=C(()=>{sU();Ecr();sU()});var F1o;var Acr=C(()=>{tr();vr();gS();KY();F1o=$W()([],()=>(e,t,n)=>Un({try:()=>iir(e,n.onExcessProperty==="error"),catch:()=>new gb(t,e,n)}))});var Rcr,Ccr,Icr,YCt,z1o,U1o;var ZCt=C(()=>{Acr();UAt();tr();YLe();Nge();EB();Z5();Nge();EB();Nge();Rcr={artifactRef:XY,digest:Sw,version:Ce.pipe(ot(Jn(1))),byteLength:Zn.pipe(ot(id()),ot(_s(0)),ot(fr(Number.isSafeInteger)))},Ccr=re({...Rcr,mediaType:Bt(["text/html; charset=utf-8","application/vnd.fungi.app-assets+json"])}),Icr=re({...Rcr,mediaType:Be("application/vnd.fungi.app-backend+json")}),YCt={declaration:yt(i7e)},z1o=vn([re({format:Be("fungi-app-v1"),ui:Ccr,backend:Icr,...YCt}),re({format:Be("fungi-app-v1"),ui:Ccr,...YCt}),re({format:Be("fungi-app-v1"),backend:Icr,...YCt})]).pipe(ot(fr((e)=>e.declaration?.api===void 0||("backend"in e),{message:"An App API requires a backend"}))),U1o=ki(z1o)});var j1o,B1o,q1o;var Dcr=C(()=>{tr();KY();j1o=Bt(["durable-facet","region"]),B1o=re({runtime:re({kind:j1o,stateSchema:Zn.pipe(ot(id()),ot(_s(0)))}),compatibilityDate:Ce.pipe(ot(Ka(/^\d{4}-\d{2}-\d{2}$/))),exportName:Ce.pipe(ot(Jn(1))),code:Ce.pipe(ot(Jn(1)))}),q1o=ki(B1o)});var Ocr;var D7e=C(()=>{Z5();Kir();Ocr=Object.freeze({maxBytes:65536})});var Mcr=C(()=>{ZCt();EB();Dcr();D7e()});var eIt=()=>{};var W1o,H1o,G1o;var O7e=C(()=>{tr();Z5();W1o=vn([re({kind:Be("absent")}),re({kind:Be("ambiguous")}),re({kind:Be("unselected"),app:p7,surface:T6}),re({kind:Be("selected"),app:p7,surface:T6,releaseId:k6,currentReleaseId:k6,sequence:Zn.pipe(ot(id()),ot(_s(0))),release:VAt})]),H1o=vn([re({kind:Be("success"),value:dn(W1o)}),re({kind:Be("failure"),failure:re({kind:Be("unavailable")})})]),G1o=yn(H1o,{onExcessProperty:"error"})});var Ncr=C(()=>{eIt();Z5();O7e();D7e()});function P7e(e){return(e.startsWith("/")?e.slice(1):e).replaceAll("-","").replaceAll("_","").replaceAll("1","i").replaceAll("l","i").replaceAll("0","o").replaceAll("5","s").replaceAll("3","e")}var Q1o;var Lcr=C(()=>{tr();Z5();Q1o=re({platformRoutes:dn(re({appId:kB,stableRoute:YY})),structuralRoutes:dn(YY)}).pipe(ot(fr((e)=>{let t=e.platformRoutes.map(({stableRoute:n})=>P7e(n));return new Set(t).size===t.length},{message:"Platform route assignments conflict"})),ot(fr((e)=>{let t=new Set(e.structuralRoutes.map(P7e));return!e.platformRoutes.some(({stableRoute:n})=>t.has(P7e(n)))},{message:"Platform route assignments conflict with structural routes"})))});var Fcr=C(()=>{Lcr();O7e()});var $cr=C(()=>{O7e();Z5()});var zcr=()=>{};var Ucr=C(()=>{Mcr();eIt();Z5();D7e();Ncr();Fcr();$cr();zcr();Z5()});var jcr,X1o,Bcr,qcr,M7e,Wcr,Y1o,Hcr,Gcr,Z1o,exo,txo,nxo,rxo,Vcr,ixo,tIt,oxo,sxo,axo,usc;var Kcr=C(()=>{tr();ZCt();KY();Ucr();sU();qn();jcr=or(()=>Nt([Ke({kind:Ee("default"),appId:D().min(1)}),Ke({kind:Ee("installation"),installationId:D().min(1)})])),X1o=or(()=>Ke({requestId:D().min(1),address:jcr,authorityVersion:et().int().positive(),state:un({unaffected:"unaffected",pending:"pending",applied:"applied",expired:"expired"}),outstanding:et().int().nonnegative()})),Bcr=Ke({address:jcr,installationId:D().min(1).nullable(),surfaceId:D().min(1),appId:D().min(1),displayName:D().trim().min(1).optional(),icon:D().min(1).nullable().optional(),releaseId:D().min(1).nullable(),authorityVersion:et().int().nonnegative(),enforcement:X1o.nullable(),handlers:Ge(Ee("file.open")),roles:Ge(D().min(1)),declaredCapabilities:Ge(D().min(1)),calls:Ve().transform((e)=>en(r7e)(e)).optional(),commands:Ge(Ve()).transform((e)=>e.map((t)=>en(n7e)(t))),gills:Ge(Ve()).transform((e)=>e.map((t)=>en(DIe,{onExcessProperty:"error"})(t))),availability:un({available:"available",unavailable:"unavailable"}),surface:Ke({stableRoute:D().min(1)}).nullable(),surfacePath:D().startsWith("/")}),qcr=Ke({surfaceId:D().min(1).nullable(),chosen:Tn()}),M7e=e_(Wu(Sw)),Wcr=e_(Wu(t7e)),Y1o=et().int().positive(),Hcr=Ge(D().min(1)).refine((e)=>new Set(e).size===e.length,"Operations must be unique").readonly(),Gcr=We(D().min(1),D().min(1)).readonly(),Z1o=Ke({kind:D().min(1),id:D().min(1)}).readonly(),exo=Ke({capability:Wcr,capabilityApproved:Ee(!0),operations:Hcr,fingerprints:Gcr,resources:Nt([Ee("tenant-scope"),Ge(Z1o).readonly()])}).readonly(),txo=Ke({authorityVersion:et().int().positive(),declaredOperationsDigest:M7e,approvedGrants:Ge(exo).refine((e)=>new Set(e.map((t)=>t.capability)).size===e.length,"Capabilities must be unique").refine((e)=>e.every((t)=>{let n=Object.keys(t.fingerprints);return n.length===t.operations.length&&t.operations.every((r)=>n.includes(r))}),"Every approved operation needs exactly one fingerprint").readonly(),approval:Ke({by:XLe,at:et().int().nonnegative(),authorityVersion:Y1o}).readonly().nullable()}),nxo=Ke({artifactDigest:M7e,digest:M7e,capabilities:Ge(Ke({capability:Wcr,operations:Hcr,fingerprints:Gcr}).readonly()).readonly()}),rxo=Ke({authority:txo.nullable(),declaredOperations:nxo,artifactDigest:M7e,canEdit:Tn()}),Vcr=or(()=>Ke({actorIsTeamOwner:Tn(),needsUpdate:Ge(Ke({installationId:D().min(1).nullable(),appId:D().min(1).nullable(),displayName:D().min(1)})).optional(),apps:Ge(Bcr.extend({override:Ke({appId:D().min(1).optional(),releaseId:D().min(1),surfaceRoute:D().min(1).nullable()}).nullable(),permission:rxo.nullable()})),roles:We(D().min(1),qcr)})),ixo=or(()=>Ge(Ke({key:D().max(64),label:D().max(256),kind:un(["computer","repository","branch"]),required:Tn(),options:D().max(256).optional()})).max(4).refine(Wu(uut),"Invalid Gill placement parameters")),tIt=Ke({view:Ee("rows"),id:D().trim().min(1).max(256),title:D().trim().min(1).max(256),params:ixo.optional(),desktop:Ke({sizes:Ge(un({S:"S",M:"M",L:"L"})).min(1).max(3).refine((e)=>new Set(e).size===e.length,"Repeated Gill size")}).optional()}),oxo=ts("view",[tIt,tIt.omit({params:!0}).extend({view:Ee("surface"),desktop:tIt.shape.desktop.unwrap()})]),sxo=Bcr.pick({surfaceId:!0,appId:!0,displayName:!0}).extend({gills:Ge(oxo).max(16)}),axo=or(()=>Ke({apps:Ge(sxo).max(50),roles:Ke({inbox:qcr.optional()})})),usc=or(()=>Nt([axo,Ke({error:D()})]))});async function Jcr(e={}){let t={...e,credentialPath:e.credentialPath??is().credentialPath},n=await O1(t);if(n?.team===void 0)throw Error("Sign in to Fungi and choose a Team to view its Apps");let{team:r,issuer:i}=n,o=new URL(n.issuer).origin,s=`/api/teams/${encodeURIComponent(r.teamId)}`,a=MQ(o,t);async function c(){let l=await O1(t);if(l?.issuer!==i||l.team?.teamId!==r.teamId)throw Error("The selected Fungi Team changed; reopen the App pane")}async function u(l){await c();let d=await a(`${o}${s}/local/apps`,{signal:l??null});if(!d.ok)throw await d.body?.cancel(),Error(`App directory refused with HTTP ${String(d.status)}`);let p=await d.json();return await c(),l?.throwIfAborted(),Vcr.parse(p)}return{team:r,read:u,async surfaceUrl(l,d){let f=(await u(d)).apps.find((h)=>h.surfaceId===l);if(f?.availability!=="available"||f.surface===null||f.releaseId===null)throw Error("That App is not available in the selected Team");let m=new URL(f.surfacePath,o);if(m.origin!==o)throw Error("The App surface is not on the selected Hub");return m.searchParams.set("authorityVersion",String(f.authorityVersion)),m.searchParams.set("releaseId",f.releaseId),m.searchParams.set("surfaceRoute",f.surface.stableRoute),await c(),m},async openSession(l,d){await c(),d.throwIfAborted();let p=Object.assign(async(h,g)=>(await c(),d.throwIfAborted(),a(h,{...g,signal:AbortSignal.any([d,...g?.signal?[g.signal]:[]])})),{preconnect:globalThis.fetch.preconnect});class f extends DX{constructor(h){super(h,{fetch:p})}}let m=iU({baseUrl:`${o}${s}/local/agents/${encodeURIComponent(l.agentId)}`,fetch:p,eventSource:f});try{let h=m.session(l.sessionId);return await h.read(),await c(),d.throwIfAborted(),{session:h,close:m.close}}catch(h){throw await m.close(),Error("The selected Team Session could not be opened",{cause:h})}},async requestGill(l,d,p){let m=(await u(p)).apps.find((x)=>x.surfaceId===l),h=m?.gills.find((x)=>x.id===d.viewId);if(m===void 0||h===void 0||m.availability!=="available"||m.releaseId===null)throw Error("That Gill is not available in the selected Team");let g=m.address.kind==="default"?`default/${encodeURIComponent(m.address.appId)}`:encodeURIComponent(m.address.installationId),_=new URL(`${s}/apps/${g}/gills`,o);if(_.searchParams.set("authorityVersion",String(m.authorityVersion)),_.searchParams.set("releaseId",m.releaseId),m.surface!==null)_.searchParams.set("surfaceRoute",m.surface.stableRoute);await c();let y=await R1n({decodeRefusal:kcr,endpoint:_.href,fetch:a,declaration:h}).request(d,p);return await c(),p?.throwIfAborted(),y}}}var Qcr=C(async()=>{Tcr();fbt();ny();j_();Kcr();sU();await JE()});import{spawn as cxo}from"child_process";function uxo(e){return new Promise((t,n)=>{let r=cxo(process.platform==="darwin"?"open":"xdg-open",[e.href],{stdio:"ignore"});r.once("error",(i)=>{n(Error("The App could not open in your browser",{cause:i}))}),r.once("exit",(i)=>{if(i===0)t();else n(Error("The browser launcher did not open the App"))})})}function Xcr(e,t=()=>Jcr({credentialPath:e})){let n,r=()=>n??=t().catch((o)=>{throw n=void 0,o});return{apps:{signedIn:async()=>(await O1({credentialPath:e}))?.team!==void 0,read:async(o)=>(await r()).read(o),requestGill:async(o,s,a)=>(await r()).requestGill(o,s,a),openUi:async(o,s)=>uxo(await(await r()).surfaceUrl(o,s))},openSession:async(o,s)=>(await r()).openSession(o,s)}}var Ycr=C(async()=>{await Pc([vA(),Qcr()])});function Zcr(e,t,n){return[{id:"archive",title:"Archive an Agent",category:"Conversation",description:"Hide an Agent from this folder's lists; keep its conversations and files.",projections:{palette:{},help:{},slash:{aliases:["archive"],consumesDraft:!0}},handler:async({interaction:r})=>{if(r===void 0)throw Error("Archiving an Agent needs a person.");let{agents:i}=await t.discover(e,{signal:r.signal});if(i.length===0){r.notify({type:"info",message:"No Agents to archive."});return}if(i.length>256)throw Error("Use fungi agents list, then fungi agents archive <agent-id>.");let o=await r.prompt({type:"choice",message:"Archive which Agent?",summary:"Its conversations and files stay.",options:i.map((c)=>({value:c.agentId,label:nIt(c),description:lxo(c.sessionCount)}))}),s=i.find((c)=>c.agentId===o);if(s===void 0)throw Error("Choose a listed Agent.");if(!await r.prompt({type:"confirmation",message:`Archive ${eq(nIt(s),40)}?`,summary:"Its conversations and files stay. You can restore it later.",facts:[{label:"Chats",value:String(s.sessionCount)}],details:[{label:"Agent ID",value:o}],confirmLabel:"Archive",cancelLabel:"Keep Agent",destructive:!0}))return{cancelled:!0};await r.run(()=>t.archive({invocationRoot:e,agentId:o,archived:!0},{signal:r.signal})),r.notify({type:"success",message:`Archived ${nIt(s)}. Restore with fungi agents unarchive ${o}.`});return}},{id:"extensions",title:"Manage extensions",category:"Settings",description:"List, add, remove, enable or disable installed extensions and skills.",projections:{palette:{},help:{},slash:{aliases:["extensions"],consumesDraft:!0}},handler:async({interaction:r})=>{if(r===void 0)throw Error("Managing extensions needs a person.");await dxo(e,r,n)}}]}async function dxo(e,t,n){let r=["list","add","remove","enable","disable"],i=await t.prompt({type:"choice",message:"Manage extensions",summary:"Extensions add tools, programs and skills to your Agents.",options:[{value:"list",label:"List installed extensions"},{value:"add",label:"Add an extension",description:"Install trusted code from Git, npm or a local path"},{value:"remove",label:"Remove an extension"},{value:"enable",label:"Enable an extension or its skills"},{value:"disable",label:"Disable an extension or its skills"}]}),o=r.find((l)=>l===i);if(o===void 0)throw Error("Choose a listed action.");let s=n(),a={...s,add:(...l)=>t.run(()=>s.add(...l)),list:(...l)=>t.run(()=>s.list(...l)),remove:(...l)=>t.run(()=>s.remove(...l)),enableProject:(...l)=>t.run(()=>s.enableProject(...l)),disableProject:(...l)=>t.run(()=>s.disableProject(...l)),enableAgent:(...l)=>t.run(()=>s.enableAgent(...l)),disableAgent:(...l)=>t.run(()=>s.disableAgent(...l)),enableAgentSkills:(...l)=>t.run(()=>s.enableAgentSkills(...l)),disableAgentSkills:(...l)=>t.run(()=>s.disableAgentSkills(...l))},c=[];if(o==="add")c.push(await t.prompt({type:"text",message:"Add an extension",summary:"Extensions run inside Fungi with access to every Agent.",placeholder:"Git URL, npm package or folder path"}));else if(o!=="list"){let l=await a.list();if(l.length===0){t.notify({type:"info",message:"No extensions installed."});return}if(l.length>256)throw Error("Use fungi extension list to manage this many extensions.");if(o==="enable"||o==="disable")c.push(await t.prompt({type:"choice",message:o==="enable"?"Turn it on where?":"Turn it off where?",options:[{value:"project",label:"This folder's client and programs"},{value:"agent",label:"This folder's Agent tools"},{value:"skills",label:"This folder's Agent skills"}]}));let d=await t.prompt({type:"choice",message:o==="remove"?"Remove which extension?":"Which extension?",options:l.map((p)=>({value:p.id,label:p.id,description:p.version}))});if(o==="remove"&&!await t.prompt({type:"confirmation",message:`Remove ${eq(d,40)}?`,summary:"It stops working in every folder where it was turned on.",details:[{label:"Extension",value:d}],confirmLabel:"Remove",cancelLabel:"Keep extension",destructive:!0}))return;c.push(d)}let u="";await W8e({action:o,arguments:c,cwd:e,stdout:{write:(l)=>{u+=l}},confirm:(l)=>t.prompt({type:"confirmation",message:l,confirmLabel:"Add skills",cancelLabel:"Skip"})},a),t.notify({type:o==="list"?"info":"success",message:u.trim()})}var nIt=(e)=>e.name??"Unnamed Agent",lxo=(e)=>`${String(e)} conversation${e===1?"":"s"}`;var eur=C(()=>{bf();H8e()});function rIt(e){let t=new Map;for(let r of e)t.set(r.kind,(t.get(r.kind)??0)+1);let n=[...t.entries()].sort(([r],[i])=>r.localeCompare(i)).map(([r,i])=>`${String(i)} ${r}`).join(", ");return`Skipped ${String(e.length)} saved conversation${e.length===1?"":"s"} (${n}).`}function N7e(e){if(e.connect!==void 0)throw Error("--connect is unavailable; fungi uses the persistent Local service");if(e.listen!==void 0)throw Error("--listen is unavailable until the shared Local service exposes client sharing");if(e.providerId!==void 0||e.modelId!==void 0||e.reasoning!==void 0)throw Error("Session model selection requires the shared Local preference contract")}async function tur(e){let{options:t,serviceManager:n,renderPicker:r,root:i,theme:o,signal:s,destroyed:a,onNotice:c}=e;if(t.sessionChoice!==void 0)return t.sessionChoice.resume({signal:s,fungiMcp:t.fungiMcp,mode:t.mode});if((t.entry==="landing"||t.entry==="new")&&!t.resume){let d=()=>(e.discoverSessions??n.discover)(t.invocationRoot,{signal:s}),p=await d();if(p.problems.length>0)c(rIt(p.problems));let f=()=>p.agents.filter((y)=>y.unreadable===void 0),m=f().length>1?void 0:f()[0],h=()=>{let y=m?.databasePath;if(y===void 0){if(f().length>1)throw new Tj(f().map((x)=>x.agentId));return n.connect({invocationRoot:t.invocationRoot,mode:t.mode,fungiMcp:t.fungiMcp},{signal:s})}return n.createSession({invocationRoot:t.invocationRoot,databasePath:y,requestId:iIt.request.generate(),mode:t.mode,fungiMcp:t.fungiMcp},{signal:s})};if(t.entry==="new")return h();if(a())return;let g=(y,x,w)=>new Promise((b)=>{let E=()=>{A(void 0)},A=(R)=>{s.removeEventListener("abort",E),b(R)};if(s.addEventListener("abort",E,{once:!0}),s.aborted){E();return}e.renderLanding(i,y,t.invocationRoot,A,o,x,w)}),_;for(;;){let y=m===void 0?[]:p.sessions,x=await g(y,p.agents,_);if(_=void 0,x?.kind==="archive"){let b=p.agents[x.index];if(b===void 0||s.aborted||a())return;try{await n.archive({invocationRoot:t.invocationRoot,agentId:b.agentId,archived:!0},{signal:s})}catch(E){if(E instanceof Error&&E.name==="AbortError")throw E;_=E instanceof Error?E.message:"The Agent could not be archived"}p=await d(),m=f().length>1?void 0:f()[0];continue}if(x?.kind==="agent"){let b=p.agents[x.index];if(b===void 0)return;if(b.unreadable!==void 0){_=b.unreadable;continue}if(m=b,y=p.sessions.filter((E)=>E.databasePath===b.databasePath),x=a()?void 0:await g(y,[b]),x===void 0&&!a()&&!s.aborted){m=void 0;continue}}if(x===void 0||a())return;if(x.kind==="new")return h();if(x.kind==="agent")return;let w=y[x.index];if(w===void 0)return;return w.resume({signal:s,fungiMcp:t.fungiMcp,mode:t.mode})}}let u=t.databasePath===void 0&&t.connect===void 0&&(t.resume||t.sessionId===void 0)?await(e.discoverSessions??n.discover)(t.invocationRoot,{signal:s}):void 0;if(u!==void 0&&(t.resume||u.agents.length>1)){if(u.problems.length>0)c(rIt(u.problems));let d=u.sessions[0];if(d===void 0)throw Error(u.problems.length>0?rIt(u.problems):"No saved conversations in this folder");if(N7e(t),t.last)return d.resume({signal:s,fungiMcp:t.fungiMcp,mode:t.mode});if(a())return;let p=await new Promise((f)=>{let m=()=>{h(void 0)},h=(g)=>{s.removeEventListener("abort",m),f(g)};if(s.addEventListener("abort",m,{once:!0}),s.aborted){m();return}r(i,u.sessions,(g)=>{h(u.sessions[g])},()=>{h(void 0)},o)});if(p===void 0||a())return;return p.resume({signal:s,fungiMcp:t.fungiMcp,mode:t.mode})}if(t.connect!==void 0)throw Error("--connect is unavailable; fungi uses the persistent Local service");if(t.listen!==void 0)throw Error("--listen is unavailable until the shared Local service exposes client sharing");N7e(t);let l=t.databasePath===void 0?{invocationRoot:t.invocationRoot,fungiMcp:t.fungiMcp,sessionId:t.sessionId,mode:t.mode}:{invocationRoot:t.invocationRoot,fungiMcp:t.fungiMcp,databasePath:t.databasePath,sessionId:t.sessionId,mode:t.mode};return n.connect(l,{signal:s})}var iIt;var oIt=C(async()=>{KC();await aw();iIt=Wa({family:"tui-session-create-request",version:1,kinds:{request:{prefix:"request"}}})});import{homedir as pxo}from"os";async function rur(e,t,n,r=pxo()){let i=H3(r),{terminal:o,root:s,commands:a,queryClient:c,serviceManager:u,theme:l}=n,d=await e0(Xh()),p=Xcr(i),f,m=[],h,g=new Set,_=!1,y=await e0(t.prepareClientExtensions({invocationRoot:e.invocationRoot,entries:e.extensions??[],clients:e.clients,questionExtensionId:e.questionExtensionId,queryClient:c,onError:(Le)=>{if(n.onDiagnostic(Le),o.destroyed())return;let J=`Client extension: ${Le.message}`;if(g.size===0)m.push(J);else for(let te of g)te.interactionStore.report({tone:"error",message:J})}}).pipe(_m(d))),x=await e0(y.entries),w,b,E,A=Promise.withResolvers(),R,F,z=()=>w!==void 0,U=(Le=!1)=>{if(!Le&&t.automaticInstalledRestart===!1||o.destroyed()||h===void 0||z()||t.checkInstalledUpdate===void 0)return Promise.resolve(!1);return R??=(async()=>{let J=h,te=[J,...[...g].filter((ce)=>ce!==J)],ve=await t.checkInstalledUpdate?.(te.map(({host:ce})=>({invocationRoot:e.invocationRoot,sessionId:ce.sessionId})));if(o.destroyed()||h!==J||z()||g.size!==te.length||ve===void 0)return!1;if(ve.kind==="restart"&&n.restartInstalledUpdate!==void 0)return t.checkpointDrafts(s,te.map(({host:ce})=>ce.session.address)),n.restartInstalledUpdate(ve),o.setQuitGuard(void 0),o.exit(),!0;return!1})().finally(()=>{R=void 0}),R},V=lcr(s,async()=>{if(!await U(!0)||!o.destroyed())throw Error("The installed update is not ready to restart. Keep this window open and try again.")}),ee=()=>{if(t.automaticInstalledRestart===!1||t.checkInstalledUpdate===void 0||o.destroyed())return;F=setTimeout(()=>{U().catch((Le)=>{n.onDiagnostic(Rd(Le,"Installed update restart check failed"))}).finally(ee)},1000)};o.setExitHandler(()=>{A.resolve(void 0)});let oe=!1,ue=(Le)=>{oe=!0,o.inputHandoff?.pause(),t.renderServiceUpdated(s,Le.message,o.exit)},be=(Le)=>e0(bs(Le,wa)),_e=(Le)=>tur({options:Le,serviceManager:u,discoverSessions:t.discoverSessions,renderPicker:(...J)=>{o.inputHandoff?.pause(),t.renderPicker(...J)},renderLanding:(...J)=>{o.inputHandoff?.pause(),t.renderLanding(...J)},root:s,theme:l(),signal:o.signal,destroyed:o.destroyed,onNotice:(J)=>{f=J}}),q=async(Le,J,te)=>{let ve=await e0(Ra(ii({try:Le,catch:(de)=>Rd(de,"Session selection failed")}),(de)=>ii({try:()=>de?.close()??Promise.resolve(),catch:(Se)=>Rd(Se,"Selected client close failed")}).pipe(Mp)).pipe(_m(J)));if(ve===void 0||o.destroyed()||te.aborted)return;if(g.size===0)o.inputHandoff?.capture();let ce=await e0(Ra(Gt(qK),(de)=>Gt(de.close)).pipe(_m(J)));return{host:ve,scope:J,interactionStore:ce}},K=(Le,J,te)=>{if(w!==void 0||o.destroyed())return Promise.reject(Error("Another Local transition is already pending"));return w=(async()=>{let ve=await e0(sne(d,"sequential")),ce=!1,de;try{let Se=await q(Le,ve,o.signal);if(Se===void 0)return;let{host:Oe,interactionStore:he}=Se,Re=[...g].find((nt)=>nt.host.agentId===Oe.agentId&&nt.host.sessionId===Oe.sessionId);if(Re!==void 0){h=Re,le(Re,J,te);return}let Ze=h;h=Se,g.add(Se),_=!0;try{le(Se,J,te)}catch(nt){throw h=Ze,g.delete(Se),nt}if(ce=!0,!o.destroyed())await e0(y.attach(Oe.session,he).pipe(_m(ve)))}catch(Se){if(Se instanceof t6){if(!o.destroyed())ue(Se);return}throw de=Rd(Se,"Session selection failed"),de}finally{if(!ce)await be(ve).catch((Se)=>{throw C6(de,[Rd(Se,"Candidate client cleanup failed")])})}})().finally(()=>{w=void 0}),w.catch((ve)=>{Ai("session-selection-callback",ve)}),w},X=async(Le,J,te)=>{let ve=b??=iIt.request.generate();await K(()=>u.createSession({invocationRoot:e.invocationRoot,databasePath:Le,requestId:ve,fungiMcp:e.fungiMcp},{signal:o.signal}),J,te),b=void 0},Y=async(Le)=>{if(o.destroyed())return;let J=h??[...g].at(-1);if(J===void 0)throw Error("No conversation is open to start from");await X(J.host.databasePath,void 0,Le)},fe=(Le)=>{let{host:J}=Le,te=()=>!o.destroyed()&&g.has(Le),ve=!1,ce=async(de)=>{if(!te())return;await X(J.databasePath,de)};return{folder:GCt(e.invocationRoot),onStopAll:async()=>{if(!te())throw Error("The selected Agent changed.");return J.stopAll()},acquireSession:Z,apps:p.apps,paneKinds:e.paneKinds,commandHost:o.commandHost,setQuitGuard:o.setQuitGuard,target:{kind:"conversation",agentId:J.agentId,sessionId:J.sessionId},onClose:async()=>{if(!g.delete(Le))return;if(h===Le)h=void 0;await be(Le.scope)},openConversation:Y,chooseConversation:(de)=>K(()=>_e({...e,mode:void 0,sessionId:void 0,databasePath:void 0,resume:!0,last:!1}),void 0,de),interactionStore:Le.interactionStore,clients:x,inputHandoff:o.inputHandoff,initialCommandError:[e.initialCommandError,...m].filter((de)=>de!==void 0).join(`
|
|
2249
2249
|
`)||void 0,initialCommandNotice:f,sessionTitle:async(de)=>(await(t.discoverSessions??u.discover)(e.invocationRoot,{signal:de})).sessions.find((Se)=>Se.sessionId===J.sessionId)?.title,modelSource:{account:n.account,identity:J.session.address,models:(de)=>u.models({signal:de}),effectiveModel:(de)=>J.effectiveModel({signal:de}),modelPreference:J.session.modelPreference},sandboxSource:{identity:JSON.stringify([J.agentId,J.sessionId]),read:(de)=>J.sandboxStatus({signal:de}),setMode:async(de,Se)=>{if(!te())throw Error("The selected Agent changed.");Se.throwIfAborted(),await(await u.connect({invocationRoot:e.invocationRoot,databasePath:J.databasePath,sessionId:J.sessionId,mode:de,fungiMcp:e.fungiMcp},{signal:Se})).close()},rules:{list:(de)=>Promise.resolve().then(()=>(de.throwIfAborted(),Efe(e.invocationRoot,"list"))),remove:(de,Se)=>Promise.resolve().then(()=>{if(!te())throw Error("The selected Agent changed.");return Se.throwIfAborted(),Efe(e.invocationRoot,"remove",de)})}},reloadSources:fxo,onResume:async(de)=>{if(!te())return;await K(()=>_e({...e,mode:void 0,databasePath:void 0,sessionId:void 0,resume:!0,last:!1}),de)},onNew:(de)=>ce(de),onForked:async(de,Se)=>{if(!te())return;await K(()=>_e({...e,mode:void 0,databasePath:J.databasePath,sessionId:de}),Se)},onRebindService:(de)=>J.rebind({signal:de}),onObservationUnavailable:async()=>{if(!te()||ve)return!te();ve=!0;try{if(await U())return!0;return await u.status(),!te()}catch(de){if(de instanceof t6){if(te())ue(de);return!0}return n.onDiagnostic(Rd(de,"Service protocol check failed")),!1}finally{ve=!1}}}},G=(Le)=>{let J=fe(Le),te=l();return{agentName:"Shiitake",folder:J.folder,clients:J.clients,interactions:J.interactionStore,models:J.modelSource,sandbox:J.sandboxSource,stopAll:J.onStopAll,sessionTitle:J.sessionTitle,reload:J.reloadSources,observationUnavailable:J.onObservationUnavailable,rebindService:J.onRebindService,themeName:te.initialTheme,saveTheme:te.onThemeConfirm,themeError:te.themeError,initialError:J.initialCommandError,initialNotice:J.initialCommandNotice,resume:J.onResume,create:J.onNew,forked:J.onForked,inputHandoff:J.inputHandoff}},Z=async(Le,J)=>{if(Le.sessionId!==null&&![...g].some((Se)=>Se.host.agentId===Le.agentId)){if(!(await(t.discoverSessions??u.discover)(e.invocationRoot,{signal:J})).sessions.some((Oe)=>Oe.sessionId===Le.sessionId)){let Oe=await p.openSession({agentId:Le.agentId,sessionId:Le.sessionId},J);return{session:Oe.session,close:Oe.close,context:{themeName:l().initialTheme,themeError:l().themeError,saveTheme:l().onThemeConfirm,reload:[nur],clients:x,interactions:qK()}}}}let te=await e0(sne(d,"sequential")),ve=!1,ce,de;try{let Se=[...g].find((nt)=>nt.host.agentId===Le.agentId),he=await q(async()=>{if(Se!==void 0){if(Le.sessionId===null)return u.createSession({invocationRoot:e.invocationRoot,databasePath:Se.host.databasePath,requestId:Le.createRequestId,fungiMcp:e.fungiMcp},{signal:J});return u.connect({invocationRoot:e.invocationRoot,databasePath:Se.host.databasePath,sessionId:Le.sessionId,fungiMcp:e.fungiMcp},{signal:J})}let tt=(await(t.discoverSessions??u.discover)(e.invocationRoot,{signal:J})).sessions.find((kt)=>kt.sessionId===Le.sessionId);if(tt===void 0)throw Error("That Session is not available through Local");return tt.resume({signal:J,fungiMcp:e.fungiMcp})},te,J);if(he===void 0)throw Error("Pane Session acquisition was cancelled");if(he.host.agentId!==Le.agentId)throw Error("Local returned a different Agent for this Session");if(Le.sessionId!==null&&he.host.sessionId!==Le.sessionId)throw Error("Local returned a different Session");ce=he,g.add(he),await e0(y.attach(he.host.session,he.interactionStore).pipe(_m(te)));let Re=G(he),Ze=fe(he).onClose;return ve=!0,{session:he.host.session,context:Re,close:Ze}}catch(Se){throw de=Rd(Se,"Pane Session acquisition failed"),de}finally{if(!ve){if(ce!==void 0)g.delete(ce);await be(te).catch((Se)=>{throw C6(de,[Rd(Se,"Pane Session cleanup failed")])})}}},le=(Le,J,te)=>{t.render(s,c,Le.host.session,a,o.exit,l(),{...fe(Le),replacePaneId:J,openPlacement:te}),m.length=0},Pe=a.contribute({sourceId:"local-management",namespace:"local",commands:Zcr(e.invocationRoot,u,()=>xL({home:r}))});try{let Le=e;while(!o.destroyed())try{t.renderConnecting(s),await K(()=>_e(Le));break}catch(ve){if(Ai("session-connect-recovery",ve),o.destroyed())break;if(o.inputHandoff?.pause(),!await new Promise((de,Se)=>{let Oe=(Re)=>{o.signal.removeEventListener("abort",he),de(Re)},he=()=>{Oe(!1)};o.signal.addEventListener("abort",he,{once:!0});try{t.renderRecovery(s,Rd(ve,"Connection unavailable"),()=>{if(ve instanceof nm)Le={...e,databasePath:void 0,sessionId:void 0,sessionChoice:void 0,connect:void 0,resume:!1,last:!1,entry:"new"};Oe(!0)},o.exit)}catch(Re){o.signal.removeEventListener("abort",he),Se(Rd(Re,"Connection recovery display failed"))}}))break;o.inputHandoff?.capture()}let J=()=>_,te=()=>oe;if(!J()&&!te())o.exit();if(ee(),!o.destroyed())await A.promise}catch(Le){if(!o.destroyed())E=Rd(Le,"Local TUI failed")}finally{if(V(),Pe.dispose(),F!==void 0)clearTimeout(F);o.exit(),o.setExitHandler(void 0)}let xe=[];try{await w}catch(Le){if(!o.signal.aborted)xe.push(Rd(Le,"Session transition failed"))}try{await be(d)}catch(Le){xe.push(Rd(Le,"Selected client cleanup failed"))}if(E!==void 0||xe.length>0)throw C6(E,xe)}var nur,fxo;var iur=C(async()=>{eur();kfe();fme();bf();vr();cc();a_();gy();v7e();await Pc([Ycr(),vA(),aw(),JCt(),oIt(),VCt()]);nur={name:"client extensions",effect:"unsupported",reason:"loaded once at startup; replacing one needs an unload lifecycle"},fxo=[{name:"AGENTS.md instructions",effect:"next_turn"},{name:"skills",effect:"next_turn"},{name:"Session extensions",effect:"unsupported",reason:"fixed when the Local service starts; replacing one needs an unload lifecycle"},nur]});import oZ from"process";import{homedir as mxo}from"os";import{basename as hxo}from"path";import{createCliRenderer as gxo}from"@opentui/core";async function yxo(e,t,n){try{await t()}catch(r){e.push(Rd(r,n))}}async function xxo(e,t,n,r){if(t===void 0)return;await yxo(e,()=>n(t),r)}async function L7e(e,t={},n=mxo()){let r=H3(n),i={..._xo,createServiceManager:()=>sw({home:n,reportCleanupFailure:(u)=>{Ai("local-service-cleanup",u)}}),loginProviders:()=>Yb(r).getProviders(),renderLanding:(u,l,d,p,f,m,h)=>{pcr(u,{initialTheme:f.initialTheme,sessions:l,agents:m,notice:h,folder:d,loadSummary:(g)=>_cr(Yb(r),m,g,{credentialPath:r}),choose:p})},...t},o,s,a;try{if(N7e(e),s=await b7e({signals:i.signals,createQueryClient:i.createQueryClient,createRenderer:i.createRenderer,createRoot:i.createRoot,createWhistle:i.createWhistle,enableKeymap:i.enableKeymap,probeSigils:oZ.stdin.isTTY}),s!==void 0){i.renderConnecting(s.root);let u=await lf(ii({try:()=>i.loadThemePreference(),catch:(x)=>Rd(x,"Theme preference unavailable")}).pipe(Cs((x)=>rt({theme:"terminal",error:x.message}))),{signal:s.signal});if(eu(u)){if(af(u.cause)){await s.close();return}throw gu(u.cause)}let l=u.value,d=await s.loadToolSigils(l.sigils??"auto"),{theme:p,error:f}=l,m=()=>({initialTheme:p,toolSigils:d,themeError:f,onThemeConfirm:async(x)=>{await i.saveThemePreference(x),p=x,f=void 0}}),h=i.createServiceManager(),g={owner:Aqn(h,i.loginProviders),host:"local",scope:"user",policy:{loginAllowed:LN}},_={restartInstalledUpdate:(x)=>{a=x},account:g,commands:s.commands,queryClient:s.queryClient,root:s.root,serviceManager:h,terminal:s,theme:m,onDiagnostic:(x)=>{Ai("client-extension",x)}},y=pft(s.commands,g.owner,{sourceId:"local-account",namespace:"account",host:g.host,scope:g.scope,policy:g.policy});try{await rur(e,i,_,n)}finally{y.dispose()}}}catch(u){o=Rd(u,"Local TUI failed")}let c=[];if(await xxo(c,s,(u)=>u.close(),"Local terminal application cleanup failed"),o!==void 0||c.length>0)throw C6(o,c);if(a!==void 0)await i.resumeInstalledUpdate(a)}var _xo;var sIt=C(async()=>{vr();cc();Lc();gy();JAt();CR();v8e();bf();Yde();zY();XCt();wcr();await Pc([RCt(),aw(),Lh(),vA(),JCt(),ycr(),kCt(),iur(),oIt()]);_xo={checkpointDrafts:KCt,automaticInstalledRestart:oZ.env.FUNGI_LAUNCHER!==void 0&&hxo(oZ.env.FUNGI_LAUNCHER)!=="fungi.cjs",resumeInstalledUpdate:Asr,signals:oZ,loadThemePreference:gB,saveThemePreference:dge,createWhistle:uU,prepareClientExtensions:bcr,createQueryClient:o7e,createRenderer:gxo,createRoot:MY,render:(e,t,n,r,i,o,s)=>{dcr(e,t,{...o,commands:r,onExit:i,session:n,...s})},renderConnecting:ucr,renderRecovery:ccr,renderServiceUpdated:acr,renderPicker:(e,t,n,r,i)=>{fcr(e,{...i,onCancel:r,onSelect:n,sessions:t})},enableKeymap:!0,runOneShot:R7e,checkInstalledUpdate:oZ.env.FUNGI_LAUNCHER===void 0?void 0:async(e)=>{let t=Bun.which("fungi"),n=oZ.env.FUNGI_LAUNCHER;if(t===null||n===void 0)return;return Tsr(t,n,e)}}});import vxo from"process";async function our(e,t,n=vxo,r){let i=new AbortController,o=()=>{i.abort()};n.on("SIGINT",o),n.on("SIGTERM",o);try{let s=r==="oauth"?"subscription":r,a=Fme(t.getProviders()).filter((l)=>s===void 0||l.methods.some((d)=>d.kind===s)&&!(s==="api_key"&&l.id==="fungi")),c=[];for(let l of a){i.signal.throwIfAborted();let d=await t.checkAuth(l.id,{signal:i.signal});if(d!==void 0)c.push({providerId:l.id,providerName:l.name,type:d.type})}i.signal.throwIfAborted();let u=await e.search({message:r==="api_key"?"Which provider's API key?":"Choose a provider",choices:c9(a,c,Lbt,"login"),collapsedGroup:"More providers",signal:i.signal});if(xv(u))throw Error("Login cancelled. Run fungi login to try again.");return u}finally{n.off("SIGINT",o),n.off("SIGTERM",o)}}var sur=C(()=>{EL();bf();v8e()});function cur(e){if(e===void 0)return;let t=aur.safeParse(e);if(!t.success)throw Error("Invalid --reasoning value: "+e+". Expected one of "+aur.options.join(", "));return t.data}var aur;var uur=C(()=>{qn();aur=un(["minimal","low","medium","high","xhigh","max"])});async function bxo(e,t,n,r){let{agents:i}=await e.discover(t,{signal:r}),o=i.find((s)=>s.agentId===n);if(o===void 0)throw Error(i.length===0?`No Agent ${n} in this folder; it has no saved Agents`:`No Agent ${n} in this folder; choose one of ${i.map((s)=>s.agentId).join(", ")}`);return o.databasePath}async function lur(e,t={}){let n={createServiceManager:()=>sw(),runOneShot:R7e,...t},r,i,o=new AbortController,s=()=>{o.abort()};try{if(e.connect===void 0){if(e.providerId!==void 0||e.modelId!==void 0||e.reasoning!==void 0)throw Error("Session model selection requires the shared Local preference contract");let u=n.createServiceManager(),l=e.signals??process;l.on("SIGINT",s),l.on("SIGTERM",s);try{let d=e.agentId===void 0?e.databasePath:await bxo(u,e.invocationRoot,e.agentId,o.signal),p=d===void 0?{invocationRoot:e.invocationRoot,mode:e.mode,fungiMcp:e.fungiMcp}:{invocationRoot:e.invocationRoot,databasePath:d,mode:e.mode,fungiMcp:e.fungiMcp};r=await u.connect(p,{signal:o.signal})}finally{l.off("SIGINT",s),l.off("SIGTERM",s)}if(o.signal.aborted)throw Error("fungi run cancelled")}else throw Error("--connect is unavailable; fungi uses the persistent Local service");let c=r;await n.runOneShot(c.session,{prompt:e.prompt,stdin:e.stdin,stdout:e.stdout,signals:e.signals,requestId:e.requestId,abortOnSignal:!0})}catch(c){i=Rd(c,"Local one-shot run failed")}let a=[];try{await r?.close()}catch(c){a.push(Rd(c,"Local TUI host close failed"))}if(i!==void 0||a.length>0)throw C6(i,a)}var dur=C(async()=>{XCt();await aw()});import{Worker as wxo}from"worker_threads";import{Buffer as mur}from"buffer";import{constants as Xge}from"fs";import{open as hur,readdir as Sxo}from"fs/promises";import{totalmem as Exo}from"os";import{join as aIt}from"path";async function _ur(e,t){let n=await e.stat();if(!n.isFile()||(n.mode&511)!==384||n.size>t)throw Error("Watchdog evidence is not a bounded private regular file")}async function fur(e,t){let n=await hur(e,Xge.O_WRONLY|Xge.O_CREAT|Xge.O_NOFOLLOW,384);try{await _ur(n,r5e),await n.truncate(0),await n.writeFile(t,"utf8"),await n.sync()}finally{await n.close()}}async function Rxo(){for(let e of["/proc/self/fd","/dev/fd"])try{return(await Sxo(e)).length}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")continue;Go("service-watchdog.fd-count",t);return}return}async function Dxo(e){let t=[];for(let r=3;r>=0;r--){let i=aIt(e,`service-stream.jsonl${r===0?"":`.${String(r)}`}`),o;try{o=await hur(i,Xge.O_RDWR|Xge.O_NOFOLLOW)}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ENOENT")continue;throw s}try{await _ur(o,r5e/4),t.push(await o.readFile()),await o.sync()}finally{await o.close()}}let n=mur.concat(t);if(n.byteLength>r5e)throw Error("Service capture exceeds its byte bound");return n.toString("utf8")}async function yur(e,t={}){let n=Cxo.parse({stallMs:t.stallMs,startupMs:t.startupMs,rssLimitBytes:t.rssLimitBytes,rssSustainMs:t.rssSustainMs}),r=t.heartbeat??new SharedArrayBuffer(24);if(r.byteLength!==24)throw Error("Invalid service watchdog state size");let i=new BigInt64Array(r),o=t.worker??new wxo(new URL("./private-local-service-worker.mjs",import.meta.url),{workerData:{directory:e,heartbeat:r,heartbeatIntervalMs:Math.min(1000,Math.floor(n.stallMs/4))}}),s=process.hrtime.bigint(),a=0n,c=s,u,l=[],d,p,f=cA(),m=(x)=>{u??=process.hrtime.bigint(),o.postMessage(x)},h=()=>{m("SIGINT")},g=()=>{m("SIGTERM")},_=(x,w,b)=>{clearInterval(y);let E=x==="rss-bound"?Axo:1;setTimeout(()=>process.exit(E),pur),(async()=>{let R={source:"local-service",event:"watchdog-exit",reason:x,timestamp:new Date().toISOString(),pid:process.pid,version:f,workerDigest:kxo,lagMs:w,boundMs:b,captureBudgetMs:pur,rssLimitBytes:n.rssLimitBytes,rssSamples:l,openFds:await Rxo(),uptimeMs:Math.round(process.uptime()*1000)},F=aIt(e,"watchdog-exit.json"),z=async(U)=>{await fur(F,JSON.stringify({...R,capture:U})+`
|
|
2250
|
-
`)};try{await z({state:"pending"});try{let U=await Dxo(e);await fur(aIt(e,"watchdog-stream.jsonl"),U),await z(Atomics.load(i,1)!==0n?{state:"failed",code:"capture-sink-failed"}:{state:U.length===0?"empty":"captured",file:"watchdog-stream.jsonl",bytes:mur.byteLength(U)})}catch(U){Go("service-watchdog.capture",U),await z({state:"failed",code:"capture-write-failed"})}}catch(U){Go("service-watchdog.evidence",U)}})().then(()=>{process.exit(E)},(R)=>{Go("service-watchdog.evidence",R),process.exit(E)})},y;process.on("SIGINT",h),process.on("SIGTERM",g);try{await new Promise((x,w)=>{o.once("error",w),o.once("exit",(b)=>{if(b===0)x();else w(Error(`Local service worker exited (${String(b)})`))}),y=setInterval(()=>{let b=process.hrtime.bigint();if(u!==void 0){let U=Number(b-u)/1e6;if(U>4500)_("shutdown-timeout",U,4500);return}let E=process.memoryUsage.rss();if(d===void 0||b-d>=1000000000n){if(d=b,l.push({atMs:Math.round(Number(b-s)/1e6),rss:E}),l.length>Ixo)l.shift()}if(E>n.rssLimitBytes){p??=b;let U=Number(b-p)/1e6;if(U>=n.rssSustainMs)_("rss-bound",U,n.rssSustainMs)}else p=void 0;let A=Atomics.load(i,0);if(A!==a)a=A,c=b;let R=Atomics.load(i,2)!==0n,F=Number(b-(R?c:s))/1e6,z=R?n.stallMs:n.startupMs;if(F>z)_(R?"event-loop-stall":"startup-timeout",F,z)},Math.min(250,Math.floor(n.stallMs/4)))})}finally{clearInterval(y),process.off("SIGINT",h),process.off("SIGTERM",g),await o.terminate()}}var kxo,gur=1048576,Txo,Axo=75,Cxo,Ixo=32,pur=200;var xur=C(async()=>{qn();tm();xgt();await ej();kxo=D().regex(/^(?:source|[a-f0-9]{64})$/u).parse("
|
|
2250
|
+
`)};try{await z({state:"pending"});try{let U=await Dxo(e);await fur(aIt(e,"watchdog-stream.jsonl"),U),await z(Atomics.load(i,1)!==0n?{state:"failed",code:"capture-sink-failed"}:{state:U.length===0?"empty":"captured",file:"watchdog-stream.jsonl",bytes:mur.byteLength(U)})}catch(U){Go("service-watchdog.capture",U),await z({state:"failed",code:"capture-write-failed"})}}catch(U){Go("service-watchdog.evidence",U)}})().then(()=>{process.exit(E)},(R)=>{Go("service-watchdog.evidence",R),process.exit(E)})},y;process.on("SIGINT",h),process.on("SIGTERM",g);try{await new Promise((x,w)=>{o.once("error",w),o.once("exit",(b)=>{if(b===0)x();else w(Error(`Local service worker exited (${String(b)})`))}),y=setInterval(()=>{let b=process.hrtime.bigint();if(u!==void 0){let U=Number(b-u)/1e6;if(U>4500)_("shutdown-timeout",U,4500);return}let E=process.memoryUsage.rss();if(d===void 0||b-d>=1000000000n){if(d=b,l.push({atMs:Math.round(Number(b-s)/1e6),rss:E}),l.length>Ixo)l.shift()}if(E>n.rssLimitBytes){p??=b;let U=Number(b-p)/1e6;if(U>=n.rssSustainMs)_("rss-bound",U,n.rssSustainMs)}else p=void 0;let A=Atomics.load(i,0);if(A!==a)a=A,c=b;let R=Atomics.load(i,2)!==0n,F=Number(b-(R?c:s))/1e6,z=R?n.stallMs:n.startupMs;if(F>z)_(R?"event-loop-stall":"startup-timeout",F,z)},Math.min(250,Math.floor(n.stallMs/4)))})}finally{clearInterval(y),process.off("SIGINT",h),process.off("SIGTERM",g),await o.terminate()}}var kxo,gur=1048576,Txo,Axo=75,Cxo,Ixo=32,pur=200;var xur=C(async()=>{qn();tm();xgt();await ej();kxo=D().regex(/^(?:source|[a-f0-9]{64})$/u).parse("85e13d427bac40a2f9173d0f5b5b82d8a3042d69021e618905251ed748a0d399"),Txo=Math.min(4096*gur,Exo()/2),Cxo=Ke({stallMs:et().int().min(50).max(30000).default(30000),startupMs:et().int().min(50).max(60000).default(60000),rssLimitBytes:et().int().min(64*gur).default(Math.floor(Txo)),rssSustainMs:et().int().min(50).max(600000).default(60000)})});ZB();HJ();AR();TN();var CDe=OE(dv,{contribute:(e)=>({chips:[],panel:e.status!=="running"||e.value===null?[]:e.value.asks.map((t)=>{let n=t.questions[0],r=`${n?.question??"Question"}${t.questions.length>1?` (+${String(t.questions.length-1)} more)`:""}`,i=n?.options.map((o)=>o.label).join(" \xB7 ")??"";if(t.escalated!==void 0){let{by:o,reason:s,note:a}=t.escalated;if(r=`${s==="escalated"?`escalated by ${o.name}`:s==="sender_archived"?`${o.name} archived`:`${o.name} is gone`} \xB7 ${r}`,a!==void 0)i=`${i}
|
|
2251
2251
|
${a}`}if(t.waitingOn!==void 0)return{id:t.askId,title:`waiting on ${t.waitingOn.name} \xB7 ${r}`,detail:i,tone:"muted",actions:[{id:"answerFlow",label:"Answer",input:{askId:t.askId}}]};return{id:t.askId,title:r,detail:i,tone:"attention",actions:[{id:"answerFlow",label:"Answer",input:{askId:t.askId},awaiting:"question"}]}}),timeline:{cells:[],omitted:0},waiting:null})});AR();JJ();var Ode=(e)=>{let t=e.replace(/\s+/gu," ").trim();return t.length<=80?t:`${t.slice(0,79)}\u2026`},fdi=(e)=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`};function mdi(e){let t=e.state==="active",n=t?`Pursuing goal since ${fdi(e.startedAt)}`:e.pauseCause?.kind==="delegator"?`Goal paused by ${Ode(e.pauseCause.detail??"delegator")} (/goal resume)`:"Goal paused (/goal resume)",r=!t&&e.pauseCause?.kind!=="delegator"&&e.pauseCause?.detail!=null?[Ode(e.pauseCause.detail)]:[],i={id:"goal",title:[n,Ode(e.objective),...r].join(" \xB7 "),tone:t?"running":"muted",actions:[{id:"goal",label:t?"Pause goal":"Resume goal",input:{action:t?"pause":"resume"}}]};return Ode(e.objective)===e.objective?i:{...i,detail:e.objective.slice(0,1024)}}function hdi(e){let t={id:"goal-ended",title:`${e.outcome==="achieved"?"Goal achieved":"Goal cleared"} \xB7 ${Ode(e.objective)}`,tone:e.outcome==="achieved"?"settled":"muted"},n=e.reason===null?t:{...t,detail:e.reason};return{id:String(e.sequence),sequence:e.sequence,at:e.endedAt,commandId:null,afterSequence:e.afterSequence,rows:[n]}}var Akn=OE(uy,{promptPresentation:"footer",contribute:(e)=>{if(e.status!=="running"||e.value===null)return{chips:[],panel:[],timeline:{cells:[],omitted:0},waiting:null};let{goal:t,ended:n,omitted:r}=e.value;return{chips:[],panel:t===null?[]:[mdi(t)],timeline:{cells:n.map(hdi),omitted:r},waiting:null}}});AR();Pde();var _di=(e)=>{let t=e.replace(/\s+/gu," ").trim();return t.length<=60?t:`${t.slice(0,59)}\u2026`},Rkn=(e)=>e.state==="failed"?"error":e.state==="active"?"running":e.state==="paused"?"muted":"settled",Dkn=(e)=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(e),Okn=OE(B3,{promptPresentation:"footer",contribute:(e)=>{if(e.status!=="running"||e.value===null)return{chips:[],panel:[],timeline:{cells:[],omitted:0},waiting:null};let{loop:t}=e.value,n=t.state==="active"&&t.nextDueAt!==null;return{chips:t.state!=="active"&&t.state!=="paused"?[]:[{id:"loop",order:2,row:{id:"loop",title:`Loop ${t.mode==="self_paced"?"self-paced":"fixed"}${n?" (waiting)":""}`,tone:Rkn(t)}}],panel:[{id:"loop",title:`Loop \xB7 ${t.state} \xB7 ${t.mode==="self_paced"?"self-paced":`${t.cron?.expression??"fixed"} ${t.cron?.timeZone??""}`}${t.nextDueAt===null?"":` \xB7 Next ${Dkn(t.nextDueAt)}`} \xB7 ${_di(t.prompt)}`,detail:[t.reason,t.prompt].filter((r)=>r!==null).join(`
|
|
2252
2252
|
`).slice(0,1024),tone:Rkn(t)},...t.lastError===null?[]:[{id:"error",title:t.lastError.slice(0,4096),tone:"error"}]],timeline:{cells:[],omitted:0},waiting:n?{summary:`Waiting until ${Dkn(t.nextDueAt)}`,cancel:{id:"loop",label:"stop loop",input:{action:"stop-ask"}}}:null}}});AR();NDe();var bdi=(e)=>{let t=e.steps.findIndex((i)=>i.status==="in_progress"),n=e.steps.filter((i)=>i.status==="completed").length;return{title:(t<0?e.steps.find((i)=>i.status==="pending"):e.steps[t])?.step??"Plan complete",detail:`${String(t<0?n:t+1)}/${String(e.steps.length)}`}},wdi=(e)=>e.steps.map((t,n)=>({id:String(n),title:t.step,tone:t.status==="completed"?"settled":t.status==="in_progress"?"running":"muted"})),Nkn=OE(CN,{contribute:(e)=>({chips:[],panel:e.status!=="running"||e.value===null||!MDe(e.value.plan)?[]:[{id:"plan",...bdi(e.value.plan),actions:[{id:"plan",label:"Clear plan",input:{action:"clear"}}],inspection:{commandId:"plan",title:"Plan",rows:wdi(e.value.plan)}}],timeline:{cells:[],omitted:0},waiting:null})});AR();Kft();var FDe={working:{label:"working",tone:"running",status:"info"},waiting_on_agent:{label:"waiting",tone:"muted",status:"neutral"},needs_you:{label:"needs you",tone:"attention",status:"warning"},idle:{label:"idle",tone:"settled",status:"success"},failed:{label:"failed",tone:"error",status:"error"},unavailable:{label:"unavailable",tone:"muted",status:"neutral"}};function $kn(e){let t=e.state==="waiting_on_agent"?`waiting on ${e.waitingOn??"its parent"}`:FDe[e.state].label,n=Mde(e.escalated);return n===void 0?t:`${t} \xB7 ${n}`}function Idi(e){let t=FDe[e.state],n={id:e.agentId,title:`${e.name} \xB7 ${$kn(e)}`,tone:t.tone,status:{label:$kn(e),tone:t.status}},i=e.ask?.questions[0]?.question??e.attention,o=i===void 0?n:{...n,detail:i.slice(0,200)};if(e.sessionId===null)return{...o,detail:e.attention??"not messaged yet"};let s={...o,open:{params:[{key:"agent",value:e.agentId},{key:"session",value:e.sessionId}]}};if(e.ask===void 0)return s;let a={id:"answerChild",label:"Answer",input:{agentId:e.agentId,sessionId:e.sessionId,askId:e.ask.askId}};return{...s,actions:[e.state==="needs_you"?{...a,awaiting:"question"}:a]}}function Rdi(e){let t=(c)=>e.counts[c],n=e.waitingOn.map(({name:c,count:u})=>`${String(u)} waiting on ${c}`),r=e.escalatedBy.map(({name:c,reason:u,count:l})=>{let d=Mde({by:c,reason:u});return e.escalated===t("needs_you")&&e.escalatedBy.length===1?d:`${String(l)} ${d}`}),i=r.length===0?"needs you":`needs you (${r.join("; ")})`,o=[...["working"].map((c)=>[c,t(c)]).filter(([,c])=>c>0).map(([c,u])=>`${String(u)} ${FDe[c].label}`),...n,...["needs_you","failed","unavailable"].map((c)=>[c,t(c)]).filter(([,c])=>c>0).map(([c,u])=>`${String(u)} ${c==="needs_you"?i:FDe[c].label}`)],s=t("working")+t("needs_you"),a=t("needs_you")>0?"attention":t("failed")>0?"error":t("working")>0?"running":"muted";return{id:"summary",title:[`${String(s)} sub-agent${s===1?"":"s"}`,...o,...e.uncounted>0?[`${String(e.uncounted)} not read`]:[],"/agents shows them"].join(" \xB7 "),tone:a}}var zkn=OE(DU,{contribute:(e)=>({chips:[],panel:e.status!=="running"||e.value===null?[]:e.value.agents.length>0&&!e.value.expanded?[Rdi(e.value)]:[...e.value.agents.map(Idi),...e.value.more===0&&e.value.uncounted===0?[]:[{id:"more",title:[...e.value.more===0?[]:[`${String(e.value.more)} more sub-agent${e.value.more===1?"":"s"}`],...e.value.uncounted===0?[]:[`${String(e.value.uncounted)} not read`]].join(" \xB7 "),tone:"muted"}]],timeline:{cells:[],omitted:0},waiting:null})});AR();hd();Wf();vr();tr();import $De from"process";import{once as Ddi}from"events";import{createConnection as Odi}from"net";import{createInterface as Pdi}from"readline";var Ukn="fungi:agent:v1",Jft=Date.now()*1000,Mdi=en(ki(vn([re({id:Ce,result:Sa}),re({id:Ce,error:re({code:Ce,message:Ce})})])));function Ndi(){return Jft=Math.max(Jft+1,Date.now()*1000),Jft}function Ldi(e,t,n){let r=n?.state,i=Ndi(),o=`${Ukn}:${String(i)}`,s={pane_id:t,source:Ukn,agent:"fungi",seq:i};if(r!==void 0)s.state=r;if(r==="blocked")s.message=n?.header===void 0?"Waiting for your response":`Waiting for your response: ${n.header}`;let a={id:o,method:r===void 0?"pane.release_agent":"pane.report_agent",params:s};return ii({try:async(c)=>{let u=Odi({path:e,signal:c}),l=Pdi({input:u,crlfDelay:1/0});try{let d=l[Symbol.asyncIterator](),[,p]=await Promise.all([Ddi(u,"connect",{signal:c}).then(()=>{u.write(`${JSON.stringify(a)}
|
|
2253
2253
|
`)}),d.next()]);if(p.done)throw Error("Herdr closed without a response");let f=Mdi(p.value);if(f.id!==o)throw Error("Herdr response ID mismatch");if("error"in f)throw Error(`Herdr report refused: ${f.error.code}`)}finally{l.close(),u.destroy()}},catch:(c)=>Error("Herdr report failed",{cause:c})}).pipe(dxe("2 seconds"))}function Fdi(e,t){let{HERDR_ENV:n,HERDR_SOCKET_PATH:r,HERDR_PANE_ID:i}=t.environment;if(n!=="1"||!r||!i)return Ln;let o=$De.platform==="win32"?`\\\\.\\pipe\\${r}`:r,s=(a)=>Ldi(o,i,a).pipe(Cs((c)=>Gt(()=>{t.onError(c)})));return Ct(function*(){yield*Ra(Ln,()=>s(void 0)),yield*e.pipe(U7t((a,c)=>a.state===c.state&&a.header===c.header),RF(s),Cs((a)=>Gt(()=>{t.onError(a)})),Qy)})}var $di=OE({id:bu.make("corral"),commands:{},projection:null},{attach:({activity:e,onError:t})=>Fdi(Sve(e,(n)=>Error("Corral activity delivery failed",{cause:n})),{environment:{HERDR_ENV:$De.env.HERDR_ENV,HERDR_SOCKET_PATH:$De.env.HERDR_SOCKET_PATH,HERDR_PANE_ID:$De.env.HERDR_PANE_ID},onError:t})}),jkn=$di;import{createRequire as Oxo}from"module";import{homedir as Pxo}from"os";import{dirname as vur,join as cIt,resolve as Fh}from"path";import{fileURLToPath as Mxo}from"url";import{lstatSync as bur,realpathSync as Nxo}from"fs";HJ();var YJ=`Usage: fungi agents list [--archived] [-C dir]
|
|
@@ -2386,7 +2386,7 @@ that npm create fungi-app runs, at the version released with this fungi.
|
|
|
2386
2386
|
|
|
2387
2387
|
Add --help to create or install for its options.
|
|
2388
2388
|
See also: fungi oyster --help
|
|
2389
|
-
`,Mja=xr({version:D().min(1)});function Pqi(){return{oyster:"0.
|
|
2389
|
+
`,Mja=xr({version:D().min(1)});function Pqi(){return{oyster:"0.43.0",createFungiApp:"0.0.103"}}var Mqi=(e)=>new Promise((t,n)=>{let r=Rqi(e.command,[...e.args],{cwd:e.cwd,env:{...process.env,...e.env},stdio:"inherit"});r.once("error",n),r.once("close",(i,o)=>{t(i??(o===null?1:128))})}),Nqi=new Set(["try","install-apps","install"]),Lqi=new Set(["create","dev","build","install"]);function VHn(e,t,n){return{command:"npm",args:["exec","--yes",`--package=${e}`,"--",t,...n]}}function Fqi(e){return e.length===0||e[0]==="help"||e[0]==="-h"||e[0]==="--help"}async function KHn(e){let{group:t,args:n,cwd:r,stdout:i}=e,o=t==="oyster"?Nqi:Lqi,[s,...a]=n;if(Fqi(n)){i.write(t==="oyster"?SSt:ESt);return}if(s===void 0||!o.has(s))throw new Kme(`Unknown ${t} command: ${s??""}`,`Run fungi ${t} --help`);let c=Pqi(),u={FUNGI_HOST:`spore@${e.sporeVersion}`},l;if(t==="oyster"||s==="install")l=VHn(`@fungi.computer/oyster@${c.oyster}`,"oyster",n);else if(s==="create")l=VHn(`create-fungi-app@${c.createFungiApp}`,"create-fungi-app",a);else{let p=Oqi(r,"node_modules",".bin","fungi-app");if(!Dqi(p))throw new Kme("This folder is not a Fungi App","Run fungi app create <dir>, or npm install here");l={command:p,args:n}}let d=await(e.runner??Mqi)({...l,cwd:r,env:u});if(d!==0)process.exitCode=d}H8e();var Uqi=`Usage: fungi [command] [options]
|
|
2390
2390
|
|
|
2391
2391
|
Start here:
|
|
2392
2392
|
fungi Open your conversations in this folder
|
|
@@ -1350,7 +1350,7 @@ Only summarize information explicitly present above. Do not infer or recreate la
|
|
|
1350
1350
|
`)-1&&t.runes[2]===Ge.CODES.get(`
|
|
1351
1351
|
`)+1&&t.runes[3]===li.MAX_RUNE&&(t.runes=[],t.op=Qe.Op.ANY_CHAR_NOT_NL))}collapse(t,n){if(t.length===1)return t[0];let i=0;for(let a of t)i+=a.op===n?a.subs.length:1;let r=new Array(i).fill(null),o=0;for(let a of t)a.op===n?(r.splice(o,a.subs.length,...a.subs),o+=a.subs.length,this.reuse(a)):r[o++]=a;let s=this.newRegexp(n);if(s.subs=r,n===Qe.Op.ALTERNATE&&(s.subs=this.factor(s.subs),s.subs.length===1)){const a=s;s=s.subs[0],this.reuse(a)}return s}factor(t){if(t.length<2)return t;let n=0,i=t.length,r=0,o=null,s=0,a=0,c=0;for(let l=0;l<=i;l++){let d=null,p=0,h=0;if(l<i){let m=t[n+l];if(m.op===Qe.Op.CONCAT&&m.subs.length>0&&(m=m.subs[0]),m.op===Qe.Op.LITERAL&&(d=m.runes,p=m.runes.length,h=m.flags&Dt.FOLD_CASE),h===a){let f=0;for(;f<s&&f<p&&o[f]===d[f];)f++;if(f>0){s=f;continue}}}if(l!==c)if(l===c+1)t[r++]=t[n+c];else{const m=this.newRegexp(Qe.Op.LITERAL);m.flags=a,m.runes=o.slice(0,s);for(let y=c;y<l;y++)t[n+y]=this.removeLeadingString(t[n+y],s),this.checkLimits(t[n+y]);const f=this.collapse(t.slice(n+c,n+l),Qe.Op.ALTERNATE),g=this.newRegexp(Qe.Op.CONCAT);g.subs=[m,f],t[r++]=g}c=l,o=d,s=p,a=h}i=r,n=0,c=0,r=0;let u=null;for(let l=0;l<=i;l++){let d=null;if(!(l<i&&(d=Rn.leadingRegexp(t[n+l]),u!==null&&u.equals(d)&&(Rn.isCharClass(u)||u.op===Qe.Op.REPEAT&&u.min===u.max&&Rn.isCharClass(u.subs[0]))))){if(l!==c)if(l===c+1)t[r++]=t[n+c];else{const p=u;for(let f=c;f<l;f++){const g=f!==c;t[n+f]=this.removeLeadingRegexp(t[n+f],g),this.checkLimits(t[n+f])}const h=this.collapse(t.slice(n+c,n+l),Qe.Op.ALTERNATE),m=this.newRegexp(Qe.Op.CONCAT);m.subs=[p,h],t[r++]=m}c=l,u=d}}i=r,n=0,c=0,r=0;for(let l=0;l<=i;l++)if(!(l<i&&Rn.isCharClass(t[n+l]))){if(l!==c)if(l===c+1)t[r++]=t[n+c];else{let d=c;for(let h=c+1;h<l;h++){const m=t[n+d],f=t[n+h];(m.op<f.op||m.op===f.op&&(m.runes!==null?m.runes.length:0)<(f.runes!==null?f.runes.length:0))&&(d=h)}const p=t[n+c];t[n+c]=t[n+d],t[n+d]=p;for(let h=c+1;h<l;h++)Rn.mergeCharClass(t[n+c],t[n+h]),this.reuse(t[n+h]);this.cleanAlt(t[n+c]),t[r++]=t[n+c]}l<i&&(t[r++]=t[n+l]),c=l+1}i=r,n=0,c=0,r=0;for(let l=0;l<i;++l)l+1<i&&t[n+l].op===Qe.Op.EMPTY_MATCH&&t[n+l+1].op===Qe.Op.EMPTY_MATCH||(t[r++]=t[n+l]);return i=r,n=0,t.slice(n,i)}removeLeadingString(t,n){if(t.op===Qe.Op.CONCAT&&t.subs.length>0){const i=this.removeLeadingString(t.subs[0],n);if(t.subs[0]=i,i.op===Qe.Op.EMPTY_MATCH)switch(this.reuse(i),t.subs.length){case 0:case 1:t.op=Qe.Op.EMPTY_MATCH,t.subs=null;break;case 2:{const r=t;t=t.subs[1],this.reuse(r);break}default:t.subs=t.subs.slice(1,t.subs.length);break}return t}return t.op===Qe.Op.LITERAL&&(t.runes=t.runes.slice(n,t.runes.length),t.runes.length===0&&(t.op=Qe.Op.EMPTY_MATCH)),t}removeLeadingRegexp(t,n){if(t.op===Qe.Op.CONCAT&&t.subs.length>0){switch(n&&this.reuse(t.subs[0]),t.subs=t.subs.slice(1,t.subs.length),t.subs.length){case 0:{t.op=Qe.Op.EMPTY_MATCH,t.subs=Qe.emptySubs();break}case 1:{const i=t;t=t.subs[0],this.reuse(i);break}}return t}return n&&this.reuse(t),this.newRegexp(Qe.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&Dt.LITERAL)!==0)return Rn.literalRegexp(this.wholeRegexp,this.flags);let t=-1,n=-1,i=-1;const r=new AJt(this.wholeRegexp);for(;r.more();){let s=-1;e:switch(r.peek()){case Ge.CODES.get("("):if((this.flags&Dt.PERL_X)!==0&&r.lookingAt("(?")){this.parsePerlFlags(r);break}this.op(Qe.Op.LEFT_PAREN).cap=++this.numCap,r.skip(1);break;case Ge.CODES.get("|"):this.parseVerticalBar(),r.skip(1);break;case Ge.CODES.get(")"):this.parseRightParen(),r.skip(1);break;case Ge.CODES.get("^"):(this.flags&Dt.ONE_LINE)!==0?this.op(Qe.Op.BEGIN_TEXT):this.op(Qe.Op.BEGIN_LINE),r.skip(1);break;case Ge.CODES.get("$"):(this.flags&Dt.ONE_LINE)!==0?this.op(Qe.Op.END_TEXT).flags|=Dt.WAS_DOLLAR:this.op(Qe.Op.END_LINE),r.skip(1);break;case Ge.CODES.get("."):(this.flags&Dt.DOT_NL)!==0?this.op(Qe.Op.ANY_CHAR):this.op(Qe.Op.ANY_CHAR_NOT_NL),r.skip(1);break;case Ge.CODES.get("["):this.parseClass(r);break;case Ge.CODES.get("*"):case Ge.CODES.get("+"):case Ge.CODES.get("?"):{s=r.pos();let a=null;switch(r.pop()){case Ge.CODES.get("*"):a=Qe.Op.STAR;break;case Ge.CODES.get("+"):a=Qe.Op.PLUS;break;case Ge.CODES.get("?"):a=Qe.Op.QUEST;break}this.repeat(a,n,i,s,r,t);break}case Ge.CODES.get("{"):{s=r.pos();const a=Rn.parseRepeat(r);if(a<0){r.rewindTo(s),this.literal(r.pop());break}n=a>>16,i=(a&li.MAX_BMP)<<16>>16,this.repeat(Qe.Op.REPEAT,n,i,s,r,t);break}case Ge.CODES.get("\\"):{const a=r.pos();if(r.skip(1),(this.flags&Dt.PERL_X)!==0&&r.more())switch(r.pop()){case Ge.CODES.get("A"):this.op(Qe.Op.BEGIN_TEXT);break e;case Ge.CODES.get("b"):this.op(Qe.Op.WORD_BOUNDARY);break e;case Ge.CODES.get("B"):this.op(Qe.Op.NO_WORD_BOUNDARY);break e;case Ge.CODES.get("C"):throw new bs(Rn.ERR_INVALID_ESCAPE,"\\C");case Ge.CODES.get("Q"):{let d=r.rest();const p=d.indexOf("\\E");p>=0&&(d=d.substring(0,p)),r.skipString(d),r.skipString("\\E");let h=0;for(;h<d.length;){const m=d.codePointAt(h);this.literal(m),h+=Br.charCount(m)}break e}case Ge.CODES.get("z"):this.op(Qe.Op.END_TEXT);break e;default:r.rewindTo(a);break}const c=this.newRegexp(Qe.Op.CHAR_CLASS);if(c.flags=this.flags,r.lookingAt("\\p")||r.lookingAt("\\P")){const l=new e_;if(this.parseUnicodeClass(r,l)){c.runes=l.toArray(),this.push(c);break e}}const u=new e_;if(this.parsePerlClassEscape(r,u)){c.runes=u.toArray(),this.push(c);break e}r.rewindTo(a),this.reuse(c),this.literal(Rn.parseEscape(r));break}default:this.literal(r.pop());break}t=s}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new bs(Rn.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(t){const n=t.pos(),i=t.rest();if(i.startsWith("(?P<")||i.startsWith("(?<")){const a=i.charAt(2)==="P"?4:3,c=i.indexOf(">");if(c<0)throw new bs(Rn.ERR_INVALID_NAMED_CAPTURE,i);const u=i.substring(a,c);if(t.skipString(u),t.skip(a+1),!Rn.isValidCaptureName(u))throw new bs(Rn.ERR_INVALID_NAMED_CAPTURE,i.substring(0,c+1));const l=this.op(Qe.Op.LEFT_PAREN);if(l.cap=++this.numCap,this.namedGroups[u])throw new bs(Rn.ERR_DUPLICATE_NAMED_CAPTURE,u);this.namedGroups[u]=this.numCap,l.name=u;return}t.skip(2);let r=this.flags,o=1,s=!1;e:for(;t.more();){const a=t.pop();switch(a){case Ge.CODES.get("i"):r|=Dt.FOLD_CASE,s=!0;break;case Ge.CODES.get("m"):r&=-17,s=!0;break;case Ge.CODES.get("s"):r|=Dt.DOT_NL,s=!0;break;case Ge.CODES.get("U"):r|=Dt.NON_GREEDY,s=!0;break;case Ge.CODES.get("-"):if(o<0)break e;o=-1,r=~r,s=!1;break;case Ge.CODES.get(":"):case Ge.CODES.get(")"):if(o<0){if(!s)break e;r=~r}a===Ge.CODES.get(":")&&this.op(Qe.Op.LEFT_PAREN),this.flags=r;return;default:break e}}throw new bs(Rn.ERR_INVALID_PERL_OP,t.from(n))}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(Qe.Op.VERTICAL_BAR)}swapVerticalBar(){const t=this.stack.length;if(t>=3&&this.stack[t-2].op===Qe.Op.VERTICAL_BAR&&Rn.isCharClass(this.stack[t-1])&&Rn.isCharClass(this.stack[t-3])){let n=this.stack[t-1],i=this.stack[t-3];if(n.op>i.op){const r=i;i=n,n=r,this.stack[t-3]=i}return Rn.mergeCharClass(i,n),this.reuse(n),this.pop(),!0}if(t>=2){const n=this.stack[t-1],i=this.stack[t-2];if(i.op===Qe.Op.VERTICAL_BAR)return t>=3&&this.cleanAlt(this.stack[t-3]),this.stack[t-2]=n,this.stack[t-1]=i,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new bs(Rn.ERR_UNEXPECTED_PAREN,this.wholeRegexp);const n=this.pop(),i=this.pop();if(i.op!==Qe.Op.LEFT_PAREN)throw new bs(Rn.ERR_UNEXPECTED_PAREN,this.wholeRegexp);this.flags=i.flags,i.cap===0?this.push(n):(i.op=Qe.Op.CAPTURE,i.subs=[n],this.push(i))}parsePerlClassEscape(t,n){const i=t.pos();if((this.flags&Dt.PERL_X)===0||!t.more()||t.pop()!==Ge.CODES.get("\\")||!t.more())return!1;t.pop();const r=t.from(i),o=s9e.has(r)?s9e.get(r):null;return o===null?!1:(n.appendGroup(o,(this.flags&Dt.FOLD_CASE)!==0),!0)}parseNamedClass(t,n){const i=t.rest(),r=i.indexOf(":]");if(r<0)return!1;const o=i.substring(0,r+2);t.skipString(o);const s=b9e.has(o)?b9e.get(o):null;if(s===null)throw new bs(Rn.ERR_INVALID_CHAR_RANGE,o);return n.appendGroup(s,(this.flags&Dt.FOLD_CASE)!==0),!0}parseUnicodeClass(t,n){const i=t.pos();if((this.flags&Dt.UNICODE_GROUPS)===0||!t.lookingAt("\\p")&&!t.lookingAt("\\P"))return!1;t.skip(1);let r=1,o=t.pop();if(o===Ge.CODES.get("P")&&(r=-1),!t.more())throw t.rewindTo(i),new bs(Rn.ERR_INVALID_CHAR_RANGE,t.rest());o=t.pop();let s;if(o!==Ge.CODES.get("{"))s=Br.runeToString(o);else{const l=t.rest(),d=l.indexOf("}");if(d<0)throw t.rewindTo(i),new bs(Rn.ERR_INVALID_CHAR_RANGE,t.rest());s=l.substring(0,d),t.skipString(s),t.skip(1)}s.length!==0&&s.codePointAt(0)===Ge.CODES.get("^")&&(r=0-r,s=s.substring(1));const a=Rn.unicodeTable(s);if(a===null)throw new bs(Rn.ERR_INVALID_CHAR_RANGE,t.from(i));const c=a.first,u=a.second;if((this.flags&Dt.FOLD_CASE)===0||u===null)n.appendTableWithSign(c,r);else{const l=new e_().appendTable(c).appendTable(u).cleanClass().toArray();n.appendClassWithSign(l,r)}return!0}parseClass(t){const n=t.pos();t.skip(1);const i=this.newRegexp(Qe.Op.CHAR_CLASS);i.flags=this.flags;const r=new e_;let o=1;t.more()&&t.lookingAt("^")&&(o=-1,t.skip(1),(this.flags&Dt.CLASS_NL)===0&&r.appendRange(Ge.CODES.get(`
|
|
1352
1352
|
`),Ge.CODES.get(`
|
|
1353
|
-
`)));let s=!0;for(;!t.more()||t.peek()!==Ge.CODES.get("]")||s;){if(t.more()&&t.lookingAt("-")&&(this.flags&Dt.PERL_X)===0&&!s){const l=t.rest();if(l==="-"||!l.startsWith("-]"))throw t.rewindTo(n),new bs(Rn.ERR_INVALID_CHAR_RANGE,t.rest())}s=!1;const a=t.pos();if(t.lookingAt("[:")){if(this.parseNamedClass(t,r))continue;t.rewindTo(a)}if(this.parseUnicodeClass(t,r)||this.parsePerlClassEscape(t,r))continue;t.rewindTo(a);const c=Rn.parseClassChar(t,n);let u=c;if(t.more()&&t.lookingAt("-")){if(t.skip(1),t.more()&&t.lookingAt("]"))t.skip(-1);else if(u=Rn.parseClassChar(t,n),u<c)throw new bs(Rn.ERR_INVALID_CHAR_RANGE,t.from(a))}(this.flags&Dt.FOLD_CASE)===0?r.appendRange(c,u):r.appendFoldedRange(c,u)}t.skip(1),r.cleanClass(),o<0&&r.negateClass(),i.runes=r.toArray(),this.push(i)}},IJt=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}compareAndSet(e,t){return this.value===e?(this.value=t,!0):!1}},CJt=class NE{static initTest(t){const n=NE.compile(t),i=new NE(n.expr,n.prog,n.numSubexp,n.longest);return i.cond=n.cond,i.prefix=n.prefix,i.prefixUTF8=n.prefixUTF8,i.prefixComplete=n.prefixComplete,i.prefixRune=n.prefixRune,i}static compile(t){return NE.compileImpl(t,Dt.PERL,!1)}static compilePOSIX(t){return NE.compileImpl(t,Dt.POSIX,!0)}static compileImpl(t,n,i){let r=TJt.parse(t,n);const o=r.maxCap();r=EJt.simplify(r);const s=kJt.compileRegexp(r),a=new NE(t,s,o,i),[c,u]=s.prefix();return a.prefixComplete=c,a.prefix=u,a.prefixUTF8=Br.stringToUtf8ByteArray(a.prefix),a.prefix.length>0&&(a.prefixRune=a.prefix.codePointAt(0)),a.namedGroups=r.namedGroups,a}static match(t,n){return NE.compile(t).match(n)}constructor(t,n,i=0,r=0){this.expr=t,this.prog=n,this.numSubexp=i,this.longest=r,this.cond=n.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.pooled=new IJt,this.dfa=new xJt(n)}executeEngine(t,n,i,r){if(r>0)return this.doExecuteNFA(t,n,i,r);const o=this.dfa.match(t,n,i);return o!==null?o?[]:null:this.doExecuteNFA(t,n,i,r)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){let t;do t=this.pooled.get();while(t&&!this.pooled.compareAndSet(t,t.next));return t}reset(){this.pooled.set(null)}put(t,n){let i=this.pooled.get();do i=this.pooled.get(),!n&&i&&(t=lee.fromMachine(t),n=!0),t.next!==i&&(t.next=i);while(!this.pooled.compareAndSet(i,t))}toString(){return this.expr}doExecuteNFA(t,n,i,r){let o=this.get(),s=!1;o?o.next!==null&&(o=lee.fromMachine(o),s=!0):(o=lee.fromRE2(this),s=!0),o.init(r);const a=o.match(t,n,i)?o.submatches():null;return this.put(o,s),a}match(t){return this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,0)!==null}matchWithGroup(t,n,i,r,o){return t instanceof Pk||(t=xL.utf16(t)),this.matchMachineInput(t,n,i,r,o)}matchMachineInput(t,n,i,r,o){if(n>i)return[!1,null];const s=t.isUTF16Encoding()?ta.fromUTF16(t.asCharSequence(),0,i):ta.fromUTF8(t.asBytes(),0,i),a=this.executeEngine(s,n,r,2*o);return a===null?[!1,null]:[!0,a]}matchUTF8(t){return this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,0)!==null}replaceAll(t,n){return this.replaceAllFunc(t,()=>n,2*t.length+1)}replaceFirst(t,n){return this.replaceAllFunc(t,()=>n,1)}replaceAllFunc(t,n,i){let r=0,o=0,s="";const a=ta.fromUTF16(t);let c=0;for(;o<=t.length;){const u=this.executeEngine(a,o,Dt.UNANCHORED,2);if(u===null||u.length===0)break;s+=t.substring(r,u[0]),(u[1]>r||u[0]===0)&&(s+=n(t.substring(u[0],u[1])),c++),r=u[1];const l=a.step(o)&7;if(o+l>u[1]?o+=l:o+1>u[1]?o++:o=u[1],c>=i)break}return s+=t.substring(r),s}pad(t){if(t===null)return null;let n=(1+this.numSubexp)*2;if(t.length<n){let i=new Array(n).fill(-1);for(let r=0;r<t.length;r++)i[r]=t[r];t=i}return t}allMatches(t,n,i=r=>r){let r=[];const o=t.endPos();n<0&&(n=o+1);let s=0,a=0,c=-1;for(;a<n&&s<=o;){const u=this.executeEngine(t,s,Dt.UNANCHORED,this.prog.numCap);if(u===null||u.length===0)break;let l=!0;if(u[1]===s){u[0]===c&&(l=!1);const d=t.step(s);d<0?s=o+1:s+=d&7}else s=u[1];c=u[1],l&&(r.push(i(this.pad(u))),a++)}return r}findUTF8(t){const n=this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,2);return n===null?null:t.slice(n[0],n[1])}findUTF8Index(t){const n=this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,2);return n===null?null:n.slice(0,2)}find(t){const n=this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,2);return n===null?"":t.substring(n[0],n[1])}findIndex(t){return this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,2)}findUTF8Submatch(t){const n=this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,this.prog.numCap);if(n===null)return null;const i=new Array(1+this.numSubexp).fill(null);for(let r=0;r<i.length;r++)2*r<n.length&&n[2*r]>=0&&(i[r]=t.slice(n[2*r],n[2*r+1]));return i}findUTF8SubmatchIndex(t){return this.pad(this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,this.prog.numCap))}findSubmatch(t){const n=this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,this.prog.numCap);if(n===null)return null;const i=new Array(1+this.numSubexp).fill(null);for(let r=0;r<i.length;r++)2*r<n.length&&n[2*r]>=0&&(i[r]=t.substring(n[2*r],n[2*r+1]));return i}findSubmatchIndex(t){return this.pad(this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,this.prog.numCap))}findAllUTF8(t,n){const i=this.allMatches(ta.fromUTF8(t),n,r=>t.slice(r[0],r[1]));return i.length===0?null:i}findAllUTF8Index(t,n){const i=this.allMatches(ta.fromUTF8(t),n,r=>r.slice(0,2));return i.length===0?null:i}findAll(t,n){const i=this.allMatches(ta.fromUTF16(t),n,r=>t.substring(r[0],r[1]));return i.length===0?null:i}findAllIndex(t,n){const i=this.allMatches(ta.fromUTF16(t),n,r=>r.slice(0,2));return i.length===0?null:i}findAllUTF8Submatch(t,n){const i=this.allMatches(ta.fromUTF8(t),n,r=>{let o=new Array(r.length/2|0).fill(null);for(let s=0;s<o.length;s++)r[2*s]>=0&&(o[s]=t.slice(r[2*s],r[2*s+1]));return o});return i.length===0?null:i}findAllUTF8SubmatchIndex(t,n){const i=this.allMatches(ta.fromUTF8(t),n);return i.length===0?null:i}findAllSubmatch(t,n){const i=this.allMatches(ta.fromUTF16(t),n,r=>{let o=new Array(r.length/2|0).fill(null);for(let s=0;s<o.length;s++)r[2*s]>=0&&(o[s]=t.substring(r[2*s],r[2*s+1]));return o});return i.length===0?null:i}findAllSubmatchIndex(t,n){const i=this.allMatches(ta.fromUTF16(t),n);return i.length===0?null:i}},RJt=class rR{static isUpperCaseAlpha(t){return"A"<=t&&t<="Z"}static isHexadecimal(t){return"0"<=t&&t<="9"||"A"<=t&&t<="F"||"a"<=t&&t<="f"}static getUtf8CharSize(t){const n=t.charCodeAt(0);return n<128?1:n<2048?2:n<65536?3:4}static translate(t){if(typeof t!="string")return t;let n="",i=!1,r=t.length;r===0&&(n="(?:)",i=!0);let o=0;for(;o<r;){let s=t[o];if(s==="\\"){if(o+1<r)switch(s=t[o+1],s){case"\\":{n+="\\\\",o+=2;continue}case"c":{if(o+2<r){let c=t[o+2];if(rR.isUpperCaseAlpha(c)){n+="\\x",n+=(c.charCodeAt(0)-64>>4).toString(16).toUpperCase(),n+=(c.charCodeAt(0)-64&15).toString(16).toUpperCase(),o+=3,i=!0;continue}}n+="\\c",o+=2;continue}case"u":{if(o+2<r){let c=t[o+2];if(rR.isHexadecimal(c)){n+="\\x{"+c,o+=3;for(let u=0;u<3&&o<r&&(c=t[o],!!rR.isHexadecimal(c));++o,++u)n+=c;n+="}",i=!0;continue}else if(c==="{"){n+="\\x",o+=2,i=!0;continue}}n+="\\u",o+=2;continue}default:{n+="\\";let c=rR.getUtf8CharSize(s);n+=t.substring(o+1,o+1+c),o+=c+1;continue}}}else if(s==="/"){n+="\\/",o+=1,i=!0;continue}else if(s==="("&&o+2<r&&t[o+1]==="?"&&t[o+2]==="<"&&(o+3>=r||t[o+3]!=="="&&t[o+3]!=="!")){n+="(?P<",o+=3,i=!0;continue}let a=rR.getUtf8CharSize(s);n+=t.substring(o,o+a),o+=a}return i?n:t}},pee=class lp{static CASE_INSENSITIVE=1;static DOTALL=2;static MULTILINE=4;static DISABLE_UNICODE_GROUPS=8;static LONGEST_MATCH=16;static quote(t){return Br.quoteMeta(t)}static translateRegExp(t){return RJt.translate(t)}static compile(t,n=0){let i=t;if((n&lp.CASE_INSENSITIVE)!==0&&(i=`(?i)${i}`),(n&lp.DOTALL)!==0&&(i=`(?s)${i}`),(n&lp.MULTILINE)!==0&&(i=`(?m)${i}`),(n&~(lp.MULTILINE|lp.DOTALL|lp.CASE_INSENSITIVE|lp.DISABLE_UNICODE_GROUPS|lp.LONGEST_MATCH))!==0)throw new gJt("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH");let r=Dt.PERL;(n&lp.DISABLE_UNICODE_GROUPS)!==0&&(r&=-129);const o=new lp(t,n);return o.re2Input=CJt.compileImpl(i,r,(n&lp.LONGEST_MATCH)!==0),o}static matches(t,n){return lp.compile(t).testExact(n)}static initTest(t,n,i){if(t==null)throw new Error("pattern is null");if(i==null)throw new Error("re2 is null");const r=new lp(t,n);return r.re2Input=i,r}constructor(t,n){this.patternInput=t,this.flagsInput=n}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(t){return this.testExact(t)}matcher(t){return Array.isArray(t)&&(t=xL.utf8(t)),new yJt(this,t)}test(t){return Array.isArray(t)?this.re2Input.matchUTF8(t):this.re2Input.match(t)}testExact(t){const n=Array.isArray(t)?ta.fromUTF8(t):ta.fromUTF16(t);return this.re2Input.executeEngine(n,0,Dt.ANCHOR_BOTH,0)!==null}split(t,n=0){const i=this.matcher(t),r=[];let o=0,s=0;for(;i.find();){if(s===0&&i.end()===0){s=i.end();continue}if(n>0&&r.length===n-1)break;if(s===i.start()){if(n===0){o+=1,s=i.end();continue}}else for(;o>0;)r.push(""),o-=1;r.push(i.substring(s,i.start())),s=i.end()}if(n===0&&s!==i.inputLength()){for(;o>0;)r.push(""),o-=1;r.push(i.substring(s,i.inputLength()))}return(n!==0||r.length===0)&&r.push(i.substring(s,i.inputLength())),r}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(t){return this===t?!0:t===null||this.constructor!==t.constructor?!1:this.flagsInput===t.flagsInput&&this.patternInput===t.patternInput}}}}),PJt,Jdi=A({"../../packages/veil/dist/index.js"(){"use strict";PJt=class extends Error{code;constructor(e,t){super(e),this.code=e,this.name="VeilError",t!==void 0&&Object.defineProperty(this,"cause",{value:t,enumerable:!1})}}}}),MJt={};bi(MJt,{configuration:()=>DJt});var DJt,Qdi=A({"../../packages/veil/dist/redaction-rules.js"(){"use strict";DJt={title:"gitleaks config",minVersion:"v8.25.0",allowlist:{description:"global allow lists",paths:["gitleaks\\.toml","(?i)\\.(?:bmp|gif|jpe?g|png|svg|tiff?)$","(?i)\\.(?:eot|[ot]tf|woff2?)$","(?i)\\.(?:docx?|xlsx?|pdf|bin|socket|vsidx|v2|suo|wsuo|.dll|pdb|exe|gltf)$","go\\.(?:mod|sum|work(?:\\.sum)?)$","(?:^|/)vendor/modules\\.txt$","(?:^|/)vendor/(?:github\\.com|golang\\.org/x|google\\.golang\\.org|gopkg\\.in|istio\\.io|k8s\\.io|sigs\\.k8s\\.io)(?:/.*)?$","(?:^|/)gradlew(?:\\.bat)?$","(?:^|/)gradle\\.lockfile$","(?:^|/)mvnw(?:\\.cmd)?$","(?:^|/)\\.mvn/wrapper/MavenWrapperDownloader\\.java$","(?:^|/)node_modules(?:/.*)?$","(?:^|/)(?:deno\\.lock|npm-shrinkwrap\\.json|package-lock\\.json|pnpm-lock\\.yaml|yarn\\.lock)$","(?:^|/)bower_components(?:/.*)?$","(?:^|/)(?:angular|bootstrap|jquery(?:-?ui)?|plotly|swagger-?ui)[a-zA-Z0-9.-]*(?:\\.min)?\\.js(?:\\.map)?$","(?:^|/)javascript\\.json$","(?:^|/)(?:Pipfile|poetry)\\.lock$","(?i)(?:^|/)(?:v?env|virtualenv)/lib(?:64)?(?:/.*)?$","(?i)(?:^|/)(?:lib(?:64)?/python[23](?:\\.\\d{1,2})+|python/[23](?:\\.\\d{1,2})+/lib(?:64)?)(?:/.*)?$","(?i)(?:^|/)[a-z0-9_.]+-[0-9.]+\\.dist-info(?:/.+)?$","(?:^|/)vendor/(?:bundle|ruby)(?:/.*?)?$","\\.gem$","verification-metadata\\.xml","Database.refactorlog","(?:^|/)\\.git$"],regexes:["(?i)^true|false|null$","^(?i:a+|b+|c+|d+|e+|f+|g+|h+|i+|j+|k+|l+|m+|n+|o+|p+|q+|r+|s+|t+|u+|v+|w+|x+|y+|z+|\\*+|\\.+)$","^\\$(?:\\d+|{\\d+})$","^\\$(?:[A-Z_]+|[a-z_]+)$","^\\${(?:[A-Z_]+|[a-z_]+)}$","^\\{\\{[ \\t]*[\\w ().|]+[ \\t]*}}$",`^\\$\\{\\{[ \\t]*(?:(?:env|github|secrets|vars)(?:\\.[A-Za-z]\\w+)+[\\w "'&./=|]*)[ \\t]*}}$`,"^%(?:[A-Z_]+|[a-z_]+)%$","^%[+\\-# 0]?[bcdeEfFgGoOpqstTUvxX]$","^\\{\\d{0,2}}$","^@(?:[A-Z_]+|[a-z_]+)@$","^/Users/(?i)[a-z0-9]+/[\\w .-/]+$","^/(?:bin|etc|home|opt|tmp|usr|var)/[\\w ./-]+$"],stopwords:["014df517-39d1-4453-b7b3-9930c563627c","abcdefghijklmnopqrstuvwxyz"]},rules:[{id:"1password-secret-key",description:"Uncovered a possible 1Password secret key, potentially compromising access to secrets in vaults.",regex:"\\bA3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}\\b",entropy:3.8,keywords:["a3-"]},{id:"1password-service-account-token",description:"Uncovered a possible 1Password service account token, potentially compromising access to secrets in vaults.",regex:"ops_eyJ[a-zA-Z0-9+/]{250,}={0,3}",entropy:4,keywords:["ops_"]},{id:"adafruit-api-key",description:"Identified a potential Adafruit API Key, which could lead to unauthorized access to Adafruit services and sensitive data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:adafruit)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["adafruit"]},{id:"adobe-client-id",description:"Detected a pattern that resembles an Adobe OAuth Web Client ID, posing a risk of compromised Adobe integrations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:adobe)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["adobe"]},{id:"adobe-client-secret",description:"Discovered a potential Adobe Client Secret, which, if exposed, could allow unauthorized Adobe service access and data manipulation.",regex:`\\b(p8e-(?i)[a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["p8e-"]},{id:"age-secret-key",description:"Discovered a potential Age encryption tool secret key, risking data decryption and unauthorized access to sensitive information.",regex:"AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}",keywords:["age-secret-key-1"]},{id:"airtable-api-key",description:"Uncovered a possible Airtable API Key, potentially compromising database access and leading to data leakage or alteration.",regex:`(?i)[\\w.-]{0,50}?(?:airtable)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{17})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["airtable"]},{id:"airtable-personnal-access-token",description:"Uncovered a possible Airtable Personal AccessToken, potentially compromising database access and leading to data leakage or alteration.",regex:"\\b(pat[[:alnum:]]{14}\\.[a-f0-9]{64})\\b",keywords:["airtable"]},{id:"algolia-api-key",description:"Identified an Algolia API Key, which could result in unauthorized search operations and data exposure on Algolia-managed platforms.",regex:`(?i)[\\w.-]{0,50}?(?:algolia)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["algolia"]},{id:"alibaba-access-key-id",description:"Detected an Alibaba Cloud AccessKey ID, posing a risk of unauthorized cloud resource access and potential data compromise.",regex:`\\b(LTAI(?i)[a-z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["ltai"]},{id:"alibaba-secret-key",description:"Discovered a potential Alibaba Cloud Secret Key, potentially allowing unauthorized operations and data access within Alibaba Cloud.",regex:`(?i)[\\w.-]{0,50}?(?:alibaba)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{30})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["alibaba"]},{id:"anthropic-admin-api-key",description:"Detected an Anthropic Admin API Key, risking unauthorized access to administrative functions and sensitive AI model configurations.",regex:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["sk-ant-admin01"]},{id:"anthropic-api-key",description:"Identified an Anthropic API Key, which may compromise AI assistant integrations and expose sensitive data to unauthorized access.",regex:`\\b(sk-ant-api03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["sk-ant-api03"]},{id:"artifactory-api-key",description:"Detected an Artifactory api key, posing a risk unauthorized access to the central repository.",regex:"\\bAKCp[A-Za-z0-9]{69}\\b",entropy:4.5,keywords:["akcp"]},{id:"artifactory-reference-token",description:"Detected an Artifactory reference token, posing a risk of impersonation and unauthorized access to the central repository.",regex:"\\bcmVmd[A-Za-z0-9]{59}\\b",entropy:4.5,keywords:["cmvmd"]},{id:"asana-client-id",description:"Discovered a potential Asana Client ID, risking unauthorized access to Asana projects and sensitive task information.",regex:`(?i)[\\w.-]{0,50}?(?:asana)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["asana"]},{id:"asana-client-secret",description:"Identified an Asana Client Secret, which could lead to compromised project management integrity and unauthorized access.",regex:`(?i)[\\w.-]{0,50}?(?:asana)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["asana"]},{id:"atlassian-api-token",description:"Detected an Atlassian API token, posing a threat to project management and collaboration tool security and data confidentiality.",regex:`(?i)[\\w.-]{0,50}?(?:(?-i:ATLASSIAN|[Aa]tlassian)|(?-i:CONFLUENCE|[Cc]onfluence)|(?-i:JIRA|[Jj]ira))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{20}[a-f0-9]{4})(?:[\\x60'"\\s;]|\\\\[nr]|$)|\\b(ATATT3[A-Za-z0-9_\\-=]{186})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["atlassian","confluence","jira","atatt3"]},{id:"authress-service-client-access-key",description:"Uncovered a possible Authress Service Client Access Key, which may compromise access control services and sensitive data.",regex:`\\b((?:sc|ext|scauth|authress)_(?i)[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30,120})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["sc_","ext_","scauth_","authress_"]},{id:"aws-access-token",description:"Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.",regex:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b",entropy:3,keywords:["a3t","akia","asia","abia","acca"],allowlists:[{regexes:[".+EXAMPLE$"]}]},{id:"aws-amazon-bedrock-api-key-long-lived",description:"Identified a pattern that may indicate long-lived Amazon Bedrock API keys, risking unauthorized Amazon Bedrock usage",regex:`\\b(ABSK[A-Za-z0-9+/]{109,269}={0,2})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["absk"]},{id:"aws-amazon-bedrock-api-key-short-lived",description:"Identified a pattern that may indicate short-lived Amazon Bedrock API keys, risking unauthorized Amazon Bedrock usage",regex:"bedrock-api-key-YmVkcm9jay5hbWF6b25hd3MuY29t",entropy:3,keywords:["bedrock-api-key-"]},{id:"azure-ad-client-secret",description:"Azure AD Client Secret",regex:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,entropy:3,keywords:["q~"]},{id:"beamer-api-token",description:"Detected a Beamer API token, potentially compromising content management and exposing sensitive notifications and updates.",regex:`(?i)[\\w.-]{0,50}?(?:beamer)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(b_[a-z0-9=_\\-]{44})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["beamer"]},{id:"bitbucket-client-id",description:"Discovered a potential Bitbucket Client ID, risking unauthorized repository access and potential codebase exposure.",regex:`(?i)[\\w.-]{0,50}?(?:bitbucket)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bitbucket"]},{id:"bitbucket-client-secret",description:"Discovered a potential Bitbucket Client Secret, posing a risk of compromised code repositories and unauthorized access.",regex:`(?i)[\\w.-]{0,50}?(?:bitbucket)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bitbucket"]},{id:"bittrex-access-key",description:"Identified a Bittrex Access Key, which could lead to unauthorized access to cryptocurrency trading accounts and financial loss.",regex:`(?i)[\\w.-]{0,50}?(?:bittrex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bittrex"]},{id:"bittrex-secret-key",description:"Detected a Bittrex Secret Key, potentially compromising cryptocurrency transactions and financial security.",regex:`(?i)[\\w.-]{0,50}?(?:bittrex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bittrex"]},{id:"cisco-meraki-api-key",description:"Cisco Meraki is a cloud-managed IT solution that provides networking, security, and device management through an easy-to-use interface.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:(?-i:[Mm]eraki|MERAKI))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["meraki"]},{id:"clickhouse-cloud-api-secret-key",description:"Identified a pattern that may indicate clickhouse cloud API secret key, risking unauthorized clickhouse cloud api access and data breaches on ClickHouse Cloud platforms.",regex:"\\b(4b1d[A-Za-z0-9]{38})\\b",entropy:3,keywords:["4b1d"]},{id:"clojars-api-token",description:"Uncovered a possible Clojars API token, risking unauthorized access to Clojure libraries and potential code manipulation.",regex:"(?i)CLOJARS_[a-z0-9]{60}",entropy:2,keywords:["clojars_"]},{id:"cloudflare-api-key",description:"Detected a Cloudflare API Key, potentially compromising cloud application deployments and operational security.",regex:`(?i)[\\w.-]{0,50}?(?:cloudflare)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["cloudflare"]},{id:"cloudflare-global-api-key",description:"Detected a Cloudflare Global API Key, potentially compromising cloud application deployments and operational security.",regex:`(?i)[\\w.-]{0,50}?(?:cloudflare)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{37})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["cloudflare"]},{id:"cloudflare-origin-ca-key",description:"Detected a Cloudflare Origin CA Key, potentially compromising cloud application deployments and operational security.",regex:`\\b(v1\\.0-[a-f0-9]{24}-[a-f0-9]{146})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["cloudflare","v1.0-"]},{id:"codecov-access-token",description:"Found a pattern resembling a Codecov Access Token, posing a risk of unauthorized access to code coverage reports and sensitive data.",regex:`(?i)[\\w.-]{0,50}?(?:codecov)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["codecov"]},{id:"cohere-api-token",description:"Identified a Cohere Token, posing a risk of unauthorized access to AI services and data manipulation.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:cohere|CO_API_KEY)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-zA-Z0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["cohere","co_api_key"]},{id:"coinbase-access-token",description:"Detected a Coinbase Access Token, posing a risk of unauthorized access to cryptocurrency accounts and financial transactions.",regex:`(?i)[\\w.-]{0,50}?(?:coinbase)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["coinbase"]},{id:"confluent-access-token",description:"Identified a Confluent Access Token, which could compromise access to streaming data platforms and sensitive data flow.",regex:`(?i)[\\w.-]{0,50}?(?:confluent)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["confluent"]},{id:"confluent-secret-key",description:"Found a Confluent Secret Key, potentially risking unauthorized operations and data access within Confluent services.",regex:`(?i)[\\w.-]{0,50}?(?:confluent)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["confluent"]},{id:"contentful-delivery-api-token",description:"Discovered a Contentful delivery API token, posing a risk to content management systems and data integrity.",regex:`(?i)[\\w.-]{0,50}?(?:contentful)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{43})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["contentful"]},{id:"curl-auth-header",description:"Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.",regex:`\\bcurl\\b(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?i)(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t]([a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t]([\\w=~@.+/-]{8,})|([\\w=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}([\\w=~@.+/-]{8,}))"|'(?i)(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t]([a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t]([\\w=~@.+/-]{8,})|([\\w=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}([\\w=~@.+/-]{8,}))')(?:\\B|\\s|\\z)`,entropy:2.75,keywords:["curl"]},{id:"curl-auth-user",description:"Discovered a potential basic authorization token provided in a curl command, which could compromise the curl accessed resource.",regex:`\\bcurl\\b(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})("(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'([^:']{3,}:[^']{3,})'|((?:"[^"]{3,}"|'[^']{3,}'|[\\w$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[\\w\${}@.-]+)))(?:\\s|\\z)`,entropy:2,keywords:["curl"],allowlists:[{regexes:["[^:]+:(?:change(?:it|me)|pass(?:word)?|pwd|test|token|\\*+|x+)",`['"]?<[^>]+>['"]?:['"]?<[^>]+>|<[^:]+:[^>]+>['"]?`,"[^:]+:\\[[^]]+]",`['"]?[^:]+['"]?:['"]?\\$(?:\\d|\\w+|\\{(?:\\d|\\w+)})['"]?`,"\\$\\([^)]+\\):\\$\\([^)]+\\)",`['"]?\\$?{{[^}]+}}['"]?:['"]?\\$?{{[^}]+}}['"]?`]}]},{id:"databricks-api-token",description:"Uncovered a Databricks API token, which may compromise big data analytics platforms and sensitive data processing.",regex:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["dapi"]},{id:"datadog-access-token",description:"Detected a Datadog Access Token, potentially risking monitoring and analytics data exposure and manipulation.",regex:`(?i)[\\w.-]{0,50}?(?:datadog)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["datadog"]},{id:"defined-networking-api-token",description:"Identified a Defined Networking API token, which could lead to unauthorized network operations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:dnkey)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(dnkey-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dnkey"]},{id:"digitalocean-access-token",description:"Found a DigitalOcean OAuth Access Token, risking unauthorized cloud resource access and data compromise.",regex:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["doo_v1_"]},{id:"digitalocean-pat",description:"Discovered a DigitalOcean Personal Access Token, posing a threat to cloud infrastructure security and data privacy.",regex:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["dop_v1_"]},{id:"digitalocean-refresh-token",description:"Uncovered a DigitalOcean OAuth Refresh Token, which could allow prolonged unauthorized access and resource manipulation.",regex:`(?i)\\b(dor_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dor_v1_"]},{id:"discord-api-token",description:"Detected a Discord API key, potentially compromising communication channels and user data privacy on Discord.",regex:`(?i)[\\w.-]{0,50}?(?:discord)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["discord"]},{id:"discord-client-id",description:"Identified a Discord client ID, which may lead to unauthorized integrations and data exposure in Discord applications.",regex:`(?i)[\\w.-]{0,50}?(?:discord)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9]{18})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["discord"]},{id:"discord-client-secret",description:"Discovered a potential Discord client secret, risking compromised Discord bot integrations and data leaks.",regex:`(?i)[\\w.-]{0,50}?(?:discord)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["discord"]},{id:"doppler-api-token",description:"Discovered a Doppler API token, posing a risk to environment and secrets management security.",regex:"dp\\.pt\\.(?i)[a-z0-9]{43}",entropy:2,keywords:["dp.pt."]},{id:"droneci-access-token",description:"Detected a Droneci Access Token, potentially compromising continuous integration and deployment workflows.",regex:`(?i)[\\w.-]{0,50}?(?:droneci)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["droneci"]},{id:"dropbox-api-token",description:"Identified a Dropbox API secret, which could lead to unauthorized file access and data breaches in Dropbox storage.",regex:`(?i)[\\w.-]{0,50}?(?:dropbox)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{15})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dropbox"]},{id:"dropbox-long-lived-api-token",description:"Found a Dropbox long-lived API token, risking prolonged unauthorized access to cloud storage and sensitive data.",regex:`(?i)[\\w.-]{0,50}?(?:dropbox)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dropbox"]},{id:"dropbox-short-lived-api-token",description:"Discovered a Dropbox short-lived API token, posing a risk of temporary but potentially harmful data access and manipulation.",regex:`(?i)[\\w.-]{0,50}?(?:dropbox)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(sl\\.[a-z0-9\\-=_]{135})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dropbox"]},{id:"duffel-api-token",description:"Uncovered a Duffel API token, which may compromise travel platform integrations and sensitive customer data.",regex:"duffel_(?:test|live)_(?i)[a-z0-9_\\-=]{43}",entropy:2,keywords:["duffel_"]},{id:"dynatrace-api-token",description:"Detected a Dynatrace API token, potentially risking application performance monitoring and data exposure.",regex:"dt0c01\\.(?i)[a-z0-9]{24}\\.[a-z0-9]{64}",entropy:4,keywords:["dt0c01."]},{id:"easypost-api-token",description:"Identified an EasyPost API token, which could lead to unauthorized postal and shipment service access and data exposure.",regex:"\\bEZAK(?i)[a-z0-9]{54}\\b",entropy:2,keywords:["ezak"]},{id:"easypost-test-api-token",description:"Detected an EasyPost test API token, risking exposure of test environments and potentially sensitive shipment data.",regex:"\\bEZTK(?i)[a-z0-9]{54}\\b",entropy:2,keywords:["eztk"]},{id:"etsy-access-token",description:"Found an Etsy Access Token, potentially compromising Etsy shop management and customer data.",regex:`(?i)[\\w.-]{0,50}?(?:(?-i:ETSY|[Ee]tsy))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{24})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["etsy"]},{id:"facebook-access-token",description:"Discovered a Facebook Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`(?i)\\b(\\d{15,16}(\\||%)[0-9a-z\\-_]{27,40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["facebook"]},{id:"facebook-page-access-token",description:"Discovered a Facebook Page Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`\\b(EAA[MC](?i)[a-z0-9]{100,})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["eaam","eaac"]},{id:"facebook-secret",description:"Discovered a Facebook Application secret, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:facebook)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["facebook"]},{id:"fastly-api-token",description:"Uncovered a Fastly API key, which may compromise CDN and edge cloud services, leading to content delivery and security issues.",regex:`(?i)[\\w.-]{0,50}?(?:fastly)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["fastly"]},{id:"finicity-api-token",description:"Detected a Finicity API token, potentially risking financial data access and unauthorized financial operations.",regex:`(?i)[\\w.-]{0,50}?(?:finicity)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["finicity"]},{id:"finicity-client-secret",description:"Identified a Finicity Client Secret, which could lead to compromised financial service integrations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:finicity)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["finicity"]},{id:"finnhub-access-token",description:"Found a Finnhub Access Token, risking unauthorized access to financial market data and analytics.",regex:`(?i)[\\w.-]{0,50}?(?:finnhub)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["finnhub"]},{id:"flickr-access-token",description:"Discovered a Flickr Access Token, posing a risk of unauthorized photo management and potential data leakage.",regex:`(?i)[\\w.-]{0,50}?(?:flickr)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["flickr"]},{id:"flutterwave-encryption-key",description:"Uncovered a Flutterwave Encryption Key, which may compromise payment processing and sensitive financial information.",regex:"FLWSECK_TEST-(?i)[a-h0-9]{12}",entropy:2,keywords:["flwseck_test"]},{id:"flutterwave-public-key",description:"Detected a Finicity Public Key, potentially exposing public cryptographic operations and integrations.",regex:"FLWPUBK_TEST-(?i)[a-h0-9]{32}-X",entropy:2,keywords:["flwpubk_test"]},{id:"flutterwave-secret-key",description:"Identified a Flutterwave Secret Key, risking unauthorized financial transactions and data breaches.",regex:"FLWSECK_TEST-(?i)[a-h0-9]{32}-X",entropy:2,keywords:["flwseck_test"]},{id:"flyio-access-token",description:"Uncovered a Fly.io API key",regex:`\\b((?:fo1_[\\w-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{100,}={0,3}|fm2_[a-zA-Z0-9+\\/]{100,}={0,3}))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["fo1_","fm1","fm2_"]},{id:"frameio-api-token",description:"Found a Frame.io API token, potentially compromising video collaboration and project management.",regex:"fio-u-(?i)[a-z0-9\\-_=]{64}",keywords:["fio-u-"]},{id:"freemius-secret-key",description:"Detected a Freemius secret key, potentially exposing sensitive information.",regex:`(?i)["']secret_key["']\\s*=>\\s*["'](sk_[\\S]{29})["']`,path:"(?i)\\.php$",keywords:["secret_key"]},{id:"freshbooks-access-token",description:"Discovered a Freshbooks Access Token, posing a risk to accounting software access and sensitive financial data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:freshbooks)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["freshbooks"]},{id:"gcp-api-key",description:"Uncovered a GCP API key, which could lead to unauthorized access to Google Cloud services and data breaches.",regex:`\\b(AIza[\\w-]{35})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["aiza"],allowlists:[{regexes:["AIzaSyabcdefghijklmnopqrstuvwxyz1234567","AIzaSyAnLA7NfeLquW1tJFpx_eQCxoX-oo6YyIs","AIzaSyCkEhVjf3pduRDt6d1yKOMitrUEke8agEM","AIzaSyDMAScliyLx7F0NPDEJi1QmyCgHIAODrlU","AIzaSyD3asb-2pEZVqMkmL6M9N6nHZRR_znhrh0","AIzayDNSXIbFmlXbIE6mCzDLQAqITYefhixbX4A","AIzaSyAdOS2zB6NCsk1pCdZ4-P6GBdi_UUPwX7c","AIzaSyASWm6HmTMdYWpgMnjRBjxcQ9CKctWmLd4","AIzaSyANUvH9H9BsUccjsu2pCmEkOPjjaXeDQgY","AIzaSyA5_iVawFQ8ABuTZNUdcwERLJv_a_p4wtM","AIzaSyA4UrcGxgwQFTfaI3no3t7Lt1sjmdnP5sQ","AIzaSyDSb51JiIcB6OJpwwMicseKRhhrOq1cS7g","AIzaSyBF2RrAIm4a0mO64EShQfqfd2AFnzAvvuU","AIzaSyBcE-OOIbhjyR83gm4r2MFCu4MJmprNXsw","AIzaSyB8qGxt4ec15vitgn44duC5ucxaOi4FmqE","AIzaSyA8vmApnrHNFE0bApF4hoZ11srVL_n0nvY"]}]},{id:"generic-api-key",description:"Detected a Generic API Key, potentially exposing access to various services and sensitive operations.",regex:`(?i)[\\w.-]{0,50}?(?:access|auth|(?-i:[Aa]pi|API)|credential|creds|key|passw(?:or)?d|secret|token)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([\\w.=-]{10,150}|[a-z0-9][a-z0-9+/]{11,}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["access","api","auth","key","credential","creds","passwd","password","secret","token"],allowlists:[{regexes:["^[a-zA-Z_.-]+$"]},{description:"Allowlist for Generic API Keys",regexTarget:"match",regexes:["(?i)(?:access(?:ibility|or)|access[_.-]?id|random[_.-]?access|api[_.-]?(?:id|name|version)|rapid|capital|[a-z0-9-]*?api[a-z0-9-]*?:jar:|author|X-MS-Exchange-Organization-Auth|Authentication-Results|(?:credentials?[_.-]?id|withCredentials)|(?:bucket|foreign|hot|idx|natural|primary|pub(?:lic)?|schema|sequence)[_.-]?key|(?:turkey)|key[_.-]?(?:alias|board|code|frame|id|length|mesh|name|pair|press(?:ed)?|ring|selector|signature|size|stone|storetype|word|up|down|left|right)|key[_.-]?vault[_.-]?(?:id|name)|keyVaultToStoreSecrets|key(?:store|tab)[_.-]?(?:file|path)|issuerkeyhash|(?-i:[DdMm]onkey|[DM]ONKEY)|keying|(?:secret)[_.-]?(?:length|name|size)|UserSecretsId|(?:csrf)[_.-]?token|(?:io\\.jsonwebtoken[ \\t]?:[ \\t]?[\\w-]+)|(?:api|credentials|token)[_.-]?(?:endpoint|ur[il])|public[_.-]?token|(?:key|token)[_.-]?file|(?-i:(?:[A-Z_]+=\\n[A-Z_]+=|[a-z_]+=\\n[a-z_]+=)(?:\\n|\\z))|(?-i:(?:[A-Z.]+=\\n[A-Z.]+=|[a-z.]+=\\n[a-z.]+=)(?:\\n|\\z)))"],stopwords:["000000","6fe4476ee5a1832882e326b506d14126","_ec2_","aaaaaa","about","abstract","academy","acces","account","act-","act.","act_","action","active","actively","activity","adapter","add-","add-on","add.","add_","addon","addres","admin","adobe","advanced","adventure","agent","agile","air-","air.","air_","ajax","akka","alert","alfred","algorithm","all-","all.","all_","alloy","alpha","amazon","amqp","analysi","analytic","analyzer","android","angular","angularj","animate","animation","another","ansible","answer","ant-","ant.","ant_","any-","any.","any_","apache","app-","app.","app_","apple","arch","archive","archived","arduino","array","art-","art.","art_","article","asp-","asp.","asp_","asset","async","atom","attention","audio","audit","aura","auth","author","authorize","auto","automated","automatic","awesome","aws_","azure","back","backbone","backend","backup","bar-","bar.","bar_","base","based","bash","basic","batch","been","beer","behavior","being","benchmark","best","beta","better","big-","big.","big_","binary","binding","bit-","bit.","bit_","bitcoin","block","blog","board","book","bookmark","boost","boot","bootstrap","bosh","bot-","bot.","bot_","bower","box-","box.","box_","boxen","bracket","branch","bridge","browser","brunch","buffer","bug-","bug.","bug_","build","builder","building","buildout","buildpack","built","bundle","busines","but-","but.","but_","button","cache","caching","cakephp","calendar","call","camera","campfire","can-","can.","can_","canva","captcha","capture","card","carousel","case","cassandra","cat-","cat.","cat_","category","center","cento","challenge","change","changelog","channel","chart","chat","cheat","check","checker","chef","ches","chinese","chosen","chrome","ckeditor","clas","classe","classic","clean","cli-","cli.","cli_","client","clojure","clone","closure","cloud","club","cluster","cms-","cms_","coco","code","coding","coffee","color","combination","combo","command","commander","comment","commit","common","community","compas","compiler","complete","component","composer","computer","computing","con-","con.","con_","concept","conf","config","connect","connector","console","contact","container","contao","content","contest","context","control","convert","converter","conway'","cookbook","cookie","cool","copy","cordova","core","couchbase","couchdb","countdown","counter","course","craft","crawler","create","creating","creator","credential","crm-","crm.","crm_","cros","crud","csv-","csv.","csv_","cube","cucumber","cuda","current","currently","custom","daemon","dark","dart","dash","dashboard","data","database","date","day-","day.","day_","dead","debian","debug","debugger","deck","define","del-","del.","del_","delete","demo","deploy","design","designer","desktop","detection","detector","dev-","dev.","dev_","develop","developer","device","devise","diff","digital","directive","directory","discovery","display","django","dns-","dns_","doc-","doc.","doc_","docker","docpad","doctrine","document","doe-","doe.","doe_","dojo","dom-","dom.","dom_","domain","don't","done","dot-","dot.","dot_","dotfile","download","draft","drag","drill","drive","driven","driver","drop","dropbox","drupal","dsl-","dsl.","dsl_","dynamic","easy","ecdsa","eclipse","edit","editing","edition","editor","element","emac","email","embed","embedded","ember","emitter","emulator","encoding","endpoint","engine","english","enhanced","entity","entry","env_","episode","erlang","error","espresso","event","evented","example","exchange","exercise","experiment","expire","exploit","explorer","export","exporter","expres","ext-","ext.","ext_","extended","extension","external","extra","extractor","fabric","facebook","factory","fake","fast","feature","feed","fewfwef","ffmpeg","field","file","filter","find","finder","firefox","firmware","first","fish","fix-","fix_","flash","flask","flat","flex","flexible","flickr","flow","fluent","fluentd","fluid","folder","font","force","foreman","fork","form","format","formatter","forum","foundry","framework","free","friend","friendly","front-end","frontend","ftp-","ftp.","ftp_","fuel","full","fun-","fun.","fun_","func","future","gaia","gallery","game","gateway","gem-","gem.","gem_","gen-","gen.","gen_","general","generator","generic","genetic","get-","get.","get_","getenv","getting","ghost","gist","git-","git.","git_","github","gitignore","gitlab","glas","gmail","gnome","gnu-","gnu.","gnu_","goal","golang","gollum","good","google","gpu-","gpu.","gpu_","gradle","grail","graph","graphic","great","grid","groovy","group","grunt","guard","gui-","gui.","gui_","guide","guideline","gulp","gwt-","gwt.","gwt_","hack","hackathon","hacker","hacking","hadoop","haml","handler","hardware","has-","has_","hash","haskell","have","haxe","hello","help","helper","here","hero","heroku","high","hipchat","history","home","homebrew","homepage","hook","host","hosting","hot-","hot.","hot_","house","how-","how.","how_","html","http","hub-","hub.","hub_","hubot","human","icon","ide-","ide.","ide_","idea","identity","idiomatic","image","impact","import","important","importer","impres","index","infinite","info","injection","inline","input","inside","inspector","instagram","install","installer","instant","intellij","interface","internet","interview","into","intro","ionic","iphone","ipython","irc-","irc_","iso-","iso.","iso_","issue","jade","jasmine","java","jbos","jekyll","jenkin","jetbrains","job-","job.","job_","joomla","jpa-","jpa.","jpa_","jquery","json","just","kafka","karma","kata","kernel","keyboard","kindle","kit-","kit.","kit_","kitchen","knife","koan","kohana","lab-","lab.","lab_","lambda","lamp","language","laravel","last","latest","latex","launcher","layer","layout","lazy","ldap","leaflet","league","learn","learning","led-","led.","led_","leetcode","les-","les.","les_","level","leveldb","lib-","lib.","lib_","librarie","library","license","life","liferay","light","lightbox","like","line","link","linked","linkedin","linux","lisp","list","lite","little","load","loader","local","location","lock","log-","log.","log_","logger","logging","logic","login","logstash","longer","look","love","lua-","lua.","lua_","mac-","mac.","mac_","machine","made","magento","magic","mail","make","maker","making","man-","man.","man_","manage","manager","manifest","manual","map-","map.","map_","mapper","mapping","markdown","markup","master","math","matrix","maven","md5","mean","media","mediawiki","meetup","memcached","memory","menu","merchant","message","messaging","meta","metadata","meteor","method","metric","micro","middleman","migration","minecraft","miner","mini","minimal","mirror","mit-","mit.","mit_","mobile","mocha","mock","mod-","mod.","mod_","mode","model","modern","modular","module","modx","money","mongo","mongodb","mongoid","mongoose","monitor","monkey","more","motion","moved","movie","mozilla","mqtt","mule","multi","multiple","music","mustache","mvc-","mvc.","mvc_","mysql","nagio","name","native","need","neo-","neo.","neo_","nest","nested","net-","net.","net_","nette","network","new-","new.","new_","next","nginx","ninja","nlp-","nlp.","nlp_","node","nodej","nosql","not-","not.","not_","note","notebook","notepad","notice","notifier","now-","now.","now_","number","oauth","object","objective","obsolete","ocaml","octopres","official","old-","old.","old_","onboard","online","only","open","opencv","opengl","openshift","openwrt","option","oracle","org-","org.","org_","origin","original","orm-","orm.","orm_","osx-","osx_","our-","our.","our_","out-","out.","out_","output","over","overview","own-","own.","own_","pack","package","packet","page","panel","paper","paperclip","para","parallax","parallel","parse","parser","parsing","particle","party","password","patch","path","pattern","payment","paypal","pdf-","pdf.","pdf_","pebble","people","perl","personal","phalcon","phoenix","phone","phonegap","photo","php-","php.","php_","physic","picker","pipeline","platform","play","player","please","plu-","plu.","plu_","plug-in","plugin","plupload","png-","png.","png_","poker","polyfill","polymer","pool","pop-","pop.","pop_","popcorn","popup","port","portable","portal","portfolio","post","power","powered","powerful","prelude","pretty","preview","principle","print","pro-","pro.","pro_","problem","proc","product","profile","profiler","program","progres","project","protocol","prototype","provider","proxy","public","pull","puppet","pure","purpose","push","pusher","pyramid","python","quality","query","queue","quick","rabbitmq","rack","radio","rail","railscast","random","range","raspberry","rdf-","rdf.","rdf_","react","reactive","read","reader","readme","ready","real","real-time","reality","realtime","recipe","recorder","red-","red.","red_","reddit","redi","redmine","reference","refinery","refresh","registry","related","release","remote","rendering","repo","report","request","require","required","requirej","research","resource","response","resque","rest","restful","resume","reveal","reverse","review","riak","rich","right","ring","robot","role","room","router","routing","rpc-","rpc.","rpc_","rpg-","rpg.","rpg_","rspec","ruby-","ruby.","ruby_","rule","run-","run.","run_","runner","running","runtime","rust","rvm-","rvm.","rvm_","salt","sample","sandbox","sas-","sas.","sas_","sbt-","sbt.","sbt_","scala","scalable","scanner","schema","scheme","school","science","scraper","scratch","screen","script","scroll","scs-","scs.","scs_","sdk-","sdk.","sdk_","sdl-","sdl.","sdl_","search","secure","security","see-","see.","see_","seed","select","selector","selenium","semantic","sencha","send","sentiment","serie","server","service","session","set-","set.","set_","setting","setup","sha1","sha2","sha256","share","shared","sharing","sheet","shell","shield","shipping","shop","shopify","shortener","should","show","showcase","side","silex","simple","simulator","single","site","skeleton","sketch","skin","slack","slide","slider","slim","small","smart","smtp","snake","snapshot","snippet","soap","social","socket","software","solarized","solr","solution","solver","some","soon","source","space","spark","spatial","spec","sphinx","spine","spotify","spree","spring","sprite","sql-","sql.","sql_","sqlite","ssh-","ssh.","ssh_","stack","staging","standard","stanford","start","started","starter","startup","stat","statamic","state","static","statistic","statsd","statu","steam","step","still","stm-","stm.","stm_","storage","store","storm","story","strategy","stream","streaming","string","stripe","structure","studio","study","stuff","style","sublime","sugar","suite","summary","super","support","supported","svg-","svg.","svg_","svn-","svn.","svn_","swagger","swift","switch","switcher","symfony","symphony","sync","synopsi","syntax","system","tab-","tab.","tab_","table","tag-","tag.","tag_","talk","target","task","tcp-","tcp.","tcp_","tdd-","tdd.","tdd_","team","tech","template","term","terminal","testing","tetri","text","textmate","theme","theory","three","thrift","time","timeline","timer","tiny","tinymce","tip-","tip.","tip_","title","todo","todomvc","token","tool","toolbox","toolkit","top-","top.","top_","tornado","touch","tower","tracker","tracking","traffic","training","transfer","translate","transport","tree","trello","try-","try.","try_","tumblr","tut-","tut.","tut_","tutorial","tweet","twig","twitter","type","typo","ubuntu","uiview","ultimate","under","unit","unity","universal","unix","update","updated","upgrade","upload","uploader","uri-","uri.","uri_","url-","url.","url_","usage","usb-","usb.","usb_","use-","use.","use_","used","useful","user","using","util","utilitie","utility","vagrant","validator","value","variou","varnish","version","via-","via.","via_","video","view","viewer","vim-","vim.","vim_","vimrc","virtual","vision","visual","vpn","want","warning","watch","watcher","wave","way-","way.","way_","weather","web-","web_","webapp","webgl","webhook","webkit","webrtc","website","websocket","welcome","what","what'","when","where","which","why-","why.","why_","widget","wifi","wiki","win-","win.","win_","window","wip-","wip.","wip_","within","without","wizard","word","wordpres","work","worker","workflow","working","workshop","world","wrapper","write","writer","writing","written","www-","www.","www_","xamarin","xcode","xml-","xml.","xml_","xmpp","xxxxxx","yahoo","yaml","yandex","yeoman","yet-","yet.","yet_","yii-","yii.","yii_","youtube","yui-","yui.","yui_","zend","zero","zip-","zip.","zip_","zsh-","zsh.","zsh_"]},{regexTarget:"line",regexes:["--mount=type=secret,",`import[ \\t]+{[ \\t\\w,]+}[ \\t]+from[ \\t]+['"][^'"]+['"]`]},{condition:"AND",paths:["\\.bb$","\\.bbappend$","\\.bbclass$","\\.inc$"],regexTarget:"line",regexes:['LICENSE[^=]*=\\s*"[^"]+','LIC_FILES_CHKSUM[^=]*=\\s*"[^"]+','SRC[^=]*=\\s*"[a-zA-Z0-9]+']}]},{id:"github-app-token",description:"Identified a GitHub App Token, which may compromise GitHub application integrations and source code security.",regex:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",entropy:3,keywords:["ghu_","ghs_"],allowlists:[{paths:["(?:^|/)@octokit/auth-token/README\\.md$"]}]},{id:"github-fine-grained-pat",description:"Found a GitHub Fine-Grained Personal Access Token, risking unauthorized repository access and code manipulation.",regex:"github_pat_\\w{82}",entropy:3,keywords:["github_pat_"]},{id:"github-oauth",description:"Discovered a GitHub OAuth Access Token, posing a risk of compromised GitHub account integrations and data leaks.",regex:"gho_[0-9a-zA-Z]{36}",entropy:3,keywords:["gho_"]},{id:"github-pat",description:"Uncovered a GitHub Personal Access Token, potentially leading to unauthorized repository access and sensitive content exposure.",regex:"ghp_[0-9a-zA-Z]{36}",entropy:3,keywords:["ghp_"],allowlists:[{paths:["(?:^|/)@octokit/auth-token/README\\.md$"]}]},{id:"github-refresh-token",description:"Detected a GitHub Refresh Token, which could allow prolonged unauthorized access to GitHub services.",regex:"ghr_[0-9a-zA-Z]{36}",entropy:3,keywords:["ghr_"]},{id:"gitlab-cicd-job-token",description:"Identified a GitLab CI/CD Job Token, potential access to projects and some APIs on behalf of a user while the CI job is running.",regex:"glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}",entropy:3,keywords:["glcbt-"]},{id:"gitlab-deploy-token",description:"Identified a GitLab Deploy Token, risking access to repositories, packages and containers with write access.",regex:"gldt-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["gldt-"]},{id:"gitlab-feature-flag-client-token",description:"Identified a GitLab feature flag client token, risks exposing user lists and features flags used by an application.",regex:"glffct-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["glffct-"]},{id:"gitlab-feed-token",description:"Identified a GitLab feed token, risking exposure of user data.",regex:"glft-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["glft-"]},{id:"gitlab-incoming-mail-token",description:"Identified a GitLab incoming mail token, risking manipulation of data sent by mail.",regex:"glimt-[0-9a-zA-Z_\\-]{25}",entropy:3,keywords:["glimt-"]},{id:"gitlab-kubernetes-agent-token",description:"Identified a GitLab Kubernetes Agent token, risking access to repos and registry of projects connected via agent.",regex:"glagent-[0-9a-zA-Z_\\-]{50}",entropy:3,keywords:["glagent-"]},{id:"gitlab-oauth-app-secret",description:"Identified a GitLab OIDC Application Secret, risking access to apps using GitLab as authentication provider.",regex:"gloas-[0-9a-zA-Z_\\-]{64}",entropy:3,keywords:["gloas-"]},{id:"gitlab-pat",description:"Identified a GitLab Personal Access Token, risking unauthorized access to GitLab repositories and codebase exposure.",regex:"glpat-[\\w-]{20}",entropy:3,keywords:["glpat-"]},{id:"gitlab-pat-routable",description:"Identified a GitLab Personal Access Token (routable), risking unauthorized access to GitLab repositories and codebase exposure.",regex:"\\bglpat-[0-9a-zA-Z_-]{27,300}\\.[0-9a-z]{2}[0-9a-z]{7}\\b",entropy:4,keywords:["glpat-"]},{id:"gitlab-ptt",description:"Found a GitLab Pipeline Trigger Token, potentially compromising continuous integration workflows and project security.",regex:"glptt-[0-9a-f]{40}",entropy:3,keywords:["glptt-"]},{id:"gitlab-rrt",description:"Discovered a GitLab Runner Registration Token, posing a risk to CI/CD pipeline integrity and unauthorized access.",regex:"GR1348941[\\w-]{20}",entropy:3,keywords:["gr1348941"]},{id:"gitlab-runner-authentication-token",description:"Discovered a GitLab Runner Authentication Token, posing a risk to CI/CD pipeline integrity and unauthorized access.",regex:"glrt-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["glrt-"]},{id:"gitlab-runner-authentication-token-routable",description:"Discovered a GitLab Runner Authentication Token (Routable), posing a risk to CI/CD pipeline integrity and unauthorized access.",regex:"\\bglrt-t\\d_[0-9a-zA-Z_\\-]{27,300}\\.[0-9a-z]{2}[0-9a-z]{7}\\b",entropy:4,keywords:["glrt-"]},{id:"gitlab-scim-token",description:"Discovered a GitLab SCIM Token, posing a risk to unauthorized access for a organization or instance.",regex:"glsoat-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["glsoat-"]},{id:"gitlab-session-cookie",description:"Discovered a GitLab Session Cookie, posing a risk to unauthorized access to a user account.",regex:"_gitlab_session=[0-9a-z]{32}",entropy:3,keywords:["_gitlab_session="]},{id:"gitter-access-token",description:"Uncovered a Gitter Access Token, which may lead to unauthorized access to chat and communication services.",regex:`(?i)[\\w.-]{0,50}?(?:gitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["gitter"]},{id:"gocardless-api-token",description:"Detected a GoCardless API token, potentially risking unauthorized direct debit payment operations and financial data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:gocardless)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(live_(?i)[a-z0-9\\-_=]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["live_","gocardless"]},{id:"grafana-api-key",description:"Identified a Grafana API key, which could compromise monitoring dashboards and sensitive data analytics.",regex:`(?i)\\b(eyJrIjoi[A-Za-z0-9]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["eyjrijoi"]},{id:"grafana-cloud-api-token",description:"Found a Grafana cloud API token, risking unauthorized access to cloud-based monitoring services and data exposure.",regex:`(?i)\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["glc_"]},{id:"grafana-service-account-token",description:"Discovered a Grafana service account token, posing a risk of compromised monitoring services and data integrity.",regex:`(?i)\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["glsa_"]},{id:"harness-api-key",description:"Identified a Harness Access Token (PAT or SAT), risking unauthorized access to a Harness account.",regex:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}",keywords:["pat.","sat."]},{id:"hashicorp-tf-api-token",description:"Uncovered a HashiCorp Terraform user/org API token, which may lead to unauthorized infrastructure management and security breaches.",regex:"(?i)[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}",entropy:3.5,keywords:["atlasv1"]},{id:"hashicorp-tf-password",description:"Identified a HashiCorp Terraform password field, risking unauthorized infrastructure configuration and security breaches.",regex:`(?i)[\\w.-]{0,50}?(?:administrator_login_password|password)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}("[a-z0-9=_\\-]{8,20}")(?:[\\x60'"\\s;]|\\\\[nr]|$)`,path:"(?i)\\.(?:tf|hcl)$",entropy:2,keywords:["administrator_login_password","password"]},{id:"heroku-api-key",description:"Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",regex:`(?i)[\\w.-]{0,50}?(?:heroku)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["heroku"]},{id:"heroku-api-key-v2",description:"Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",regex:`\\b((HRKU-AA[0-9a-zA-Z_-]{58}))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["hrku-aa"]},{id:"hubspot-api-key",description:"Found a HubSpot API Token, posing a risk to CRM data integrity and unauthorized marketing operations.",regex:`(?i)[\\w.-]{0,50}?(?:hubspot)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["hubspot"]},{id:"huggingface-access-token",description:"Discovered a Hugging Face Access token, which could lead to unauthorized access to AI models and sensitive data.",regex:`\\b(hf_(?i:[a-z]{34}))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["hf_"]},{id:"huggingface-organization-api-token",description:"Uncovered a Hugging Face Organization API token, potentially compromising AI organization accounts and associated data.",regex:`\\b(api_org_(?i:[a-z]{34}))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["api_org_"]},{id:"infracost-api-token",description:"Detected an Infracost API Token, risking unauthorized access to cloud cost estimation tools and financial data.",regex:`\\b(ico-[a-zA-Z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["ico-"]},{id:"intercom-api-key",description:"Identified an Intercom API Token, which could compromise customer communication channels and data privacy.",regex:`(?i)[\\w.-]{0,50}?(?:intercom)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{60})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["intercom"]},{id:"intra42-client-secret",description:"Found a Intra42 client secret, which could lead to unauthorized access to the 42School API and sensitive data.",regex:`\\b(s-s4t2(?:ud|af)-(?i)[abcdef0123456789]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["intra","s-s4t2ud-","s-s4t2af-"]},{id:"jfrog-api-key",description:"Found a JFrog API Key, posing a risk of unauthorized access to software artifact repositories and build pipelines.",regex:`(?i)[\\w.-]{0,50}?(?:jfrog|artifactory|bintray|xray)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{73})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["jfrog","artifactory","bintray","xray"]},{id:"jfrog-identity-token",description:"Discovered a JFrog Identity Token, potentially compromising access to JFrog services and sensitive software artifacts.",regex:`(?i)[\\w.-]{0,50}?(?:jfrog|artifactory|bintray|xray)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["jfrog","artifactory","bintray","xray"]},{id:"jwt",description:"Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.",regex:`\\b(ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["ey"]},{id:"jwt-base64",description:"Detected a Base64-encoded JSON Web Token, posing a risk of exposing encoded authentication and data exchange information.",regex:"\\bZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}",entropy:2,keywords:["zxlk"]},{id:"kraken-access-token",description:"Identified a Kraken Access Token, potentially compromising cryptocurrency trading accounts and financial security.",regex:`(?i)[\\w.-]{0,50}?(?:kraken)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9\\/=_\\+\\-]{80,90})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["kraken"]},{id:"kubernetes-secret-yaml",description:"Possible Kubernetes Secret detected, posing a risk of leaking credentials/tokens from your deployments",regex:`(?i)(?:\\bkind:[ \\t]*["']?\\bsecret\\b["']?(?s:.){0,200}?\\bdata:(?s:.){0,100}?\\s+([\\w.-]+:(?:[ \\t]*(?:\\||>[-+]?)\\s+)?[ \\t]*(?:["']?[a-z0-9+/]{10,}={0,3}["']?|\\{\\{[ \\t\\w"|$:=,.-]+}}|""|''))|\\bdata:(?s:.){0,100}?\\s+([\\w.-]+:(?:[ \\t]*(?:\\||>[-+]?)\\s+)?[ \\t]*(?:["']?[a-z0-9+/]{10,}={0,3}["']?|\\{\\{[ \\t\\w"|$:=,.-]+}}|""|''))(?s:.){0,200}?\\bkind:[ \\t]*["']?\\bsecret\\b["']?)`,path:"(?i)\\.ya?ml$",keywords:["secret"],allowlists:[{regexes:[`[\\w.-]+:(?:[ \\t]*(?:\\||>[-+]?)\\s+)?[ \\t]*(?:\\{\\{[ \\t\\w"|$:=,.-]+}}|""|'')`]},{regexTarget:"match",regexes:["(kind:(?s:.)+\\n---\\n(?s:.)+\\bdata:|data:(?s:.)+\\n---\\n(?s:.)+\\bkind:)"]}]},{id:"kucoin-access-token",description:"Found a Kucoin Access Token, risking unauthorized access to cryptocurrency exchange services and transactions.",regex:`(?i)[\\w.-]{0,50}?(?:kucoin)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{24})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["kucoin"]},{id:"kucoin-secret-key",description:"Discovered a Kucoin Secret Key, which could lead to compromised cryptocurrency operations and financial data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:kucoin)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["kucoin"]},{id:"launchdarkly-access-token",description:"Uncovered a Launchdarkly Access Token, potentially compromising feature flag management and application functionality.",regex:`(?i)[\\w.-]{0,50}?(?:launchdarkly)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["launchdarkly"]},{id:"linear-api-key",description:"Detected a Linear API Token, posing a risk to project management tools and sensitive task data.",regex:"lin_api_(?i)[a-z0-9]{40}",entropy:2,keywords:["lin_api_"]},{id:"linear-client-secret",description:"Identified a Linear Client Secret, which may compromise secure integrations and sensitive project management data.",regex:`(?i)[\\w.-]{0,50}?(?:linear)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["linear"]},{id:"linkedin-client-id",description:"Found a LinkedIn Client ID, risking unauthorized access to LinkedIn integrations and professional data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:linked[_-]?in)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{14})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["linkedin","linked_in","linked-in"]},{id:"linkedin-client-secret",description:"Discovered a LinkedIn Client secret, potentially compromising LinkedIn application integrations and user data.",regex:`(?i)[\\w.-]{0,50}?(?:linked[_-]?in)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["linkedin","linked_in","linked-in"]},{id:"lob-api-key",description:"Uncovered a Lob API Key, which could lead to unauthorized access to mailing and address verification services.",regex:`(?i)[\\w.-]{0,50}?(?:lob)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}((live|test)_[a-f0-9]{35})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["test_","live_"]},{id:"lob-pub-api-key",description:"Detected a Lob Publishable API Key, posing a risk of exposing mail and print service integrations.",regex:`(?i)[\\w.-]{0,50}?(?:lob)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}((test|live)_pub_[a-f0-9]{31})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["test_pub","live_pub","_pub"]},{id:"looker-client-id",description:"Found a Looker Client ID, risking unauthorized access to a Looker account and exposing sensitive data.",regex:`(?i)[\\w.-]{0,50}?(?:looker)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["looker"]},{id:"looker-client-secret",description:"Found a Looker Client Secret, risking unauthorized access to a Looker account and exposing sensitive data.",regex:`(?i)[\\w.-]{0,50}?(?:looker)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{24})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["looker"]},{id:"mailchimp-api-key",description:"Identified a Mailchimp API key, potentially compromising email marketing campaigns and subscriber data.",regex:`(?i)[\\w.-]{0,50}?(?:MailchimpSDK.initialize|mailchimp)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32}-us\\d\\d)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mailchimp"]},{id:"mailgun-private-api-token",description:"Found a Mailgun private API token, risking unauthorized email service operations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(key-[a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mailgun"]},{id:"mailgun-pub-key",description:"Discovered a Mailgun public validation key, which could expose email verification processes and associated data.",regex:`(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(pubkey-[a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mailgun"]},{id:"mailgun-signing-key",description:"Uncovered a Mailgun webhook signing key, potentially compromising email automation and data integrity.",regex:`(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mailgun"]},{id:"mapbox-api-token",description:"Detected a MapBox API token, posing a risk to geospatial services and sensitive location data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:mapbox)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mapbox"]},{id:"mattermost-access-token",description:"Identified a Mattermost Access Token, which may compromise team communication channels and data privacy.",regex:`(?i)[\\w.-]{0,50}?(?:mattermost)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{26})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mattermost"]},{id:"maxmind-license-key",description:"Discovered a potential MaxMind license key.",regex:`\\b([A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["_mmk"]},{id:"messagebird-api-token",description:"Found a MessageBird API token, risking unauthorized access to communication platforms and message data.",regex:`(?i)[\\w.-]{0,50}?(?:message[_-]?bird)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{25})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["messagebird","message-bird","message_bird"]},{id:"messagebird-client-id",description:"Discovered a MessageBird client ID, potentially compromising API integrations and sensitive communication data.",regex:`(?i)[\\w.-]{0,50}?(?:message[_-]?bird)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["messagebird","message-bird","message_bird"]},{id:"microsoft-teams-webhook",description:"Uncovered a Microsoft Teams Webhook, which could lead to unauthorized access to team collaboration tools and data leaks.",regex:"https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}",keywords:["webhook.office.com","webhookb2","incomingwebhook"]},{id:"netlify-access-token",description:"Detected a Netlify Access Token, potentially compromising web hosting services and site management.",regex:`(?i)[\\w.-]{0,50}?(?:netlify)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{40,46})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["netlify"]},{id:"new-relic-browser-api-token",description:"Identified a New Relic ingest browser API token, risking unauthorized access to application performance data and analytics.",regex:`(?i)[\\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(NRJS-[a-f0-9]{19})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["nrjs-"]},{id:"new-relic-insert-key",description:"Discovered a New Relic insight insert key, compromising data injection into the platform.",regex:`(?i)[\\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(NRII-[a-z0-9-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["nrii-"]},{id:"new-relic-user-api-id",description:"Found a New Relic user API ID, posing a risk to application monitoring services and data integrity.",regex:`(?i)[\\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["new-relic","newrelic","new_relic"]},{id:"new-relic-user-api-key",description:"Discovered a New Relic user API Key, which could lead to compromised application insights and performance monitoring.",regex:`(?i)[\\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(NRAK-[a-z0-9]{27})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["nrak"]},{id:"notion-api-token",description:"Notion API token",regex:`\\b(ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["ntn_"]},{id:"npm-access-token",description:"Uncovered an npm access token, potentially compromising package management and code repository access.",regex:`(?i)\\b(npm_[a-z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["npm_"]},{id:"nuget-config-password",description:"Identified a password within a Nuget config file, potentially compromising package management access.",regex:'(?i)<add key=\\"(?:(?:ClearText)?Password)\\"\\s*value=\\"(.{8,})\\"\\s*/>',path:"(?i)nuget\\.config$",entropy:1,keywords:["<add key="],allowlists:[{regexes:["33f!!lloppa","hal\\+9ooo_da!sY","^\\%\\S.*\\%$"]}]},{id:"nytimes-access-token",description:"Detected a Nytimes Access Token, risking unauthorized access to New York Times APIs and content services.",regex:`(?i)[\\w.-]{0,50}?(?:nytimes|new-york-times,|newyorktimes)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["nytimes","new-york-times","newyorktimes"]},{id:"octopus-deploy-api-key",description:"Discovered a potential Octopus Deploy API key, risking application deployments and operational security.",regex:`\\b(API-[A-Z0-9]{26})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["api-"]},{id:"okta-access-token",description:"Identified an Okta Access Token, which may compromise identity management services and user authentication data.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:(?-i:[Oo]kta|OKTA))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(00[\\w=\\-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["okta"]},{id:"openai-api-key",description:"Found an OpenAI API Key, posing a risk of unauthorized access to AI services and data manipulation.",regex:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["t3blbkfj"]},{id:"openshift-user-token",description:"Found an OpenShift user token, potentially compromising an OpenShift/Kubernetes cluster.",regex:"\\b(sha256~[\\w-]{43})(?:[^\\w-]|\\z)",entropy:3.5,keywords:["sha256~"]},{id:"perplexity-api-key",description:"Detected a Perplexity API key, which could lead to unauthorized access to Perplexity AI services and data exposure.",regex:`\\b(pplx-[a-zA-Z0-9]{48})(?:[\\x60'"\\s;]|\\\\[nr]|$|\\b)`,entropy:4,keywords:["pplx-"]},{id:"pkcs12-file",description:"Found a PKCS #12 file, which commonly contain bundled private keys.",path:"(?i)(?:^|\\/)[^\\/]+\\.p(?:12|fx)$"},{id:"plaid-api-token",description:"Discovered a Plaid API Token, potentially compromising financial data aggregation and banking services.",regex:`(?i)[\\w.-]{0,50}?(?:plaid)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["plaid"]},{id:"plaid-client-id",description:"Uncovered a Plaid Client ID, which could lead to unauthorized financial service integrations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:plaid)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{24})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["plaid"]},{id:"plaid-secret-key",description:"Detected a Plaid Secret key, risking unauthorized access to financial accounts and sensitive transaction data.",regex:`(?i)[\\w.-]{0,50}?(?:plaid)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{30})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["plaid"]},{id:"planetscale-api-token",description:"Identified a PlanetScale API token, potentially compromising database management and operations.",regex:`\\b(pscale_tkn_(?i)[\\w=\\.-]{32,64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["pscale_tkn_"]},{id:"planetscale-oauth-token",description:"Found a PlanetScale OAuth token, posing a risk to database access control and sensitive data integrity.",regex:`\\b(pscale_oauth_[\\w=\\.-]{32,64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["pscale_oauth_"]},{id:"planetscale-password",description:"Discovered a PlanetScale password, which could lead to unauthorized database operations and data breaches.",regex:`(?i)\\b(pscale_pw_(?i)[\\w=\\.-]{32,64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["pscale_pw_"]},{id:"postman-api-token",description:"Uncovered a Postman API token, potentially compromising API testing and development workflows.",regex:`\\b(PMAK-(?i)[a-f0-9]{24}\\-[a-f0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["pmak-"]},{id:"prefect-api-token",description:"Detected a Prefect API token, risking unauthorized access to workflow management and automation services.",regex:`\\b(pnu_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["pnu_"]},{id:"private-key",description:"Identified a Private Key, which may compromise cryptographic security and sensitive data encryption.",regex:"(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?KEY(?: BLOCK)?-----",keywords:["-----begin"]},{id:"privateai-api-token",description:"Identified a PrivateAI Token, posing a risk of unauthorized access to AI services and data manipulation.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:private[_-]?ai)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["privateai","private_ai","private-ai"]},{id:"pulumi-api-token",description:"Found a Pulumi API token, posing a risk to infrastructure as code services and cloud resource management.",regex:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["pul-"]},{id:"pypi-upload-token",description:"Discovered a PyPI upload token, potentially compromising Python package distribution and repository integrity.",regex:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",entropy:3,keywords:["pypi-ageichlwas5vcmc"]},{id:"rapidapi-access-token",description:"Uncovered a RapidAPI Access Token, which could lead to unauthorized access to various APIs and data services.",regex:`(?i)[\\w.-]{0,50}?(?:rapidapi)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{50})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["rapidapi"]},{id:"readme-api-token",description:"Detected a Readme API token, risking unauthorized documentation management and content exposure.",regex:`\\b(rdme_[a-z0-9]{70})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["rdme_"]},{id:"rubygems-api-token",description:"Identified a Rubygem API token, potentially compromising Ruby library distribution and package management.",regex:`\\b(rubygems_[a-f0-9]{48})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["rubygems_"]},{id:"scalingo-api-token",description:"Found a Scalingo API token, posing a risk to cloud platform services and application deployment security.",regex:`\\b(tk-us-[\\w-]{48})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["tk-us-"]},{id:"sendbird-access-id",description:"Discovered a Sendbird Access ID, which could compromise chat and messaging platform integrations.",regex:`(?i)[\\w.-]{0,50}?(?:sendbird)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["sendbird"]},{id:"sendbird-access-token",description:"Uncovered a Sendbird Access Token, potentially risking unauthorized access to communication services and user data.",regex:`(?i)[\\w.-]{0,50}?(?:sendbird)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["sendbird"]},{id:"sendgrid-api-token",description:"Detected a SendGrid API token, posing a risk of unauthorized email service operations and data exposure.",regex:`\\b(SG\\.(?i)[a-z0-9=_\\-\\.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["sg."]},{id:"sendinblue-api-token",description:"Identified a Sendinblue API token, which may compromise email marketing services and subscriber data privacy.",regex:`\\b(xkeysib-[a-f0-9]{64}\\-(?i)[a-z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["xkeysib-"]},{id:"sentry-access-token",description:"Found a Sentry.io Access Token (old format), risking unauthorized access to error tracking services and sensitive application data.",regex:`(?i)[\\w.-]{0,50}?(?:sentry)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sentry"]},{id:"sentry-org-token",description:"Found a Sentry.io Organization Token, risking unauthorized access to error tracking services and sensitive application data.",regex:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)",entropy:4.5,keywords:["sntrys_eyjpyxqio"]},{id:"sentry-user-token",description:"Found a Sentry.io User Token, risking unauthorized access to error tracking services and sensitive application data.",regex:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["sntryu_"]},{id:"settlemint-application-access-token",description:"Found a Settlemint Application Access Token.",regex:`\\b(sm_aat_[a-zA-Z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sm_aat"]},{id:"settlemint-personal-access-token",description:"Found a Settlemint Personal Access Token.",regex:`\\b(sm_pat_[a-zA-Z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sm_pat"]},{id:"settlemint-service-access-token",description:"Found a Settlemint Service Access Token.",regex:`\\b(sm_sat_[a-zA-Z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sm_sat"]},{id:"shippo-api-token",description:"Discovered a Shippo API token, potentially compromising shipping services and customer order data.",regex:`\\b(shippo_(?:live|test)_[a-fA-F0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["shippo_"]},{id:"shopify-access-token",description:"Uncovered a Shopify access token, which could lead to unauthorized e-commerce platform access and data breaches.",regex:"shpat_[a-fA-F0-9]{32}",entropy:2,keywords:["shpat_"]},{id:"shopify-custom-access-token",description:"Detected a Shopify custom access token, potentially compromising custom app integrations and e-commerce data security.",regex:"shpca_[a-fA-F0-9]{32}",entropy:2,keywords:["shpca_"]},{id:"shopify-private-app-access-token",description:"Identified a Shopify private app access token, risking unauthorized access to private app data and store operations.",regex:"shppa_[a-fA-F0-9]{32}",entropy:2,keywords:["shppa_"]},{id:"shopify-shared-secret",description:"Found a Shopify shared secret, posing a risk to application authentication and e-commerce platform security.",regex:"shpss_[a-fA-F0-9]{32}",entropy:2,keywords:["shpss_"]},{id:"sidekiq-secret",description:"Discovered a Sidekiq Secret, which could lead to compromised background job processing and application data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:BUNDLE_ENTERPRISE__CONTRIBSYS__COM|BUNDLE_GEMS__CONTRIBSYS__COM)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{8}:[a-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bundle_enterprise__contribsys__com","bundle_gems__contribsys__com"]},{id:"sidekiq-sensitive-url",description:"Uncovered a Sidekiq Sensitive URL, potentially exposing internal job queues and sensitive operation details.",regex:"(?i)\\bhttps?://([a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)",keywords:["gems.contribsys.com","enterprise.contribsys.com"]},{id:"slack-app-token",description:"Detected a Slack App-level token, risking unauthorized access to Slack applications and workspace data.",regex:"(?i)xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",entropy:2,keywords:["xapp"]},{id:"slack-bot-token",description:"Identified a Slack Bot token, which may compromise bot integrations and communication channel security.",regex:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",entropy:3,keywords:["xoxb"]},{id:"slack-config-access-token",description:"Found a Slack Configuration access token, posing a risk to workspace configuration and sensitive data access.",regex:"(?i)xoxe.xox[bp]-\\d-[A-Z0-9]{163,166}",entropy:2,keywords:["xoxe.xoxb-","xoxe.xoxp-"]},{id:"slack-config-refresh-token",description:"Discovered a Slack Configuration refresh token, potentially allowing prolonged unauthorized access to configuration settings.",regex:"(?i)xoxe-\\d-[A-Z0-9]{146}",entropy:2,keywords:["xoxe-"]},{id:"slack-legacy-bot-token",description:"Uncovered a Slack Legacy bot token, which could lead to compromised legacy bot operations and data exposure.",regex:"xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}",entropy:2,keywords:["xoxb"]},{id:"slack-legacy-token",description:"Detected a Slack Legacy token, risking unauthorized access to older Slack integrations and user data.",regex:"xox[os]-\\d+-\\d+-\\d+-[a-fA-F\\d]+",entropy:2,keywords:["xoxo","xoxs"]},{id:"slack-legacy-workspace-token",description:"Identified a Slack Legacy Workspace token, potentially compromising access to workspace data and legacy features.",regex:"xox[ar]-(?:\\d-)?[0-9a-zA-Z]{8,48}",entropy:2,keywords:["xoxa","xoxr"]},{id:"slack-user-token",description:"Found a Slack User token, posing a risk of unauthorized user impersonation and data access within Slack workspaces.",regex:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",entropy:2,keywords:["xoxp-","xoxe-"]},{id:"slack-webhook-url",description:"Discovered a Slack Webhook, which could lead to unauthorized message posting and data leakage in Slack channels.",regex:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}",keywords:["hooks.slack.com"]},{id:"snyk-api-token",description:"Uncovered a Snyk API token, potentially compromising software vulnerability scanning and code security.",regex:`(?i)[\\w.-]{0,50}?(?:snyk[_.-]?(?:(?:api|oauth)[_.-]?)?(?:key|token))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["snyk"]},{id:"sonar-api-token",description:"Uncovered a Sonar API token, potentially compromising software vulnerability scanning and code security.",regex:`(?i)[\\w.-]{0,50}?(?:sonar[_.-]?(login|token))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}((?:squ_|sqp_|sqa_)?[a-z0-9=_\\-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,secretGroup:2,keywords:["sonar"]},{id:"sourcegraph-access-token",description:"Sourcegraph is a code search and navigation engine.",regex:`(?i)\\b(\\b(sgp_(?:[a-fA-F0-9]{16}|local)_[a-fA-F0-9]{40}|sgp_[a-fA-F0-9]{40}|[a-fA-F0-9]{40})\\b)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sgp_","sourcegraph"]},{id:"square-access-token",description:"Detected a Square Access Token, risking unauthorized payment processing and financial transaction exposure.",regex:`\\b((?:EAAA|sq0atp-)[\\w-]{22,60})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["sq0atp-","eaaa"]},{id:"squarespace-access-token",description:"Identified a Squarespace Access Token, which may compromise website management and content control on Squarespace.",regex:`(?i)[\\w.-]{0,50}?(?:squarespace)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["squarespace"]},{id:"stripe-access-token",description:"Found a Stripe Access Token, posing a risk to payment processing services and sensitive financial data.",regex:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["sk_test","sk_live","sk_prod","rk_test","rk_live","rk_prod"]},{id:"sumologic-access-id",description:"Discovered a SumoLogic Access ID, potentially compromising log management services and data analytics integrity.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:(?-i:[Ss]umo|SUMO))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(su[a-zA-Z0-9]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sumo"]},{id:"sumologic-access-token",description:"Uncovered a SumoLogic Access Token, which could lead to unauthorized access to log data and analytics insights.",regex:`(?i)[\\w.-]{0,50}?(?:(?-i:[Ss]umo|SUMO))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sumo"]},{id:"telegram-bot-api-token",description:"Detected a Telegram Bot API Token, risking unauthorized bot operations and message interception on Telegram.",regex:`(?i)[\\w.-]{0,50}?(?:telegr)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["telegr"]},{id:"travisci-access-token",description:"Identified a Travis CI Access Token, potentially compromising continuous integration services and codebase security.",regex:`(?i)[\\w.-]{0,50}?(?:travis)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{22})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["travis"]},{id:"twilio-api-key",description:"Found a Twilio API Key, posing a risk to communication services and sensitive customer interaction data.",regex:"SK[0-9a-fA-F]{32}",entropy:3,keywords:["sk"]},{id:"twitch-api-token",description:"Discovered a Twitch API token, which could compromise streaming services and account integrations.",regex:`(?i)[\\w.-]{0,50}?(?:twitch)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{30})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitch"]},{id:"twitter-access-secret",description:"Uncovered a Twitter Access Secret, potentially risking unauthorized Twitter integrations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{45})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"twitter-access-token",description:"Detected a Twitter Access Token, posing a risk of unauthorized account operations and social media data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9]{15,25}-[a-zA-Z0-9]{20,40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"twitter-api-key",description:"Identified a Twitter API Key, which may compromise Twitter application integrations and user data security.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{25})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"twitter-api-secret",description:"Found a Twitter API Secret, risking the security of Twitter app integrations and sensitive data access.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{50})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"twitter-bearer-token",description:"Discovered a Twitter Bearer Token, potentially compromising API access and data retrieval from Twitter.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(A{22}[a-zA-Z0-9%]{80,100})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"typeform-api-token",description:"Uncovered a Typeform API token, which could lead to unauthorized survey management and data collection.",regex:`(?i)[\\w.-]{0,50}?(?:typeform)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(tfp_[a-z0-9\\-_\\.=]{59})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["tfp_"]},{id:"vault-batch-token",description:"Detected a Vault Batch Token, risking unauthorized access to secret management services and sensitive data.",regex:`\\b(hvb\\.[\\w-]{138,300})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["hvb."]},{id:"vault-service-token",description:"Identified a Vault Service Token, potentially compromising infrastructure security and access to sensitive credentials.",regex:`\\b((?:hvs\\.[\\w-]{90,120}|s\\.(?i:[a-z0-9]{24})))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["hvs.","s."],allowlists:[{regexes:["s\\.[A-Za-z]{24}"]}]},{id:"yandex-access-token",description:"Found a Yandex Access Token, posing a risk to Yandex service integrations and user data privacy.",regex:`(?i)[\\w.-]{0,50}?(?:yandex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["yandex"]},{id:"yandex-api-key",description:"Discovered a Yandex API Key, which could lead to unauthorized access to Yandex services and data manipulation.",regex:`(?i)[\\w.-]{0,50}?(?:yandex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(AQVN[A-Za-z0-9_\\-]{35,38})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["yandex"]},{id:"yandex-aws-access-token",description:"Uncovered a Yandex AWS Access Token, potentially compromising cloud resource access and data security on Yandex Cloud.",regex:`(?i)[\\w.-]{0,50}?(?:yandex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(YC[a-zA-Z0-9_\\-]{38})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["yandex"]},{id:"zendesk-secret-key",description:"Detected a Zendesk Secret Key, risking unauthorized access to customer support services and sensitive ticketing data.",regex:`(?i)[\\w.-]{0,50}?(?:zendesk)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["zendesk"]}]}}});import{Buffer as Mk}from"node:buffer";function Xdi(e){return[0,1,2].flatMap(t=>{const i=Mk.concat([Mk.alloc(t),e]).toString("base64").slice(Math.ceil(8*t/6),Math.floor(8*(t+e.length)/6));return[i,i.replaceAll("+","-").replaceAll("/","_")]})}function Ydi(e){const t=JSON.stringify(e).slice(1,-1).replace(/[^\x20-\x7e]/gu,n=>`\\u${n.charCodeAt(0).toString(16).padStart(4,"0")}`);return[t,t.replace(/\\u([0-9a-f]{4})/gu,(n,i)=>`\\u${i.toUpperCase()}`)]}function Zdi(e){const t=Mk.from(e),n=encodeURIComponent(e);return[...new Set([e,`Bearer ${e}`,JSON.stringify(e).slice(1,-1),...Ydi(e),n,n.replace(/%[0-9A-F]{2}/gu,i=>i.toLowerCase()),t.toString("hex"),t.toString("hex").toUpperCase(),t.toString("base64"),t.toString("base64url"),...Xdi(t)])].filter(Boolean)}function epi(e){const t=new Map;let n=0;for(const r of e)t.set(r,(t.get(r)??0)+1),n++;let i=0;for(const r of t.values()){const o=r/n;i-=o*Math.log2(o)}return i}function LJt(e,t,n,i){const r=e.regexTarget==="match"?n:e.regexTarget==="line"?i:t,o=[];return e.regexes.length>0&&o.push(e.regexes.some(s=>s.matcher(r).find())),e.stopwords.length>0&&o.push(e.stopwords.some(s=>t.toLowerCase().includes(s.toLowerCase()))),e.paths.length>0&&o.push(!1),o.length>0&&(e.condition==="AND"?o.every(Boolean):o.some(Boolean))}function*NJt(e,t){const n=e.toLowerCase();for(const i of t.rules){if(i.regex===void 0||i.keywords.length>0&&!i.keywords.some(o=>n.includes(o)))continue;const r=i.regex.matcher(e);for(;r.find();){let o=i.secretGroup;if(o===0){for(let h=1;h<=r.groupCount();h++)if(r.group(h)){o=h;break}}const s=r.group(o)??"";if(s.length===0||i.entropy>0&&epi(s)<=i.entropy)continue;const a=r.start(),c=r.end(),u=a===0?0:e.lastIndexOf(`
|
|
1353
|
+
`)));let s=!0;for(;!t.more()||t.peek()!==Ge.CODES.get("]")||s;){if(t.more()&&t.lookingAt("-")&&(this.flags&Dt.PERL_X)===0&&!s){const l=t.rest();if(l==="-"||!l.startsWith("-]"))throw t.rewindTo(n),new bs(Rn.ERR_INVALID_CHAR_RANGE,t.rest())}s=!1;const a=t.pos();if(t.lookingAt("[:")){if(this.parseNamedClass(t,r))continue;t.rewindTo(a)}if(this.parseUnicodeClass(t,r)||this.parsePerlClassEscape(t,r))continue;t.rewindTo(a);const c=Rn.parseClassChar(t,n);let u=c;if(t.more()&&t.lookingAt("-")){if(t.skip(1),t.more()&&t.lookingAt("]"))t.skip(-1);else if(u=Rn.parseClassChar(t,n),u<c)throw new bs(Rn.ERR_INVALID_CHAR_RANGE,t.from(a))}(this.flags&Dt.FOLD_CASE)===0?r.appendRange(c,u):r.appendFoldedRange(c,u)}t.skip(1),r.cleanClass(),o<0&&r.negateClass(),i.runes=r.toArray(),this.push(i)}},IJt=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}compareAndSet(e,t){return this.value===e?(this.value=t,!0):!1}},CJt=class NE{static initTest(t){const n=NE.compile(t),i=new NE(n.expr,n.prog,n.numSubexp,n.longest);return i.cond=n.cond,i.prefix=n.prefix,i.prefixUTF8=n.prefixUTF8,i.prefixComplete=n.prefixComplete,i.prefixRune=n.prefixRune,i}static compile(t){return NE.compileImpl(t,Dt.PERL,!1)}static compilePOSIX(t){return NE.compileImpl(t,Dt.POSIX,!0)}static compileImpl(t,n,i){let r=TJt.parse(t,n);const o=r.maxCap();r=EJt.simplify(r);const s=kJt.compileRegexp(r),a=new NE(t,s,o,i),[c,u]=s.prefix();return a.prefixComplete=c,a.prefix=u,a.prefixUTF8=Br.stringToUtf8ByteArray(a.prefix),a.prefix.length>0&&(a.prefixRune=a.prefix.codePointAt(0)),a.namedGroups=r.namedGroups,a}static match(t,n){return NE.compile(t).match(n)}constructor(t,n,i=0,r=0){this.expr=t,this.prog=n,this.numSubexp=i,this.longest=r,this.cond=n.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.pooled=new IJt,this.dfa=new xJt(n)}executeEngine(t,n,i,r){if(r>0)return this.doExecuteNFA(t,n,i,r);const o=this.dfa.match(t,n,i);return o!==null?o?[]:null:this.doExecuteNFA(t,n,i,r)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){let t;do t=this.pooled.get();while(t&&!this.pooled.compareAndSet(t,t.next));return t}reset(){this.pooled.set(null)}put(t,n){let i=this.pooled.get();do i=this.pooled.get(),!n&&i&&(t=lee.fromMachine(t),n=!0),t.next!==i&&(t.next=i);while(!this.pooled.compareAndSet(i,t))}toString(){return this.expr}doExecuteNFA(t,n,i,r){let o=this.get(),s=!1;o?o.next!==null&&(o=lee.fromMachine(o),s=!0):(o=lee.fromRE2(this),s=!0),o.init(r);const a=o.match(t,n,i)?o.submatches():null;return this.put(o,s),a}match(t){return this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,0)!==null}matchWithGroup(t,n,i,r,o){return t instanceof Pk||(t=xL.utf16(t)),this.matchMachineInput(t,n,i,r,o)}matchMachineInput(t,n,i,r,o){if(n>i)return[!1,null];const s=t.isUTF16Encoding()?ta.fromUTF16(t.asCharSequence(),0,i):ta.fromUTF8(t.asBytes(),0,i),a=this.executeEngine(s,n,r,2*o);return a===null?[!1,null]:[!0,a]}matchUTF8(t){return this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,0)!==null}replaceAll(t,n){return this.replaceAllFunc(t,()=>n,2*t.length+1)}replaceFirst(t,n){return this.replaceAllFunc(t,()=>n,1)}replaceAllFunc(t,n,i){let r=0,o=0,s="";const a=ta.fromUTF16(t);let c=0;for(;o<=t.length;){const u=this.executeEngine(a,o,Dt.UNANCHORED,2);if(u===null||u.length===0)break;s+=t.substring(r,u[0]),(u[1]>r||u[0]===0)&&(s+=n(t.substring(u[0],u[1])),c++),r=u[1];const l=a.step(o)&7;if(o+l>u[1]?o+=l:o+1>u[1]?o++:o=u[1],c>=i)break}return s+=t.substring(r),s}pad(t){if(t===null)return null;let n=(1+this.numSubexp)*2;if(t.length<n){let i=new Array(n).fill(-1);for(let r=0;r<t.length;r++)i[r]=t[r];t=i}return t}allMatches(t,n,i=r=>r){let r=[];const o=t.endPos();n<0&&(n=o+1);let s=0,a=0,c=-1;for(;a<n&&s<=o;){const u=this.executeEngine(t,s,Dt.UNANCHORED,this.prog.numCap);if(u===null||u.length===0)break;let l=!0;if(u[1]===s){u[0]===c&&(l=!1);const d=t.step(s);d<0?s=o+1:s+=d&7}else s=u[1];c=u[1],l&&(r.push(i(this.pad(u))),a++)}return r}findUTF8(t){const n=this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,2);return n===null?null:t.slice(n[0],n[1])}findUTF8Index(t){const n=this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,2);return n===null?null:n.slice(0,2)}find(t){const n=this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,2);return n===null?"":t.substring(n[0],n[1])}findIndex(t){return this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,2)}findUTF8Submatch(t){const n=this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,this.prog.numCap);if(n===null)return null;const i=new Array(1+this.numSubexp).fill(null);for(let r=0;r<i.length;r++)2*r<n.length&&n[2*r]>=0&&(i[r]=t.slice(n[2*r],n[2*r+1]));return i}findUTF8SubmatchIndex(t){return this.pad(this.executeEngine(ta.fromUTF8(t),0,Dt.UNANCHORED,this.prog.numCap))}findSubmatch(t){const n=this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,this.prog.numCap);if(n===null)return null;const i=new Array(1+this.numSubexp).fill(null);for(let r=0;r<i.length;r++)2*r<n.length&&n[2*r]>=0&&(i[r]=t.substring(n[2*r],n[2*r+1]));return i}findSubmatchIndex(t){return this.pad(this.executeEngine(ta.fromUTF16(t),0,Dt.UNANCHORED,this.prog.numCap))}findAllUTF8(t,n){const i=this.allMatches(ta.fromUTF8(t),n,r=>t.slice(r[0],r[1]));return i.length===0?null:i}findAllUTF8Index(t,n){const i=this.allMatches(ta.fromUTF8(t),n,r=>r.slice(0,2));return i.length===0?null:i}findAll(t,n){const i=this.allMatches(ta.fromUTF16(t),n,r=>t.substring(r[0],r[1]));return i.length===0?null:i}findAllIndex(t,n){const i=this.allMatches(ta.fromUTF16(t),n,r=>r.slice(0,2));return i.length===0?null:i}findAllUTF8Submatch(t,n){const i=this.allMatches(ta.fromUTF8(t),n,r=>{let o=new Array(r.length/2|0).fill(null);for(let s=0;s<o.length;s++)r[2*s]>=0&&(o[s]=t.slice(r[2*s],r[2*s+1]));return o});return i.length===0?null:i}findAllUTF8SubmatchIndex(t,n){const i=this.allMatches(ta.fromUTF8(t),n);return i.length===0?null:i}findAllSubmatch(t,n){const i=this.allMatches(ta.fromUTF16(t),n,r=>{let o=new Array(r.length/2|0).fill(null);for(let s=0;s<o.length;s++)r[2*s]>=0&&(o[s]=t.substring(r[2*s],r[2*s+1]));return o});return i.length===0?null:i}findAllSubmatchIndex(t,n){const i=this.allMatches(ta.fromUTF16(t),n);return i.length===0?null:i}},RJt=class rR{static isUpperCaseAlpha(t){return"A"<=t&&t<="Z"}static isHexadecimal(t){return"0"<=t&&t<="9"||"A"<=t&&t<="F"||"a"<=t&&t<="f"}static getUtf8CharSize(t){const n=t.charCodeAt(0);return n<128?1:n<2048?2:n<65536?3:4}static translate(t){if(typeof t!="string")return t;let n="",i=!1,r=t.length;r===0&&(n="(?:)",i=!0);let o=0;for(;o<r;){let s=t[o];if(s==="\\"){if(o+1<r)switch(s=t[o+1],s){case"\\":{n+="\\\\",o+=2;continue}case"c":{if(o+2<r){let c=t[o+2];if(rR.isUpperCaseAlpha(c)){n+="\\x",n+=(c.charCodeAt(0)-64>>4).toString(16).toUpperCase(),n+=(c.charCodeAt(0)-64&15).toString(16).toUpperCase(),o+=3,i=!0;continue}}n+="\\c",o+=2;continue}case"u":{if(o+2<r){let c=t[o+2];if(rR.isHexadecimal(c)){n+="\\x{"+c,o+=3;for(let u=0;u<3&&o<r&&(c=t[o],!!rR.isHexadecimal(c));++o,++u)n+=c;n+="}",i=!0;continue}else if(c==="{"){n+="\\x",o+=2,i=!0;continue}}n+="\\u",o+=2;continue}default:{n+="\\";let c=rR.getUtf8CharSize(s);n+=t.substring(o+1,o+1+c),o+=c+1;continue}}}else if(s==="/"){n+="\\/",o+=1,i=!0;continue}else if(s==="("&&o+2<r&&t[o+1]==="?"&&t[o+2]==="<"&&(o+3>=r||t[o+3]!=="="&&t[o+3]!=="!")){n+="(?P<",o+=3,i=!0;continue}let a=rR.getUtf8CharSize(s);n+=t.substring(o,o+a),o+=a}return i?n:t}},pee=class lp{static CASE_INSENSITIVE=1;static DOTALL=2;static MULTILINE=4;static DISABLE_UNICODE_GROUPS=8;static LONGEST_MATCH=16;static quote(t){return Br.quoteMeta(t)}static translateRegExp(t){return RJt.translate(t)}static compile(t,n=0){let i=t;if((n&lp.CASE_INSENSITIVE)!==0&&(i=`(?i)${i}`),(n&lp.DOTALL)!==0&&(i=`(?s)${i}`),(n&lp.MULTILINE)!==0&&(i=`(?m)${i}`),(n&~(lp.MULTILINE|lp.DOTALL|lp.CASE_INSENSITIVE|lp.DISABLE_UNICODE_GROUPS|lp.LONGEST_MATCH))!==0)throw new gJt("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH");let r=Dt.PERL;(n&lp.DISABLE_UNICODE_GROUPS)!==0&&(r&=-129);const o=new lp(t,n);return o.re2Input=CJt.compileImpl(i,r,(n&lp.LONGEST_MATCH)!==0),o}static matches(t,n){return lp.compile(t).testExact(n)}static initTest(t,n,i){if(t==null)throw new Error("pattern is null");if(i==null)throw new Error("re2 is null");const r=new lp(t,n);return r.re2Input=i,r}constructor(t,n){this.patternInput=t,this.flagsInput=n}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(t){return this.testExact(t)}matcher(t){return Array.isArray(t)&&(t=xL.utf8(t)),new yJt(this,t)}test(t){return Array.isArray(t)?this.re2Input.matchUTF8(t):this.re2Input.match(t)}testExact(t){const n=Array.isArray(t)?ta.fromUTF8(t):ta.fromUTF16(t);return this.re2Input.executeEngine(n,0,Dt.ANCHOR_BOTH,0)!==null}split(t,n=0){const i=this.matcher(t),r=[];let o=0,s=0;for(;i.find();){if(s===0&&i.end()===0){s=i.end();continue}if(n>0&&r.length===n-1)break;if(s===i.start()){if(n===0){o+=1,s=i.end();continue}}else for(;o>0;)r.push(""),o-=1;r.push(i.substring(s,i.start())),s=i.end()}if(n===0&&s!==i.inputLength()){for(;o>0;)r.push(""),o-=1;r.push(i.substring(s,i.inputLength()))}return(n!==0||r.length===0)&&r.push(i.substring(s,i.inputLength())),r}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(t){return this===t?!0:t===null||this.constructor!==t.constructor?!1:this.flagsInput===t.flagsInput&&this.patternInput===t.patternInput}}}}),PJt,Jdi=A({"../../packages/veil/dist/index.js"(){"use strict";PJt=class extends Error{code;constructor(e,t){super(e),this.code=e,this.name="VeilError",t!==void 0&&Object.defineProperty(this,"cause",{value:t,enumerable:!1})}}}}),MJt={};bi(MJt,{configuration:()=>DJt});var DJt,Qdi=A({"../../packages/veil/dist/redaction-rules.generated.js"(){"use strict";DJt={title:"gitleaks config",minVersion:"v8.25.0",allowlist:{description:"global allow lists",paths:["gitleaks\\.toml","(?i)\\.(?:bmp|gif|jpe?g|png|svg|tiff?)$","(?i)\\.(?:eot|[ot]tf|woff2?)$","(?i)\\.(?:docx?|xlsx?|pdf|bin|socket|vsidx|v2|suo|wsuo|.dll|pdb|exe|gltf)$","go\\.(?:mod|sum|work(?:\\.sum)?)$","(?:^|/)vendor/modules\\.txt$","(?:^|/)vendor/(?:github\\.com|golang\\.org/x|google\\.golang\\.org|gopkg\\.in|istio\\.io|k8s\\.io|sigs\\.k8s\\.io)(?:/.*)?$","(?:^|/)gradlew(?:\\.bat)?$","(?:^|/)gradle\\.lockfile$","(?:^|/)mvnw(?:\\.cmd)?$","(?:^|/)\\.mvn/wrapper/MavenWrapperDownloader\\.java$","(?:^|/)node_modules(?:/.*)?$","(?:^|/)(?:deno\\.lock|npm-shrinkwrap\\.json|package-lock\\.json|pnpm-lock\\.yaml|yarn\\.lock)$","(?:^|/)bower_components(?:/.*)?$","(?:^|/)(?:angular|bootstrap|jquery(?:-?ui)?|plotly|swagger-?ui)[a-zA-Z0-9.-]*(?:\\.min)?\\.js(?:\\.map)?$","(?:^|/)javascript\\.json$","(?:^|/)(?:Pipfile|poetry)\\.lock$","(?i)(?:^|/)(?:v?env|virtualenv)/lib(?:64)?(?:/.*)?$","(?i)(?:^|/)(?:lib(?:64)?/python[23](?:\\.\\d{1,2})+|python/[23](?:\\.\\d{1,2})+/lib(?:64)?)(?:/.*)?$","(?i)(?:^|/)[a-z0-9_.]+-[0-9.]+\\.dist-info(?:/.+)?$","(?:^|/)vendor/(?:bundle|ruby)(?:/.*?)?$","\\.gem$","verification-metadata\\.xml","Database.refactorlog","(?:^|/)\\.git$"],regexes:["(?i)^true|false|null$","^(?i:a+|b+|c+|d+|e+|f+|g+|h+|i+|j+|k+|l+|m+|n+|o+|p+|q+|r+|s+|t+|u+|v+|w+|x+|y+|z+|\\*+|\\.+)$","^\\$(?:\\d+|{\\d+})$","^\\$(?:[A-Z_]+|[a-z_]+)$","^\\${(?:[A-Z_]+|[a-z_]+)}$","^\\{\\{[ \\t]*[\\w ().|]+[ \\t]*}}$",`^\\$\\{\\{[ \\t]*(?:(?:env|github|secrets|vars)(?:\\.[A-Za-z]\\w+)+[\\w "'&./=|]*)[ \\t]*}}$`,"^%(?:[A-Z_]+|[a-z_]+)%$","^%[+\\-# 0]?[bcdeEfFgGoOpqstTUvxX]$","^\\{\\d{0,2}}$","^@(?:[A-Z_]+|[a-z_]+)@$","^/Users/(?i)[a-z0-9]+/[\\w .-/]+$","^/(?:bin|etc|home|opt|tmp|usr|var)/[\\w ./-]+$"],stopwords:["014df517-39d1-4453-b7b3-9930c563627c","abcdefghijklmnopqrstuvwxyz"]},rules:[{id:"1password-secret-key",description:"Uncovered a possible 1Password secret key, potentially compromising access to secrets in vaults.",regex:"\\bA3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}\\b",entropy:3.8,keywords:["a3-"]},{id:"1password-service-account-token",description:"Uncovered a possible 1Password service account token, potentially compromising access to secrets in vaults.",regex:"ops_eyJ[a-zA-Z0-9+/]{250,}={0,3}",entropy:4,keywords:["ops_"]},{id:"adafruit-api-key",description:"Identified a potential Adafruit API Key, which could lead to unauthorized access to Adafruit services and sensitive data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:adafruit)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["adafruit"]},{id:"adobe-client-id",description:"Detected a pattern that resembles an Adobe OAuth Web Client ID, posing a risk of compromised Adobe integrations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:adobe)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["adobe"]},{id:"adobe-client-secret",description:"Discovered a potential Adobe Client Secret, which, if exposed, could allow unauthorized Adobe service access and data manipulation.",regex:`\\b(p8e-(?i)[a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["p8e-"]},{id:"age-secret-key",description:"Discovered a potential Age encryption tool secret key, risking data decryption and unauthorized access to sensitive information.",regex:"AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}",keywords:["age-secret-key-1"]},{id:"airtable-api-key",description:"Uncovered a possible Airtable API Key, potentially compromising database access and leading to data leakage or alteration.",regex:`(?i)[\\w.-]{0,50}?(?:airtable)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{17})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["airtable"]},{id:"airtable-personnal-access-token",description:"Uncovered a possible Airtable Personal AccessToken, potentially compromising database access and leading to data leakage or alteration.",regex:"\\b(pat[[:alnum:]]{14}\\.[a-f0-9]{64})\\b",keywords:["airtable"]},{id:"algolia-api-key",description:"Identified an Algolia API Key, which could result in unauthorized search operations and data exposure on Algolia-managed platforms.",regex:`(?i)[\\w.-]{0,50}?(?:algolia)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["algolia"]},{id:"alibaba-access-key-id",description:"Detected an Alibaba Cloud AccessKey ID, posing a risk of unauthorized cloud resource access and potential data compromise.",regex:`\\b(LTAI(?i)[a-z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["ltai"]},{id:"alibaba-secret-key",description:"Discovered a potential Alibaba Cloud Secret Key, potentially allowing unauthorized operations and data access within Alibaba Cloud.",regex:`(?i)[\\w.-]{0,50}?(?:alibaba)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{30})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["alibaba"]},{id:"anthropic-admin-api-key",description:"Detected an Anthropic Admin API Key, risking unauthorized access to administrative functions and sensitive AI model configurations.",regex:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["sk-ant-admin01"]},{id:"anthropic-api-key",description:"Identified an Anthropic API Key, which may compromise AI assistant integrations and expose sensitive data to unauthorized access.",regex:`\\b(sk-ant-api03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["sk-ant-api03"]},{id:"artifactory-api-key",description:"Detected an Artifactory api key, posing a risk unauthorized access to the central repository.",regex:"\\bAKCp[A-Za-z0-9]{69}\\b",entropy:4.5,keywords:["akcp"]},{id:"artifactory-reference-token",description:"Detected an Artifactory reference token, posing a risk of impersonation and unauthorized access to the central repository.",regex:"\\bcmVmd[A-Za-z0-9]{59}\\b",entropy:4.5,keywords:["cmvmd"]},{id:"asana-client-id",description:"Discovered a potential Asana Client ID, risking unauthorized access to Asana projects and sensitive task information.",regex:`(?i)[\\w.-]{0,50}?(?:asana)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["asana"]},{id:"asana-client-secret",description:"Identified an Asana Client Secret, which could lead to compromised project management integrity and unauthorized access.",regex:`(?i)[\\w.-]{0,50}?(?:asana)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["asana"]},{id:"atlassian-api-token",description:"Detected an Atlassian API token, posing a threat to project management and collaboration tool security and data confidentiality.",regex:`(?i)[\\w.-]{0,50}?(?:(?-i:ATLASSIAN|[Aa]tlassian)|(?-i:CONFLUENCE|[Cc]onfluence)|(?-i:JIRA|[Jj]ira))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{20}[a-f0-9]{4})(?:[\\x60'"\\s;]|\\\\[nr]|$)|\\b(ATATT3[A-Za-z0-9_\\-=]{186})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["atlassian","confluence","jira","atatt3"]},{id:"authress-service-client-access-key",description:"Uncovered a possible Authress Service Client Access Key, which may compromise access control services and sensitive data.",regex:`\\b((?:sc|ext|scauth|authress)_(?i)[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30,120})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["sc_","ext_","scauth_","authress_"]},{id:"aws-access-token",description:"Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.",regex:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b",entropy:3,keywords:["a3t","akia","asia","abia","acca"],allowlists:[{regexes:[".+EXAMPLE$"]}]},{id:"aws-amazon-bedrock-api-key-long-lived",description:"Identified a pattern that may indicate long-lived Amazon Bedrock API keys, risking unauthorized Amazon Bedrock usage",regex:`\\b(ABSK[A-Za-z0-9+/]{109,269}={0,2})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["absk"]},{id:"aws-amazon-bedrock-api-key-short-lived",description:"Identified a pattern that may indicate short-lived Amazon Bedrock API keys, risking unauthorized Amazon Bedrock usage",regex:"bedrock-api-key-YmVkcm9jay5hbWF6b25hd3MuY29t",entropy:3,keywords:["bedrock-api-key-"]},{id:"azure-ad-client-secret",description:"Azure AD Client Secret",regex:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,entropy:3,keywords:["q~"]},{id:"beamer-api-token",description:"Detected a Beamer API token, potentially compromising content management and exposing sensitive notifications and updates.",regex:`(?i)[\\w.-]{0,50}?(?:beamer)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(b_[a-z0-9=_\\-]{44})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["beamer"]},{id:"bitbucket-client-id",description:"Discovered a potential Bitbucket Client ID, risking unauthorized repository access and potential codebase exposure.",regex:`(?i)[\\w.-]{0,50}?(?:bitbucket)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bitbucket"]},{id:"bitbucket-client-secret",description:"Discovered a potential Bitbucket Client Secret, posing a risk of compromised code repositories and unauthorized access.",regex:`(?i)[\\w.-]{0,50}?(?:bitbucket)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bitbucket"]},{id:"bittrex-access-key",description:"Identified a Bittrex Access Key, which could lead to unauthorized access to cryptocurrency trading accounts and financial loss.",regex:`(?i)[\\w.-]{0,50}?(?:bittrex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bittrex"]},{id:"bittrex-secret-key",description:"Detected a Bittrex Secret Key, potentially compromising cryptocurrency transactions and financial security.",regex:`(?i)[\\w.-]{0,50}?(?:bittrex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bittrex"]},{id:"cisco-meraki-api-key",description:"Cisco Meraki is a cloud-managed IT solution that provides networking, security, and device management through an easy-to-use interface.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:(?-i:[Mm]eraki|MERAKI))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["meraki"]},{id:"clickhouse-cloud-api-secret-key",description:"Identified a pattern that may indicate clickhouse cloud API secret key, risking unauthorized clickhouse cloud api access and data breaches on ClickHouse Cloud platforms.",regex:"\\b(4b1d[A-Za-z0-9]{38})\\b",entropy:3,keywords:["4b1d"]},{id:"clojars-api-token",description:"Uncovered a possible Clojars API token, risking unauthorized access to Clojure libraries and potential code manipulation.",regex:"(?i)CLOJARS_[a-z0-9]{60}",entropy:2,keywords:["clojars_"]},{id:"cloudflare-api-key",description:"Detected a Cloudflare API Key, potentially compromising cloud application deployments and operational security.",regex:`(?i)[\\w.-]{0,50}?(?:cloudflare)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["cloudflare"]},{id:"cloudflare-global-api-key",description:"Detected a Cloudflare Global API Key, potentially compromising cloud application deployments and operational security.",regex:`(?i)[\\w.-]{0,50}?(?:cloudflare)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{37})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["cloudflare"]},{id:"cloudflare-origin-ca-key",description:"Detected a Cloudflare Origin CA Key, potentially compromising cloud application deployments and operational security.",regex:`\\b(v1\\.0-[a-f0-9]{24}-[a-f0-9]{146})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["cloudflare","v1.0-"]},{id:"codecov-access-token",description:"Found a pattern resembling a Codecov Access Token, posing a risk of unauthorized access to code coverage reports and sensitive data.",regex:`(?i)[\\w.-]{0,50}?(?:codecov)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["codecov"]},{id:"cohere-api-token",description:"Identified a Cohere Token, posing a risk of unauthorized access to AI services and data manipulation.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:cohere|CO_API_KEY)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-zA-Z0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["cohere","co_api_key"]},{id:"coinbase-access-token",description:"Detected a Coinbase Access Token, posing a risk of unauthorized access to cryptocurrency accounts and financial transactions.",regex:`(?i)[\\w.-]{0,50}?(?:coinbase)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["coinbase"]},{id:"confluent-access-token",description:"Identified a Confluent Access Token, which could compromise access to streaming data platforms and sensitive data flow.",regex:`(?i)[\\w.-]{0,50}?(?:confluent)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["confluent"]},{id:"confluent-secret-key",description:"Found a Confluent Secret Key, potentially risking unauthorized operations and data access within Confluent services.",regex:`(?i)[\\w.-]{0,50}?(?:confluent)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["confluent"]},{id:"contentful-delivery-api-token",description:"Discovered a Contentful delivery API token, posing a risk to content management systems and data integrity.",regex:`(?i)[\\w.-]{0,50}?(?:contentful)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{43})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["contentful"]},{id:"curl-auth-header",description:"Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.",regex:`\\bcurl\\b(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?i)(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t]([a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t]([\\w=~@.+/-]{8,})|([\\w=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}([\\w=~@.+/-]{8,}))"|'(?i)(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t]([a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t]([\\w=~@.+/-]{8,})|([\\w=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}([\\w=~@.+/-]{8,}))')(?:\\B|\\s|\\z)`,entropy:2.75,keywords:["curl"]},{id:"curl-auth-user",description:"Discovered a potential basic authorization token provided in a curl command, which could compromise the curl accessed resource.",regex:`\\bcurl\\b(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})("(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'([^:']{3,}:[^']{3,})'|((?:"[^"]{3,}"|'[^']{3,}'|[\\w$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[\\w\${}@.-]+)))(?:\\s|\\z)`,entropy:2,keywords:["curl"],allowlists:[{regexes:["[^:]+:(?:change(?:it|me)|pass(?:word)?|pwd|test|token|\\*+|x+)",`['"]?<[^>]+>['"]?:['"]?<[^>]+>|<[^:]+:[^>]+>['"]?`,"[^:]+:\\[[^]]+]",`['"]?[^:]+['"]?:['"]?\\$(?:\\d|\\w+|\\{(?:\\d|\\w+)})['"]?`,"\\$\\([^)]+\\):\\$\\([^)]+\\)",`['"]?\\$?{{[^}]+}}['"]?:['"]?\\$?{{[^}]+}}['"]?`]}]},{id:"databricks-api-token",description:"Uncovered a Databricks API token, which may compromise big data analytics platforms and sensitive data processing.",regex:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["dapi"]},{id:"datadog-access-token",description:"Detected a Datadog Access Token, potentially risking monitoring and analytics data exposure and manipulation.",regex:`(?i)[\\w.-]{0,50}?(?:datadog)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["datadog"]},{id:"defined-networking-api-token",description:"Identified a Defined Networking API token, which could lead to unauthorized network operations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:dnkey)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(dnkey-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dnkey"]},{id:"digitalocean-access-token",description:"Found a DigitalOcean OAuth Access Token, risking unauthorized cloud resource access and data compromise.",regex:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["doo_v1_"]},{id:"digitalocean-pat",description:"Discovered a DigitalOcean Personal Access Token, posing a threat to cloud infrastructure security and data privacy.",regex:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["dop_v1_"]},{id:"digitalocean-refresh-token",description:"Uncovered a DigitalOcean OAuth Refresh Token, which could allow prolonged unauthorized access and resource manipulation.",regex:`(?i)\\b(dor_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dor_v1_"]},{id:"discord-api-token",description:"Detected a Discord API key, potentially compromising communication channels and user data privacy on Discord.",regex:`(?i)[\\w.-]{0,50}?(?:discord)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["discord"]},{id:"discord-client-id",description:"Identified a Discord client ID, which may lead to unauthorized integrations and data exposure in Discord applications.",regex:`(?i)[\\w.-]{0,50}?(?:discord)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9]{18})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["discord"]},{id:"discord-client-secret",description:"Discovered a potential Discord client secret, risking compromised Discord bot integrations and data leaks.",regex:`(?i)[\\w.-]{0,50}?(?:discord)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["discord"]},{id:"doppler-api-token",description:"Discovered a Doppler API token, posing a risk to environment and secrets management security.",regex:"dp\\.pt\\.(?i)[a-z0-9]{43}",entropy:2,keywords:["dp.pt."]},{id:"droneci-access-token",description:"Detected a Droneci Access Token, potentially compromising continuous integration and deployment workflows.",regex:`(?i)[\\w.-]{0,50}?(?:droneci)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["droneci"]},{id:"dropbox-api-token",description:"Identified a Dropbox API secret, which could lead to unauthorized file access and data breaches in Dropbox storage.",regex:`(?i)[\\w.-]{0,50}?(?:dropbox)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{15})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dropbox"]},{id:"dropbox-long-lived-api-token",description:"Found a Dropbox long-lived API token, risking prolonged unauthorized access to cloud storage and sensitive data.",regex:`(?i)[\\w.-]{0,50}?(?:dropbox)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dropbox"]},{id:"dropbox-short-lived-api-token",description:"Discovered a Dropbox short-lived API token, posing a risk of temporary but potentially harmful data access and manipulation.",regex:`(?i)[\\w.-]{0,50}?(?:dropbox)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(sl\\.[a-z0-9\\-=_]{135})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["dropbox"]},{id:"duffel-api-token",description:"Uncovered a Duffel API token, which may compromise travel platform integrations and sensitive customer data.",regex:"duffel_(?:test|live)_(?i)[a-z0-9_\\-=]{43}",entropy:2,keywords:["duffel_"]},{id:"dynatrace-api-token",description:"Detected a Dynatrace API token, potentially risking application performance monitoring and data exposure.",regex:"dt0c01\\.(?i)[a-z0-9]{24}\\.[a-z0-9]{64}",entropy:4,keywords:["dt0c01."]},{id:"easypost-api-token",description:"Identified an EasyPost API token, which could lead to unauthorized postal and shipment service access and data exposure.",regex:"\\bEZAK(?i)[a-z0-9]{54}\\b",entropy:2,keywords:["ezak"]},{id:"easypost-test-api-token",description:"Detected an EasyPost test API token, risking exposure of test environments and potentially sensitive shipment data.",regex:"\\bEZTK(?i)[a-z0-9]{54}\\b",entropy:2,keywords:["eztk"]},{id:"etsy-access-token",description:"Found an Etsy Access Token, potentially compromising Etsy shop management and customer data.",regex:`(?i)[\\w.-]{0,50}?(?:(?-i:ETSY|[Ee]tsy))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{24})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["etsy"]},{id:"facebook-access-token",description:"Discovered a Facebook Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`(?i)\\b(\\d{15,16}(\\||%)[0-9a-z\\-_]{27,40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["facebook"]},{id:"facebook-page-access-token",description:"Discovered a Facebook Page Access Token, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`\\b(EAA[MC](?i)[a-z0-9]{100,})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["eaam","eaac"]},{id:"facebook-secret",description:"Discovered a Facebook Application secret, posing a risk of unauthorized access to Facebook accounts and personal data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:facebook)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["facebook"]},{id:"fastly-api-token",description:"Uncovered a Fastly API key, which may compromise CDN and edge cloud services, leading to content delivery and security issues.",regex:`(?i)[\\w.-]{0,50}?(?:fastly)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["fastly"]},{id:"finicity-api-token",description:"Detected a Finicity API token, potentially risking financial data access and unauthorized financial operations.",regex:`(?i)[\\w.-]{0,50}?(?:finicity)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["finicity"]},{id:"finicity-client-secret",description:"Identified a Finicity Client Secret, which could lead to compromised financial service integrations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:finicity)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["finicity"]},{id:"finnhub-access-token",description:"Found a Finnhub Access Token, risking unauthorized access to financial market data and analytics.",regex:`(?i)[\\w.-]{0,50}?(?:finnhub)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["finnhub"]},{id:"flickr-access-token",description:"Discovered a Flickr Access Token, posing a risk of unauthorized photo management and potential data leakage.",regex:`(?i)[\\w.-]{0,50}?(?:flickr)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["flickr"]},{id:"flutterwave-encryption-key",description:"Uncovered a Flutterwave Encryption Key, which may compromise payment processing and sensitive financial information.",regex:"FLWSECK_TEST-(?i)[a-h0-9]{12}",entropy:2,keywords:["flwseck_test"]},{id:"flutterwave-public-key",description:"Detected a Finicity Public Key, potentially exposing public cryptographic operations and integrations.",regex:"FLWPUBK_TEST-(?i)[a-h0-9]{32}-X",entropy:2,keywords:["flwpubk_test"]},{id:"flutterwave-secret-key",description:"Identified a Flutterwave Secret Key, risking unauthorized financial transactions and data breaches.",regex:"FLWSECK_TEST-(?i)[a-h0-9]{32}-X",entropy:2,keywords:["flwseck_test"]},{id:"flyio-access-token",description:"Uncovered a Fly.io API key",regex:`\\b((?:fo1_[\\w-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{100,}={0,3}|fm2_[a-zA-Z0-9+\\/]{100,}={0,3}))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["fo1_","fm1","fm2_"]},{id:"frameio-api-token",description:"Found a Frame.io API token, potentially compromising video collaboration and project management.",regex:"fio-u-(?i)[a-z0-9\\-_=]{64}",keywords:["fio-u-"]},{id:"freemius-secret-key",description:"Detected a Freemius secret key, potentially exposing sensitive information.",regex:`(?i)["']secret_key["']\\s*=>\\s*["'](sk_[\\S]{29})["']`,path:"(?i)\\.php$",keywords:["secret_key"]},{id:"freshbooks-access-token",description:"Discovered a Freshbooks Access Token, posing a risk to accounting software access and sensitive financial data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:freshbooks)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["freshbooks"]},{id:"gcp-api-key",description:"Uncovered a GCP API key, which could lead to unauthorized access to Google Cloud services and data breaches.",regex:`\\b(AIza[\\w-]{35})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["aiza"],allowlists:[{regexes:["AIzaSyabcdefghijklmnopqrstuvwxyz1234567","AIzaSyAnLA7NfeLquW1tJFpx_eQCxoX-oo6YyIs","AIzaSyCkEhVjf3pduRDt6d1yKOMitrUEke8agEM","AIzaSyDMAScliyLx7F0NPDEJi1QmyCgHIAODrlU","AIzaSyD3asb-2pEZVqMkmL6M9N6nHZRR_znhrh0","AIzayDNSXIbFmlXbIE6mCzDLQAqITYefhixbX4A","AIzaSyAdOS2zB6NCsk1pCdZ4-P6GBdi_UUPwX7c","AIzaSyASWm6HmTMdYWpgMnjRBjxcQ9CKctWmLd4","AIzaSyANUvH9H9BsUccjsu2pCmEkOPjjaXeDQgY","AIzaSyA5_iVawFQ8ABuTZNUdcwERLJv_a_p4wtM","AIzaSyA4UrcGxgwQFTfaI3no3t7Lt1sjmdnP5sQ","AIzaSyDSb51JiIcB6OJpwwMicseKRhhrOq1cS7g","AIzaSyBF2RrAIm4a0mO64EShQfqfd2AFnzAvvuU","AIzaSyBcE-OOIbhjyR83gm4r2MFCu4MJmprNXsw","AIzaSyB8qGxt4ec15vitgn44duC5ucxaOi4FmqE","AIzaSyA8vmApnrHNFE0bApF4hoZ11srVL_n0nvY"]}]},{id:"generic-api-key",description:"Detected a Generic API Key, potentially exposing access to various services and sensitive operations.",regex:`(?i)[\\w.-]{0,50}?(?:access|auth|(?-i:[Aa]pi|API)|credential|creds|key|passw(?:or)?d|secret|token)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([\\w.=-]{10,150}|[a-z0-9][a-z0-9+/]{11,}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["access","api","auth","key","credential","creds","passwd","password","secret","token"],allowlists:[{regexes:["^[a-zA-Z_.-]+$"]},{description:"Allowlist for Generic API Keys",regexTarget:"match",regexes:["(?i)(?:access(?:ibility|or)|access[_.-]?id|random[_.-]?access|api[_.-]?(?:id|name|version)|rapid|capital|[a-z0-9-]*?api[a-z0-9-]*?:jar:|author|X-MS-Exchange-Organization-Auth|Authentication-Results|(?:credentials?[_.-]?id|withCredentials)|(?:bucket|foreign|hot|idx|natural|primary|pub(?:lic)?|schema|sequence)[_.-]?key|(?:turkey)|key[_.-]?(?:alias|board|code|frame|id|length|mesh|name|pair|press(?:ed)?|ring|selector|signature|size|stone|storetype|word|up|down|left|right)|key[_.-]?vault[_.-]?(?:id|name)|keyVaultToStoreSecrets|key(?:store|tab)[_.-]?(?:file|path)|issuerkeyhash|(?-i:[DdMm]onkey|[DM]ONKEY)|keying|(?:secret)[_.-]?(?:length|name|size)|UserSecretsId|(?:csrf)[_.-]?token|(?:io\\.jsonwebtoken[ \\t]?:[ \\t]?[\\w-]+)|(?:api|credentials|token)[_.-]?(?:endpoint|ur[il])|public[_.-]?token|(?:key|token)[_.-]?file|(?-i:(?:[A-Z_]+=\\n[A-Z_]+=|[a-z_]+=\\n[a-z_]+=)(?:\\n|\\z))|(?-i:(?:[A-Z.]+=\\n[A-Z.]+=|[a-z.]+=\\n[a-z.]+=)(?:\\n|\\z)))"],stopwords:["000000","6fe4476ee5a1832882e326b506d14126","_ec2_","aaaaaa","about","abstract","academy","acces","account","act-","act.","act_","action","active","actively","activity","adapter","add-","add-on","add.","add_","addon","addres","admin","adobe","advanced","adventure","agent","agile","air-","air.","air_","ajax","akka","alert","alfred","algorithm","all-","all.","all_","alloy","alpha","amazon","amqp","analysi","analytic","analyzer","android","angular","angularj","animate","animation","another","ansible","answer","ant-","ant.","ant_","any-","any.","any_","apache","app-","app.","app_","apple","arch","archive","archived","arduino","array","art-","art.","art_","article","asp-","asp.","asp_","asset","async","atom","attention","audio","audit","aura","auth","author","authorize","auto","automated","automatic","awesome","aws_","azure","back","backbone","backend","backup","bar-","bar.","bar_","base","based","bash","basic","batch","been","beer","behavior","being","benchmark","best","beta","better","big-","big.","big_","binary","binding","bit-","bit.","bit_","bitcoin","block","blog","board","book","bookmark","boost","boot","bootstrap","bosh","bot-","bot.","bot_","bower","box-","box.","box_","boxen","bracket","branch","bridge","browser","brunch","buffer","bug-","bug.","bug_","build","builder","building","buildout","buildpack","built","bundle","busines","but-","but.","but_","button","cache","caching","cakephp","calendar","call","camera","campfire","can-","can.","can_","canva","captcha","capture","card","carousel","case","cassandra","cat-","cat.","cat_","category","center","cento","challenge","change","changelog","channel","chart","chat","cheat","check","checker","chef","ches","chinese","chosen","chrome","ckeditor","clas","classe","classic","clean","cli-","cli.","cli_","client","clojure","clone","closure","cloud","club","cluster","cms-","cms_","coco","code","coding","coffee","color","combination","combo","command","commander","comment","commit","common","community","compas","compiler","complete","component","composer","computer","computing","con-","con.","con_","concept","conf","config","connect","connector","console","contact","container","contao","content","contest","context","control","convert","converter","conway'","cookbook","cookie","cool","copy","cordova","core","couchbase","couchdb","countdown","counter","course","craft","crawler","create","creating","creator","credential","crm-","crm.","crm_","cros","crud","csv-","csv.","csv_","cube","cucumber","cuda","current","currently","custom","daemon","dark","dart","dash","dashboard","data","database","date","day-","day.","day_","dead","debian","debug","debugger","deck","define","del-","del.","del_","delete","demo","deploy","design","designer","desktop","detection","detector","dev-","dev.","dev_","develop","developer","device","devise","diff","digital","directive","directory","discovery","display","django","dns-","dns_","doc-","doc.","doc_","docker","docpad","doctrine","document","doe-","doe.","doe_","dojo","dom-","dom.","dom_","domain","don't","done","dot-","dot.","dot_","dotfile","download","draft","drag","drill","drive","driven","driver","drop","dropbox","drupal","dsl-","dsl.","dsl_","dynamic","easy","ecdsa","eclipse","edit","editing","edition","editor","element","emac","email","embed","embedded","ember","emitter","emulator","encoding","endpoint","engine","english","enhanced","entity","entry","env_","episode","erlang","error","espresso","event","evented","example","exchange","exercise","experiment","expire","exploit","explorer","export","exporter","expres","ext-","ext.","ext_","extended","extension","external","extra","extractor","fabric","facebook","factory","fake","fast","feature","feed","fewfwef","ffmpeg","field","file","filter","find","finder","firefox","firmware","first","fish","fix-","fix_","flash","flask","flat","flex","flexible","flickr","flow","fluent","fluentd","fluid","folder","font","force","foreman","fork","form","format","formatter","forum","foundry","framework","free","friend","friendly","front-end","frontend","ftp-","ftp.","ftp_","fuel","full","fun-","fun.","fun_","func","future","gaia","gallery","game","gateway","gem-","gem.","gem_","gen-","gen.","gen_","general","generator","generic","genetic","get-","get.","get_","getenv","getting","ghost","gist","git-","git.","git_","github","gitignore","gitlab","glas","gmail","gnome","gnu-","gnu.","gnu_","goal","golang","gollum","good","google","gpu-","gpu.","gpu_","gradle","grail","graph","graphic","great","grid","groovy","group","grunt","guard","gui-","gui.","gui_","guide","guideline","gulp","gwt-","gwt.","gwt_","hack","hackathon","hacker","hacking","hadoop","haml","handler","hardware","has-","has_","hash","haskell","have","haxe","hello","help","helper","here","hero","heroku","high","hipchat","history","home","homebrew","homepage","hook","host","hosting","hot-","hot.","hot_","house","how-","how.","how_","html","http","hub-","hub.","hub_","hubot","human","icon","ide-","ide.","ide_","idea","identity","idiomatic","image","impact","import","important","importer","impres","index","infinite","info","injection","inline","input","inside","inspector","instagram","install","installer","instant","intellij","interface","internet","interview","into","intro","ionic","iphone","ipython","irc-","irc_","iso-","iso.","iso_","issue","jade","jasmine","java","jbos","jekyll","jenkin","jetbrains","job-","job.","job_","joomla","jpa-","jpa.","jpa_","jquery","json","just","kafka","karma","kata","kernel","keyboard","kindle","kit-","kit.","kit_","kitchen","knife","koan","kohana","lab-","lab.","lab_","lambda","lamp","language","laravel","last","latest","latex","launcher","layer","layout","lazy","ldap","leaflet","league","learn","learning","led-","led.","led_","leetcode","les-","les.","les_","level","leveldb","lib-","lib.","lib_","librarie","library","license","life","liferay","light","lightbox","like","line","link","linked","linkedin","linux","lisp","list","lite","little","load","loader","local","location","lock","log-","log.","log_","logger","logging","logic","login","logstash","longer","look","love","lua-","lua.","lua_","mac-","mac.","mac_","machine","made","magento","magic","mail","make","maker","making","man-","man.","man_","manage","manager","manifest","manual","map-","map.","map_","mapper","mapping","markdown","markup","master","math","matrix","maven","md5","mean","media","mediawiki","meetup","memcached","memory","menu","merchant","message","messaging","meta","metadata","meteor","method","metric","micro","middleman","migration","minecraft","miner","mini","minimal","mirror","mit-","mit.","mit_","mobile","mocha","mock","mod-","mod.","mod_","mode","model","modern","modular","module","modx","money","mongo","mongodb","mongoid","mongoose","monitor","monkey","more","motion","moved","movie","mozilla","mqtt","mule","multi","multiple","music","mustache","mvc-","mvc.","mvc_","mysql","nagio","name","native","need","neo-","neo.","neo_","nest","nested","net-","net.","net_","nette","network","new-","new.","new_","next","nginx","ninja","nlp-","nlp.","nlp_","node","nodej","nosql","not-","not.","not_","note","notebook","notepad","notice","notifier","now-","now.","now_","number","oauth","object","objective","obsolete","ocaml","octopres","official","old-","old.","old_","onboard","online","only","open","opencv","opengl","openshift","openwrt","option","oracle","org-","org.","org_","origin","original","orm-","orm.","orm_","osx-","osx_","our-","our.","our_","out-","out.","out_","output","over","overview","own-","own.","own_","pack","package","packet","page","panel","paper","paperclip","para","parallax","parallel","parse","parser","parsing","particle","party","password","patch","path","pattern","payment","paypal","pdf-","pdf.","pdf_","pebble","people","perl","personal","phalcon","phoenix","phone","phonegap","photo","php-","php.","php_","physic","picker","pipeline","platform","play","player","please","plu-","plu.","plu_","plug-in","plugin","plupload","png-","png.","png_","poker","polyfill","polymer","pool","pop-","pop.","pop_","popcorn","popup","port","portable","portal","portfolio","post","power","powered","powerful","prelude","pretty","preview","principle","print","pro-","pro.","pro_","problem","proc","product","profile","profiler","program","progres","project","protocol","prototype","provider","proxy","public","pull","puppet","pure","purpose","push","pusher","pyramid","python","quality","query","queue","quick","rabbitmq","rack","radio","rail","railscast","random","range","raspberry","rdf-","rdf.","rdf_","react","reactive","read","reader","readme","ready","real","real-time","reality","realtime","recipe","recorder","red-","red.","red_","reddit","redi","redmine","reference","refinery","refresh","registry","related","release","remote","rendering","repo","report","request","require","required","requirej","research","resource","response","resque","rest","restful","resume","reveal","reverse","review","riak","rich","right","ring","robot","role","room","router","routing","rpc-","rpc.","rpc_","rpg-","rpg.","rpg_","rspec","ruby-","ruby.","ruby_","rule","run-","run.","run_","runner","running","runtime","rust","rvm-","rvm.","rvm_","salt","sample","sandbox","sas-","sas.","sas_","sbt-","sbt.","sbt_","scala","scalable","scanner","schema","scheme","school","science","scraper","scratch","screen","script","scroll","scs-","scs.","scs_","sdk-","sdk.","sdk_","sdl-","sdl.","sdl_","search","secure","security","see-","see.","see_","seed","select","selector","selenium","semantic","sencha","send","sentiment","serie","server","service","session","set-","set.","set_","setting","setup","sha1","sha2","sha256","share","shared","sharing","sheet","shell","shield","shipping","shop","shopify","shortener","should","show","showcase","side","silex","simple","simulator","single","site","skeleton","sketch","skin","slack","slide","slider","slim","small","smart","smtp","snake","snapshot","snippet","soap","social","socket","software","solarized","solr","solution","solver","some","soon","source","space","spark","spatial","spec","sphinx","spine","spotify","spree","spring","sprite","sql-","sql.","sql_","sqlite","ssh-","ssh.","ssh_","stack","staging","standard","stanford","start","started","starter","startup","stat","statamic","state","static","statistic","statsd","statu","steam","step","still","stm-","stm.","stm_","storage","store","storm","story","strategy","stream","streaming","string","stripe","structure","studio","study","stuff","style","sublime","sugar","suite","summary","super","support","supported","svg-","svg.","svg_","svn-","svn.","svn_","swagger","swift","switch","switcher","symfony","symphony","sync","synopsi","syntax","system","tab-","tab.","tab_","table","tag-","tag.","tag_","talk","target","task","tcp-","tcp.","tcp_","tdd-","tdd.","tdd_","team","tech","template","term","terminal","testing","tetri","text","textmate","theme","theory","three","thrift","time","timeline","timer","tiny","tinymce","tip-","tip.","tip_","title","todo","todomvc","token","tool","toolbox","toolkit","top-","top.","top_","tornado","touch","tower","tracker","tracking","traffic","training","transfer","translate","transport","tree","trello","try-","try.","try_","tumblr","tut-","tut.","tut_","tutorial","tweet","twig","twitter","type","typo","ubuntu","uiview","ultimate","under","unit","unity","universal","unix","update","updated","upgrade","upload","uploader","uri-","uri.","uri_","url-","url.","url_","usage","usb-","usb.","usb_","use-","use.","use_","used","useful","user","using","util","utilitie","utility","vagrant","validator","value","variou","varnish","version","via-","via.","via_","video","view","viewer","vim-","vim.","vim_","vimrc","virtual","vision","visual","vpn","want","warning","watch","watcher","wave","way-","way.","way_","weather","web-","web_","webapp","webgl","webhook","webkit","webrtc","website","websocket","welcome","what","what'","when","where","which","why-","why.","why_","widget","wifi","wiki","win-","win.","win_","window","wip-","wip.","wip_","within","without","wizard","word","wordpres","work","worker","workflow","working","workshop","world","wrapper","write","writer","writing","written","www-","www.","www_","xamarin","xcode","xml-","xml.","xml_","xmpp","xxxxxx","yahoo","yaml","yandex","yeoman","yet-","yet.","yet_","yii-","yii.","yii_","youtube","yui-","yui.","yui_","zend","zero","zip-","zip.","zip_","zsh-","zsh.","zsh_"]},{regexTarget:"line",regexes:["--mount=type=secret,",`import[ \\t]+{[ \\t\\w,]+}[ \\t]+from[ \\t]+['"][^'"]+['"]`]},{condition:"AND",paths:["\\.bb$","\\.bbappend$","\\.bbclass$","\\.inc$"],regexTarget:"line",regexes:['LICENSE[^=]*=\\s*"[^"]+','LIC_FILES_CHKSUM[^=]*=\\s*"[^"]+','SRC[^=]*=\\s*"[a-zA-Z0-9]+']}]},{id:"github-app-token",description:"Identified a GitHub App Token, which may compromise GitHub application integrations and source code security.",regex:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",entropy:3,keywords:["ghu_","ghs_"],allowlists:[{paths:["(?:^|/)@octokit/auth-token/README\\.md$"]}]},{id:"github-fine-grained-pat",description:"Found a GitHub Fine-Grained Personal Access Token, risking unauthorized repository access and code manipulation.",regex:"github_pat_\\w{82}",entropy:3,keywords:["github_pat_"]},{id:"github-oauth",description:"Discovered a GitHub OAuth Access Token, posing a risk of compromised GitHub account integrations and data leaks.",regex:"gho_[0-9a-zA-Z]{36}",entropy:3,keywords:["gho_"]},{id:"github-pat",description:"Uncovered a GitHub Personal Access Token, potentially leading to unauthorized repository access and sensitive content exposure.",regex:"ghp_[0-9a-zA-Z]{36}",entropy:3,keywords:["ghp_"],allowlists:[{paths:["(?:^|/)@octokit/auth-token/README\\.md$"]}]},{id:"github-refresh-token",description:"Detected a GitHub Refresh Token, which could allow prolonged unauthorized access to GitHub services.",regex:"ghr_[0-9a-zA-Z]{36}",entropy:3,keywords:["ghr_"]},{id:"gitlab-cicd-job-token",description:"Identified a GitLab CI/CD Job Token, potential access to projects and some APIs on behalf of a user while the CI job is running.",regex:"glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}",entropy:3,keywords:["glcbt-"]},{id:"gitlab-deploy-token",description:"Identified a GitLab Deploy Token, risking access to repositories, packages and containers with write access.",regex:"gldt-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["gldt-"]},{id:"gitlab-feature-flag-client-token",description:"Identified a GitLab feature flag client token, risks exposing user lists and features flags used by an application.",regex:"glffct-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["glffct-"]},{id:"gitlab-feed-token",description:"Identified a GitLab feed token, risking exposure of user data.",regex:"glft-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["glft-"]},{id:"gitlab-incoming-mail-token",description:"Identified a GitLab incoming mail token, risking manipulation of data sent by mail.",regex:"glimt-[0-9a-zA-Z_\\-]{25}",entropy:3,keywords:["glimt-"]},{id:"gitlab-kubernetes-agent-token",description:"Identified a GitLab Kubernetes Agent token, risking access to repos and registry of projects connected via agent.",regex:"glagent-[0-9a-zA-Z_\\-]{50}",entropy:3,keywords:["glagent-"]},{id:"gitlab-oauth-app-secret",description:"Identified a GitLab OIDC Application Secret, risking access to apps using GitLab as authentication provider.",regex:"gloas-[0-9a-zA-Z_\\-]{64}",entropy:3,keywords:["gloas-"]},{id:"gitlab-pat",description:"Identified a GitLab Personal Access Token, risking unauthorized access to GitLab repositories and codebase exposure.",regex:"glpat-[\\w-]{20}",entropy:3,keywords:["glpat-"]},{id:"gitlab-pat-routable",description:"Identified a GitLab Personal Access Token (routable), risking unauthorized access to GitLab repositories and codebase exposure.",regex:"\\bglpat-[0-9a-zA-Z_-]{27,300}\\.[0-9a-z]{2}[0-9a-z]{7}\\b",entropy:4,keywords:["glpat-"]},{id:"gitlab-ptt",description:"Found a GitLab Pipeline Trigger Token, potentially compromising continuous integration workflows and project security.",regex:"glptt-[0-9a-f]{40}",entropy:3,keywords:["glptt-"]},{id:"gitlab-rrt",description:"Discovered a GitLab Runner Registration Token, posing a risk to CI/CD pipeline integrity and unauthorized access.",regex:"GR1348941[\\w-]{20}",entropy:3,keywords:["gr1348941"]},{id:"gitlab-runner-authentication-token",description:"Discovered a GitLab Runner Authentication Token, posing a risk to CI/CD pipeline integrity and unauthorized access.",regex:"glrt-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["glrt-"]},{id:"gitlab-runner-authentication-token-routable",description:"Discovered a GitLab Runner Authentication Token (Routable), posing a risk to CI/CD pipeline integrity and unauthorized access.",regex:"\\bglrt-t\\d_[0-9a-zA-Z_\\-]{27,300}\\.[0-9a-z]{2}[0-9a-z]{7}\\b",entropy:4,keywords:["glrt-"]},{id:"gitlab-scim-token",description:"Discovered a GitLab SCIM Token, posing a risk to unauthorized access for a organization or instance.",regex:"glsoat-[0-9a-zA-Z_\\-]{20}",entropy:3,keywords:["glsoat-"]},{id:"gitlab-session-cookie",description:"Discovered a GitLab Session Cookie, posing a risk to unauthorized access to a user account.",regex:"_gitlab_session=[0-9a-z]{32}",entropy:3,keywords:["_gitlab_session="]},{id:"gitter-access-token",description:"Uncovered a Gitter Access Token, which may lead to unauthorized access to chat and communication services.",regex:`(?i)[\\w.-]{0,50}?(?:gitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["gitter"]},{id:"gocardless-api-token",description:"Detected a GoCardless API token, potentially risking unauthorized direct debit payment operations and financial data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:gocardless)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(live_(?i)[a-z0-9\\-_=]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["live_","gocardless"]},{id:"grafana-api-key",description:"Identified a Grafana API key, which could compromise monitoring dashboards and sensitive data analytics.",regex:`(?i)\\b(eyJrIjoi[A-Za-z0-9]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["eyjrijoi"]},{id:"grafana-cloud-api-token",description:"Found a Grafana cloud API token, risking unauthorized access to cloud-based monitoring services and data exposure.",regex:`(?i)\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["glc_"]},{id:"grafana-service-account-token",description:"Discovered a Grafana service account token, posing a risk of compromised monitoring services and data integrity.",regex:`(?i)\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["glsa_"]},{id:"harness-api-key",description:"Identified a Harness Access Token (PAT or SAT), risking unauthorized access to a Harness account.",regex:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}",keywords:["pat.","sat."]},{id:"hashicorp-tf-api-token",description:"Uncovered a HashiCorp Terraform user/org API token, which may lead to unauthorized infrastructure management and security breaches.",regex:"(?i)[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}",entropy:3.5,keywords:["atlasv1"]},{id:"hashicorp-tf-password",description:"Identified a HashiCorp Terraform password field, risking unauthorized infrastructure configuration and security breaches.",regex:`(?i)[\\w.-]{0,50}?(?:administrator_login_password|password)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}("[a-z0-9=_\\-]{8,20}")(?:[\\x60'"\\s;]|\\\\[nr]|$)`,path:"(?i)\\.(?:tf|hcl)$",entropy:2,keywords:["administrator_login_password","password"]},{id:"heroku-api-key",description:"Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",regex:`(?i)[\\w.-]{0,50}?(?:heroku)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["heroku"]},{id:"heroku-api-key-v2",description:"Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",regex:`\\b((HRKU-AA[0-9a-zA-Z_-]{58}))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["hrku-aa"]},{id:"hubspot-api-key",description:"Found a HubSpot API Token, posing a risk to CRM data integrity and unauthorized marketing operations.",regex:`(?i)[\\w.-]{0,50}?(?:hubspot)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["hubspot"]},{id:"huggingface-access-token",description:"Discovered a Hugging Face Access token, which could lead to unauthorized access to AI models and sensitive data.",regex:`\\b(hf_(?i:[a-z]{34}))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["hf_"]},{id:"huggingface-organization-api-token",description:"Uncovered a Hugging Face Organization API token, potentially compromising AI organization accounts and associated data.",regex:`\\b(api_org_(?i:[a-z]{34}))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["api_org_"]},{id:"infracost-api-token",description:"Detected an Infracost API Token, risking unauthorized access to cloud cost estimation tools and financial data.",regex:`\\b(ico-[a-zA-Z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["ico-"]},{id:"intercom-api-key",description:"Identified an Intercom API Token, which could compromise customer communication channels and data privacy.",regex:`(?i)[\\w.-]{0,50}?(?:intercom)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{60})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["intercom"]},{id:"intra42-client-secret",description:"Found a Intra42 client secret, which could lead to unauthorized access to the 42School API and sensitive data.",regex:`\\b(s-s4t2(?:ud|af)-(?i)[abcdef0123456789]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["intra","s-s4t2ud-","s-s4t2af-"]},{id:"jfrog-api-key",description:"Found a JFrog API Key, posing a risk of unauthorized access to software artifact repositories and build pipelines.",regex:`(?i)[\\w.-]{0,50}?(?:jfrog|artifactory|bintray|xray)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{73})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["jfrog","artifactory","bintray","xray"]},{id:"jfrog-identity-token",description:"Discovered a JFrog Identity Token, potentially compromising access to JFrog services and sensitive software artifacts.",regex:`(?i)[\\w.-]{0,50}?(?:jfrog|artifactory|bintray|xray)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["jfrog","artifactory","bintray","xray"]},{id:"jwt",description:"Uncovered a JSON Web Token, which may lead to unauthorized access to web applications and sensitive user data.",regex:`\\b(ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["ey"]},{id:"jwt-base64",description:"Detected a Base64-encoded JSON Web Token, posing a risk of exposing encoded authentication and data exchange information.",regex:"\\bZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}",entropy:2,keywords:["zxlk"]},{id:"kraken-access-token",description:"Identified a Kraken Access Token, potentially compromising cryptocurrency trading accounts and financial security.",regex:`(?i)[\\w.-]{0,50}?(?:kraken)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9\\/=_\\+\\-]{80,90})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["kraken"]},{id:"kubernetes-secret-yaml",description:"Possible Kubernetes Secret detected, posing a risk of leaking credentials/tokens from your deployments",regex:`(?i)(?:\\bkind:[ \\t]*["']?\\bsecret\\b["']?(?s:.){0,200}?\\bdata:(?s:.){0,100}?\\s+([\\w.-]+:(?:[ \\t]*(?:\\||>[-+]?)\\s+)?[ \\t]*(?:["']?[a-z0-9+/]{10,}={0,3}["']?|\\{\\{[ \\t\\w"|$:=,.-]+}}|""|''))|\\bdata:(?s:.){0,100}?\\s+([\\w.-]+:(?:[ \\t]*(?:\\||>[-+]?)\\s+)?[ \\t]*(?:["']?[a-z0-9+/]{10,}={0,3}["']?|\\{\\{[ \\t\\w"|$:=,.-]+}}|""|''))(?s:.){0,200}?\\bkind:[ \\t]*["']?\\bsecret\\b["']?)`,path:"(?i)\\.ya?ml$",keywords:["secret"],allowlists:[{regexes:[`[\\w.-]+:(?:[ \\t]*(?:\\||>[-+]?)\\s+)?[ \\t]*(?:\\{\\{[ \\t\\w"|$:=,.-]+}}|""|'')`]},{regexTarget:"match",regexes:["(kind:(?s:.)+\\n---\\n(?s:.)+\\bdata:|data:(?s:.)+\\n---\\n(?s:.)+\\bkind:)"]}]},{id:"kucoin-access-token",description:"Found a Kucoin Access Token, risking unauthorized access to cryptocurrency exchange services and transactions.",regex:`(?i)[\\w.-]{0,50}?(?:kucoin)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{24})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["kucoin"]},{id:"kucoin-secret-key",description:"Discovered a Kucoin Secret Key, which could lead to compromised cryptocurrency operations and financial data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:kucoin)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["kucoin"]},{id:"launchdarkly-access-token",description:"Uncovered a Launchdarkly Access Token, potentially compromising feature flag management and application functionality.",regex:`(?i)[\\w.-]{0,50}?(?:launchdarkly)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["launchdarkly"]},{id:"linear-api-key",description:"Detected a Linear API Token, posing a risk to project management tools and sensitive task data.",regex:"lin_api_(?i)[a-z0-9]{40}",entropy:2,keywords:["lin_api_"]},{id:"linear-client-secret",description:"Identified a Linear Client Secret, which may compromise secure integrations and sensitive project management data.",regex:`(?i)[\\w.-]{0,50}?(?:linear)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["linear"]},{id:"linkedin-client-id",description:"Found a LinkedIn Client ID, risking unauthorized access to LinkedIn integrations and professional data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:linked[_-]?in)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{14})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["linkedin","linked_in","linked-in"]},{id:"linkedin-client-secret",description:"Discovered a LinkedIn Client secret, potentially compromising LinkedIn application integrations and user data.",regex:`(?i)[\\w.-]{0,50}?(?:linked[_-]?in)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["linkedin","linked_in","linked-in"]},{id:"lob-api-key",description:"Uncovered a Lob API Key, which could lead to unauthorized access to mailing and address verification services.",regex:`(?i)[\\w.-]{0,50}?(?:lob)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}((live|test)_[a-f0-9]{35})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["test_","live_"]},{id:"lob-pub-api-key",description:"Detected a Lob Publishable API Key, posing a risk of exposing mail and print service integrations.",regex:`(?i)[\\w.-]{0,50}?(?:lob)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}((test|live)_pub_[a-f0-9]{31})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["test_pub","live_pub","_pub"]},{id:"looker-client-id",description:"Found a Looker Client ID, risking unauthorized access to a Looker account and exposing sensitive data.",regex:`(?i)[\\w.-]{0,50}?(?:looker)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["looker"]},{id:"looker-client-secret",description:"Found a Looker Client Secret, risking unauthorized access to a Looker account and exposing sensitive data.",regex:`(?i)[\\w.-]{0,50}?(?:looker)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{24})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["looker"]},{id:"mailchimp-api-key",description:"Identified a Mailchimp API key, potentially compromising email marketing campaigns and subscriber data.",regex:`(?i)[\\w.-]{0,50}?(?:MailchimpSDK.initialize|mailchimp)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{32}-us\\d\\d)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mailchimp"]},{id:"mailgun-private-api-token",description:"Found a Mailgun private API token, risking unauthorized email service operations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(key-[a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mailgun"]},{id:"mailgun-pub-key",description:"Discovered a Mailgun public validation key, which could expose email verification processes and associated data.",regex:`(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(pubkey-[a-f0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mailgun"]},{id:"mailgun-signing-key",description:"Uncovered a Mailgun webhook signing key, potentially compromising email automation and data integrity.",regex:`(?i)[\\w.-]{0,50}?(?:mailgun)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mailgun"]},{id:"mapbox-api-token",description:"Detected a MapBox API token, posing a risk to geospatial services and sensitive location data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:mapbox)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mapbox"]},{id:"mattermost-access-token",description:"Identified a Mattermost Access Token, which may compromise team communication channels and data privacy.",regex:`(?i)[\\w.-]{0,50}?(?:mattermost)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{26})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["mattermost"]},{id:"maxmind-license-key",description:"Discovered a potential MaxMind license key.",regex:`\\b([A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["_mmk"]},{id:"messagebird-api-token",description:"Found a MessageBird API token, risking unauthorized access to communication platforms and message data.",regex:`(?i)[\\w.-]{0,50}?(?:message[_-]?bird)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{25})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["messagebird","message-bird","message_bird"]},{id:"messagebird-client-id",description:"Discovered a MessageBird client ID, potentially compromising API integrations and sensitive communication data.",regex:`(?i)[\\w.-]{0,50}?(?:message[_-]?bird)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["messagebird","message-bird","message_bird"]},{id:"microsoft-teams-webhook",description:"Uncovered a Microsoft Teams Webhook, which could lead to unauthorized access to team collaboration tools and data leaks.",regex:"https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12}",keywords:["webhook.office.com","webhookb2","incomingwebhook"]},{id:"netlify-access-token",description:"Detected a Netlify Access Token, potentially compromising web hosting services and site management.",regex:`(?i)[\\w.-]{0,50}?(?:netlify)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{40,46})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["netlify"]},{id:"new-relic-browser-api-token",description:"Identified a New Relic ingest browser API token, risking unauthorized access to application performance data and analytics.",regex:`(?i)[\\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(NRJS-[a-f0-9]{19})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["nrjs-"]},{id:"new-relic-insert-key",description:"Discovered a New Relic insight insert key, compromising data injection into the platform.",regex:`(?i)[\\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(NRII-[a-z0-9-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["nrii-"]},{id:"new-relic-user-api-id",description:"Found a New Relic user API ID, posing a risk to application monitoring services and data integrity.",regex:`(?i)[\\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["new-relic","newrelic","new_relic"]},{id:"new-relic-user-api-key",description:"Discovered a New Relic user API Key, which could lead to compromised application insights and performance monitoring.",regex:`(?i)[\\w.-]{0,50}?(?:new-relic|newrelic|new_relic)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(NRAK-[a-z0-9]{27})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["nrak"]},{id:"notion-api-token",description:"Notion API token",regex:`\\b(ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["ntn_"]},{id:"npm-access-token",description:"Uncovered an npm access token, potentially compromising package management and code repository access.",regex:`(?i)\\b(npm_[a-z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["npm_"]},{id:"nuget-config-password",description:"Identified a password within a Nuget config file, potentially compromising package management access.",regex:'(?i)<add key=\\"(?:(?:ClearText)?Password)\\"\\s*value=\\"(.{8,})\\"\\s*/>',path:"(?i)nuget\\.config$",entropy:1,keywords:["<add key="],allowlists:[{regexes:["33f!!lloppa","hal\\+9ooo_da!sY","^\\%\\S.*\\%$"]}]},{id:"nytimes-access-token",description:"Detected a Nytimes Access Token, risking unauthorized access to New York Times APIs and content services.",regex:`(?i)[\\w.-]{0,50}?(?:nytimes|new-york-times,|newyorktimes)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9=_\\-]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["nytimes","new-york-times","newyorktimes"]},{id:"octopus-deploy-api-key",description:"Discovered a potential Octopus Deploy API key, risking application deployments and operational security.",regex:`\\b(API-[A-Z0-9]{26})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["api-"]},{id:"okta-access-token",description:"Identified an Okta Access Token, which may compromise identity management services and user authentication data.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:(?-i:[Oo]kta|OKTA))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(00[\\w=\\-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["okta"]},{id:"openai-api-key",description:"Found an OpenAI API Key, posing a risk of unauthorized access to AI services and data manipulation.",regex:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["t3blbkfj"]},{id:"openshift-user-token",description:"Found an OpenShift user token, potentially compromising an OpenShift/Kubernetes cluster.",regex:"\\b(sha256~[\\w-]{43})(?:[^\\w-]|\\z)",entropy:3.5,keywords:["sha256~"]},{id:"perplexity-api-key",description:"Detected a Perplexity API key, which could lead to unauthorized access to Perplexity AI services and data exposure.",regex:`\\b(pplx-[a-zA-Z0-9]{48})(?:[\\x60'"\\s;]|\\\\[nr]|$|\\b)`,entropy:4,keywords:["pplx-"]},{id:"pkcs12-file",description:"Found a PKCS #12 file, which commonly contain bundled private keys.",path:"(?i)(?:^|\\/)[^\\/]+\\.p(?:12|fx)$"},{id:"plaid-api-token",description:"Discovered a Plaid API Token, potentially compromising financial data aggregation and banking services.",regex:`(?i)[\\w.-]{0,50}?(?:plaid)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["plaid"]},{id:"plaid-client-id",description:"Uncovered a Plaid Client ID, which could lead to unauthorized financial service integrations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:plaid)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{24})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["plaid"]},{id:"plaid-secret-key",description:"Detected a Plaid Secret key, risking unauthorized access to financial accounts and sensitive transaction data.",regex:`(?i)[\\w.-]{0,50}?(?:plaid)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{30})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["plaid"]},{id:"planetscale-api-token",description:"Identified a PlanetScale API token, potentially compromising database management and operations.",regex:`\\b(pscale_tkn_(?i)[\\w=\\.-]{32,64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["pscale_tkn_"]},{id:"planetscale-oauth-token",description:"Found a PlanetScale OAuth token, posing a risk to database access control and sensitive data integrity.",regex:`\\b(pscale_oauth_[\\w=\\.-]{32,64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["pscale_oauth_"]},{id:"planetscale-password",description:"Discovered a PlanetScale password, which could lead to unauthorized database operations and data breaches.",regex:`(?i)\\b(pscale_pw_(?i)[\\w=\\.-]{32,64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["pscale_pw_"]},{id:"postman-api-token",description:"Uncovered a Postman API token, potentially compromising API testing and development workflows.",regex:`\\b(PMAK-(?i)[a-f0-9]{24}\\-[a-f0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["pmak-"]},{id:"prefect-api-token",description:"Detected a Prefect API token, risking unauthorized access to workflow management and automation services.",regex:`\\b(pnu_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["pnu_"]},{id:"private-key",description:"Identified a Private Key, which may compromise cryptographic security and sensitive data encryption.",regex:"(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?KEY(?: BLOCK)?-----",keywords:["-----begin"]},{id:"privateai-api-token",description:"Identified a PrivateAI Token, posing a risk of unauthorized access to AI services and data manipulation.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:private[_-]?ai)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{32})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["privateai","private_ai","private-ai"]},{id:"pulumi-api-token",description:"Found a Pulumi API token, posing a risk to infrastructure as code services and cloud resource management.",regex:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["pul-"]},{id:"pypi-upload-token",description:"Discovered a PyPI upload token, potentially compromising Python package distribution and repository integrity.",regex:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",entropy:3,keywords:["pypi-ageichlwas5vcmc"]},{id:"rapidapi-access-token",description:"Uncovered a RapidAPI Access Token, which could lead to unauthorized access to various APIs and data services.",regex:`(?i)[\\w.-]{0,50}?(?:rapidapi)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9_-]{50})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["rapidapi"]},{id:"readme-api-token",description:"Detected a Readme API token, risking unauthorized documentation management and content exposure.",regex:`\\b(rdme_[a-z0-9]{70})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["rdme_"]},{id:"rubygems-api-token",description:"Identified a Rubygem API token, potentially compromising Ruby library distribution and package management.",regex:`\\b(rubygems_[a-f0-9]{48})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["rubygems_"]},{id:"scalingo-api-token",description:"Found a Scalingo API token, posing a risk to cloud platform services and application deployment security.",regex:`\\b(tk-us-[\\w-]{48})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["tk-us-"]},{id:"sendbird-access-id",description:"Discovered a Sendbird Access ID, which could compromise chat and messaging platform integrations.",regex:`(?i)[\\w.-]{0,50}?(?:sendbird)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["sendbird"]},{id:"sendbird-access-token",description:"Uncovered a Sendbird Access Token, potentially risking unauthorized access to communication services and user data.",regex:`(?i)[\\w.-]{0,50}?(?:sendbird)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["sendbird"]},{id:"sendgrid-api-token",description:"Detected a SendGrid API token, posing a risk of unauthorized email service operations and data exposure.",regex:`\\b(SG\\.(?i)[a-z0-9=_\\-\\.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["sg."]},{id:"sendinblue-api-token",description:"Identified a Sendinblue API token, which may compromise email marketing services and subscriber data privacy.",regex:`\\b(xkeysib-[a-f0-9]{64}\\-(?i)[a-z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["xkeysib-"]},{id:"sentry-access-token",description:"Found a Sentry.io Access Token (old format), risking unauthorized access to error tracking services and sensitive application data.",regex:`(?i)[\\w.-]{0,50}?(?:sentry)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sentry"]},{id:"sentry-org-token",description:"Found a Sentry.io Organization Token, risking unauthorized access to error tracking services and sensitive application data.",regex:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)",entropy:4.5,keywords:["sntrys_eyjpyxqio"]},{id:"sentry-user-token",description:"Found a Sentry.io User Token, risking unauthorized access to error tracking services and sensitive application data.",regex:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["sntryu_"]},{id:"settlemint-application-access-token",description:"Found a Settlemint Application Access Token.",regex:`\\b(sm_aat_[a-zA-Z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sm_aat"]},{id:"settlemint-personal-access-token",description:"Found a Settlemint Personal Access Token.",regex:`\\b(sm_pat_[a-zA-Z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sm_pat"]},{id:"settlemint-service-access-token",description:"Found a Settlemint Service Access Token.",regex:`\\b(sm_sat_[a-zA-Z0-9]{16})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sm_sat"]},{id:"shippo-api-token",description:"Discovered a Shippo API token, potentially compromising shipping services and customer order data.",regex:`\\b(shippo_(?:live|test)_[a-fA-F0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["shippo_"]},{id:"shopify-access-token",description:"Uncovered a Shopify access token, which could lead to unauthorized e-commerce platform access and data breaches.",regex:"shpat_[a-fA-F0-9]{32}",entropy:2,keywords:["shpat_"]},{id:"shopify-custom-access-token",description:"Detected a Shopify custom access token, potentially compromising custom app integrations and e-commerce data security.",regex:"shpca_[a-fA-F0-9]{32}",entropy:2,keywords:["shpca_"]},{id:"shopify-private-app-access-token",description:"Identified a Shopify private app access token, risking unauthorized access to private app data and store operations.",regex:"shppa_[a-fA-F0-9]{32}",entropy:2,keywords:["shppa_"]},{id:"shopify-shared-secret",description:"Found a Shopify shared secret, posing a risk to application authentication and e-commerce platform security.",regex:"shpss_[a-fA-F0-9]{32}",entropy:2,keywords:["shpss_"]},{id:"sidekiq-secret",description:"Discovered a Sidekiq Secret, which could lead to compromised background job processing and application data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:BUNDLE_ENTERPRISE__CONTRIBSYS__COM|BUNDLE_GEMS__CONTRIBSYS__COM)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-f0-9]{8}:[a-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["bundle_enterprise__contribsys__com","bundle_gems__contribsys__com"]},{id:"sidekiq-sensitive-url",description:"Uncovered a Sidekiq Sensitive URL, potentially exposing internal job queues and sensitive operation details.",regex:"(?i)\\bhttps?://([a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)",keywords:["gems.contribsys.com","enterprise.contribsys.com"]},{id:"slack-app-token",description:"Detected a Slack App-level token, risking unauthorized access to Slack applications and workspace data.",regex:"(?i)xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",entropy:2,keywords:["xapp"]},{id:"slack-bot-token",description:"Identified a Slack Bot token, which may compromise bot integrations and communication channel security.",regex:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",entropy:3,keywords:["xoxb"]},{id:"slack-config-access-token",description:"Found a Slack Configuration access token, posing a risk to workspace configuration and sensitive data access.",regex:"(?i)xoxe.xox[bp]-\\d-[A-Z0-9]{163,166}",entropy:2,keywords:["xoxe.xoxb-","xoxe.xoxp-"]},{id:"slack-config-refresh-token",description:"Discovered a Slack Configuration refresh token, potentially allowing prolonged unauthorized access to configuration settings.",regex:"(?i)xoxe-\\d-[A-Z0-9]{146}",entropy:2,keywords:["xoxe-"]},{id:"slack-legacy-bot-token",description:"Uncovered a Slack Legacy bot token, which could lead to compromised legacy bot operations and data exposure.",regex:"xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}",entropy:2,keywords:["xoxb"]},{id:"slack-legacy-token",description:"Detected a Slack Legacy token, risking unauthorized access to older Slack integrations and user data.",regex:"xox[os]-\\d+-\\d+-\\d+-[a-fA-F\\d]+",entropy:2,keywords:["xoxo","xoxs"]},{id:"slack-legacy-workspace-token",description:"Identified a Slack Legacy Workspace token, potentially compromising access to workspace data and legacy features.",regex:"xox[ar]-(?:\\d-)?[0-9a-zA-Z]{8,48}",entropy:2,keywords:["xoxa","xoxr"]},{id:"slack-user-token",description:"Found a Slack User token, posing a risk of unauthorized user impersonation and data access within Slack workspaces.",regex:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",entropy:2,keywords:["xoxp-","xoxe-"]},{id:"slack-webhook-url",description:"Discovered a Slack Webhook, which could lead to unauthorized message posting and data leakage in Slack channels.",regex:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}",keywords:["hooks.slack.com"]},{id:"snyk-api-token",description:"Uncovered a Snyk API token, potentially compromising software vulnerability scanning and code security.",regex:`(?i)[\\w.-]{0,50}?(?:snyk[_.-]?(?:(?:api|oauth)[_.-]?)?(?:key|token))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["snyk"]},{id:"sonar-api-token",description:"Uncovered a Sonar API token, potentially compromising software vulnerability scanning and code security.",regex:`(?i)[\\w.-]{0,50}?(?:sonar[_.-]?(login|token))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}((?:squ_|sqp_|sqa_)?[a-z0-9=_\\-]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,secretGroup:2,keywords:["sonar"]},{id:"sourcegraph-access-token",description:"Sourcegraph is a code search and navigation engine.",regex:`(?i)\\b(\\b(sgp_(?:[a-fA-F0-9]{16}|local)_[a-fA-F0-9]{40}|sgp_[a-fA-F0-9]{40}|[a-fA-F0-9]{40})\\b)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sgp_","sourcegraph"]},{id:"square-access-token",description:"Detected a Square Access Token, risking unauthorized payment processing and financial transaction exposure.",regex:`\\b((?:EAAA|sq0atp-)[\\w-]{22,60})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["sq0atp-","eaaa"]},{id:"squarespace-access-token",description:"Identified a Squarespace Access Token, which may compromise website management and content control on Squarespace.",regex:`(?i)[\\w.-]{0,50}?(?:squarespace)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["squarespace"]},{id:"stripe-access-token",description:"Found a Stripe Access Token, posing a risk to payment processing services and sensitive financial data.",regex:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:2,keywords:["sk_test","sk_live","sk_prod","rk_test","rk_live","rk_prod"]},{id:"sumologic-access-id",description:"Discovered a SumoLogic Access ID, potentially compromising log management services and data analytics integrity.",regex:`[\\w.-]{0,50}?(?i:[\\w.-]{0,50}?(?:(?-i:[Ss]umo|SUMO))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3})(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(su[a-zA-Z0-9]{12})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sumo"]},{id:"sumologic-access-token",description:"Uncovered a SumoLogic Access Token, which could lead to unauthorized access to log data and analytics insights.",regex:`(?i)[\\w.-]{0,50}?(?:(?-i:[Ss]umo|SUMO))(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3,keywords:["sumo"]},{id:"telegram-bot-api-token",description:"Detected a Telegram Bot API Token, risking unauthorized bot operations and message interception on Telegram.",regex:`(?i)[\\w.-]{0,50}?(?:telegr)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["telegr"]},{id:"travisci-access-token",description:"Identified a Travis CI Access Token, potentially compromising continuous integration services and codebase security.",regex:`(?i)[\\w.-]{0,50}?(?:travis)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{22})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["travis"]},{id:"twilio-api-key",description:"Found a Twilio API Key, posing a risk to communication services and sensitive customer interaction data.",regex:"SK[0-9a-fA-F]{32}",entropy:3,keywords:["sk"]},{id:"twitch-api-token",description:"Discovered a Twitch API token, which could compromise streaming services and account integrations.",regex:`(?i)[\\w.-]{0,50}?(?:twitch)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{30})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitch"]},{id:"twitter-access-secret",description:"Uncovered a Twitter Access Secret, potentially risking unauthorized Twitter integrations and data breaches.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{45})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"twitter-access-token",description:"Detected a Twitter Access Token, posing a risk of unauthorized account operations and social media data exposure.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([0-9]{15,25}-[a-zA-Z0-9]{20,40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"twitter-api-key",description:"Identified a Twitter API Key, which may compromise Twitter application integrations and user data security.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{25})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"twitter-api-secret",description:"Found a Twitter API Secret, risking the security of Twitter app integrations and sensitive data access.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{50})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"twitter-bearer-token",description:"Discovered a Twitter Bearer Token, potentially compromising API access and data retrieval from Twitter.",regex:`(?i)[\\w.-]{0,50}?(?:twitter)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(A{22}[a-zA-Z0-9%]{80,100})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["twitter"]},{id:"typeform-api-token",description:"Uncovered a Typeform API token, which could lead to unauthorized survey management and data collection.",regex:`(?i)[\\w.-]{0,50}?(?:typeform)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(tfp_[a-z0-9\\-_\\.=]{59})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["tfp_"]},{id:"vault-batch-token",description:"Detected a Vault Batch Token, risking unauthorized access to secret management services and sensitive data.",regex:`\\b(hvb\\.[\\w-]{138,300})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:4,keywords:["hvb."]},{id:"vault-service-token",description:"Identified a Vault Service Token, potentially compromising infrastructure security and access to sensitive credentials.",regex:`\\b((?:hvs\\.[\\w-]{90,120}|s\\.(?i:[a-z0-9]{24})))(?:[\\x60'"\\s;]|\\\\[nr]|$)`,entropy:3.5,keywords:["hvs.","s."],allowlists:[{regexes:["s\\.[A-Za-z]{24}"]}]},{id:"yandex-access-token",description:"Found a Yandex Access Token, posing a risk to Yandex service integrations and user data privacy.",regex:`(?i)[\\w.-]{0,50}?(?:yandex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["yandex"]},{id:"yandex-api-key",description:"Discovered a Yandex API Key, which could lead to unauthorized access to Yandex services and data manipulation.",regex:`(?i)[\\w.-]{0,50}?(?:yandex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(AQVN[A-Za-z0-9_\\-]{35,38})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["yandex"]},{id:"yandex-aws-access-token",description:"Uncovered a Yandex AWS Access Token, potentially compromising cloud resource access and data security on Yandex Cloud.",regex:`(?i)[\\w.-]{0,50}?(?:yandex)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}(YC[a-zA-Z0-9_\\-]{38})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["yandex"]},{id:"zendesk-secret-key",description:"Detected a Zendesk Secret Key, risking unauthorized access to customer support services and sensitive ticketing data.",regex:`(?i)[\\w.-]{0,50}?(?:zendesk)(?:[ \\t\\w.-]{0,20})[\\s'"]{0,3}(?:=|>|:{1,3}=|\\|\\||:|=>|\\?=|,)[\\x60'"\\s=]{0,5}([a-z0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,keywords:["zendesk"]}]}}});import{Buffer as Mk}from"node:buffer";function Xdi(e){return[0,1,2].flatMap(t=>{const i=Mk.concat([Mk.alloc(t),e]).toString("base64").slice(Math.ceil(8*t/6),Math.floor(8*(t+e.length)/6));return[i,i.replaceAll("+","-").replaceAll("/","_")]})}function Ydi(e){const t=JSON.stringify(e).slice(1,-1).replace(/[^\x20-\x7e]/gu,n=>`\\u${n.charCodeAt(0).toString(16).padStart(4,"0")}`);return[t,t.replace(/\\u([0-9a-f]{4})/gu,(n,i)=>`\\u${i.toUpperCase()}`)]}function Zdi(e){const t=Mk.from(e),n=encodeURIComponent(e);return[...new Set([e,`Bearer ${e}`,JSON.stringify(e).slice(1,-1),...Ydi(e),n,n.replace(/%[0-9A-F]{2}/gu,i=>i.toLowerCase()),t.toString("hex"),t.toString("hex").toUpperCase(),t.toString("base64"),t.toString("base64url"),...Xdi(t)])].filter(Boolean)}function epi(e){const t=new Map;let n=0;for(const r of e)t.set(r,(t.get(r)??0)+1),n++;let i=0;for(const r of t.values()){const o=r/n;i-=o*Math.log2(o)}return i}function LJt(e,t,n,i){const r=e.regexTarget==="match"?n:e.regexTarget==="line"?i:t,o=[];return e.regexes.length>0&&o.push(e.regexes.some(s=>s.matcher(r).find())),e.stopwords.length>0&&o.push(e.stopwords.some(s=>t.toLowerCase().includes(s.toLowerCase()))),e.paths.length>0&&o.push(!1),o.length>0&&(e.condition==="AND"?o.every(Boolean):o.some(Boolean))}function*NJt(e,t){const n=e.toLowerCase();for(const i of t.rules){if(i.regex===void 0||i.keywords.length>0&&!i.keywords.some(o=>n.includes(o)))continue;const r=i.regex.matcher(e);for(;r.find();){let o=i.secretGroup;if(o===0){for(let h=1;h<=r.groupCount();h++)if(r.group(h)){o=h;break}}const s=r.group(o)??"";if(s.length===0||i.entropy>0&&epi(s)<=i.entropy)continue;const a=r.start(),c=r.end(),u=a===0?0:e.lastIndexOf(`
|
|
1354
1354
|
`,a-1)+1,l=e.indexOf(`
|
|
1355
1355
|
`,c),d=e.slice(u,l===-1?e.length:l),p=r.group()??"";LJt(t.allowlist,s,p,d)||i.allowlists.some(h=>LJt(h,s,p,d))||(yield{start:r.start(o),end:r.end(o)})}}}async function tpi(){E9e??=Promise.resolve().then(()=>(Qdi(),MJt)).then(({configuration:t})=>GJt.parse(t),t=>{throw E9e=void 0,t});const e=await E9e;return{contains:t=>t.length>EL||!NJt(t,e).next().done,redact:t=>{if(t.length>EL)return{text:mee,status:"unavailable"};let n;for(const i of NJt(t,e))n??=new Uint8Array(t.length),n.fill(1,i.start,i.end);return n===void 0?{text:t,status:"clean"}:{text:hee(t,n),status:"redacted"}}}}function hee(e,t){const n=[];let i=0,r=0;for(;r<e.length;){if(t[r]!==1){r++;continue}for(n.push(e.slice(i,r),WJt);t[r]===1;)r++;i=r}return n.push(e.slice(i)),n.join("")}function npi(e){let t="",n=e===null,i=!1,r=!1;const o=()=>n,s=()=>(t="",n=!0,{text:mee,status:"unavailable"});return{write:async a=>{if(n||i||r||e===null||t.length+a.length>EL)return s();i=!0,t+=a;const c=new Uint8Array(t.length),u=await e.mark(t,c);if(i=!1,o())return s();let l=Math.max(0,t.length-e.holdback);if(l>0&&c[l-1]===1)for(;l>0&&c[l-1]===1;)l--;const d=hee(t.slice(0,l),c.subarray(0,l));return t=t.slice(l),{text:d,status:u&&c.subarray(0,l).includes(1)?"redacted":"clean"}},finish:async()=>{if(r)return{text:"",status:n?"unavailable":"clean"};if(n||i||e===null)return r=!0,s();r=!0;const a=new Uint8Array(t.length),c=await e.mark(t,a),u=c?hee(t,a):t;return t="",{text:u,status:c?"redacted":"clean"}}}}function $Jt(e){const t=async n=>{if(e===null||n.length>EL)return null;const i=new Uint8Array(n.length);return{marks:i,found:await e.mark(n,i)}};return{contains:async n=>(await t(n))?.found??!0,redact:async n=>{const i=await t(n);return i===null?{text:mee,status:"unavailable"}:i.found?{text:hee(n,i.marks),status:"redacted"}:{text:n,status:"clean"}},stream:()=>npi(e)}}function UJt(e){return(Mk.from(e).readUInt32LE(0)|1)>>>0}function FJt(e,t,n){let i=0;for(let r=t;r<t+cx;r++)i=Math.imul(i,n)+e.charCodeAt(r)>>>0;return i}async function BJt(e){return crypto.subtle.importKey("raw",e,{name:"HMAC",hash:"SHA-256"},!1,["sign"])}async function jJt(e,t){const n=await crypto.subtle.sign("HMAC",e,A9e.encode(t));return Mk.from(n).toString("base64url")}async function ipi(e,t){if(e.byteLength<32||!HJt(t)||t.some(a=>a.length<cx))throw new PJt("invalid_input");const n=await crypto.subtle.importKey("raw",e,"HKDF",!1,["deriveBits"]),i=new Uint8Array(await crypto.subtle.deriveBits({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(0),info:A9e.encode(qJt)},n,256)),r=await BJt(i),o=UJt(i),s=[];for(const a of new Set(t.flatMap(Zdi)))s.push([FJt(a,0,o),a.length,await jJt(r,a)]);return{version:1,key:Mk.from(i).toString("base64url"),entries:s}}async function rpi(e){const t=VJt.safeParse(e);if(!t.success)return $Jt(null);const n=Mk.from(t.data.key,"base64url"),i=await BJt(n),r=UJt(n);let o=1;for(let c=1;c<cx;c++)o=Math.imul(o,r)>>>0;const s=new Map,a=new Set;for(const[c,u,l]of t.data.entries)s.set(c,(s.get(c)??new Set).add(u)),a.add(l);return $Jt({holdback:Math.max(0,...t.data.entries.map(([,c])=>c-1)),mark:async(c,u)=>{let l=!1;if(c.length<cx||s.size===0)return l;let d=FJt(c,0,r);for(let p=0;;p++){for(const h of s.get(d)??[])p+h>c.length||a.has(await jJt(i,c.slice(p,p+h)))&&(u.fill(1,p,p+h),l=!0);if(p+cx>=c.length)return l;d=Math.imul(d-Math.imul(c.charCodeAt(p),o)|0,r)+c.charCodeAt(p+cx)>>>0}}})}var WJt,mee,EL,x9e,S9e,zJt,cx,qJt,HJt,AL,k9e,GJt,E9e,VJt,A9e,KJt=A({"../../packages/veil/dist/redaction.js"(){"use strict";OJt(),_t(),Jdi(),WJt="[REDACTED]",mee="[output withheld: redaction unavailable]",EL=64*1024*1024,x9e=1024,S9e=16*1024,zJt=1024*1024,cx=8,qJt="fungi.veil.redaction.fingerprint.v1",HJt=e=>e.length<=x9e&&e.every(t=>t.length>0&&t.length<=S9e&&t.isWellFormed())&&e.reduce((t,n)=>t+n.length,0)<=zJt,AL=E.string().transform(e=>pee.compile(e)),k9e=E.strictObject({description:E.string().optional(),regexTarget:E.enum(["secret","match","line"]).default("secret"),condition:E.enum(["OR","AND"]).default("OR"),regexes:E.array(AL).default([]),stopwords:E.array(E.string()).default([]),paths:E.array(AL).default([])}),GJt=E.strictObject({title:E.string(),minVersion:E.string(),allowlist:k9e,rules:E.array(E.strictObject({id:E.string(),description:E.string(),regex:AL.optional(),path:AL.optional(),entropy:E.number().default(0),secretGroup:E.number().int().nonnegative().default(0),keywords:E.array(E.string()).default([]),allowlists:E.array(k9e).default([])}))}),VJt=E.strictObject({version:E.literal(1),key:E.base64url().length(43),entries:E.array(E.tuple([E.number().int().nonnegative().max(4294967295),E.number().int().min(cx).max(8*S9e),E.base64url().length(43)])).max(x9e*16)}),A9e=new TextEncoder}});function opi(e,t){const n=xe(new Ne("contract","secret_in_prompt","This message contains a key or password, so it was not sent or saved. Add the key in settings instead.")),i=r=>new Ne("contract","unavailable","This message could not be checked for keys, so it was not sent or saved. Try again shortly.",void 0,r);return e.length===0?pt:Tr({try:()=>tpi(),catch:i}).pipe(Me(r=>r.contains(e)?n:t.pipe(or(i),Me(o=>o===void 0?pt:Tr({try:()=>o.contains(e),catch:i}).pipe(Me(s=>s?n:pt))))))}var spi=A({"../../packages/shiitake/dist/internal/secret-intake.js"(){"use strict";KJt(),yt(),Ei()}});function api(e,t,n){const{facts:i}=T9e(e,t,n,null);return i.cancellationRequested?"cancelling":I4(e,t).some(r=>r.inbox!==!1&&r.waitingOn===void 0)?"waiting_on_you":i.compaction!==null||i.retry!==null?"thinking":i.activeTool!==null?"running_tool":n.state==="running"&&Rli(e,t,n.jobId)?"streaming":"thinking"}function T9e(e,t,n,i){const r=Mui(e,t);if(n.state==="idle")return{facts:{queue:{state:"idle"},cancellationRequested:!1,retry:null,activeTool:null,lastModelChoiceSequence:r,compaction:null},readProgress:()=>null,toolOutput:[]};if(n.state==="queued")return{facts:{queue:{state:"queued",commandId:n.jobId,runningWork:i},cancellationRequested:n.cancellationRequested,retry:null,activeTool:null,lastModelChoiceSequence:r,compaction:null},readProgress:()=>null,toolOutput:[]};const o=bui(e,t,n.jobId),s=o?.event.type==="auto_retry_start"?{attempt:o.event.attempt,maxAttempts:o.event.maxAttempts,delayMs:o.event.delayMs,errorMessage:o.event.errorMessage,scheduledAt:o.timestamp}:null;return{facts:{queue:{state:"running",commandId:n.jobId},cancellationRequested:n.cancellationRequested,retry:s,activeTool:Sui(e,t,n.jobId)??null,lastModelChoiceSequence:r,compaction:Mli(e,t)},readProgress:()=>Cli(e,t,n.jobId),toolOutput:Tli(e,t,n.jobId)}}var JJt=A({"../../packages/shiitake/dist/internal/session-status.js"(){"use strict";Zc()}});function cpi(e,t){const n=oVt(e,{sessionId:t}),i=XZ(n);return i.length===0?null:A3(i).tokens}function QJt(e,t,n,i=!0){let r;try{r=KGt(e.store,t)}catch(l){return Rd("session-context.preference",l),be(void 0)}const o=JSON.stringify(r),s=I9e.get(e)??new Map;I9e.set(e,s);const a=i?s.get(t):void 0,c=e.model.describe;if(a?.cursor===n&&a.preference===o){if(a.value===void 0||c===void 0)return be(a.value);const l=a.value;return c({sessionId:t,preference:r}).pipe(mt(({contextWindow:d})=>{if(l.window===d)return l;const p=Object.freeze({tokens:l.tokens,window:d});return i&&s.get(t)?.cursor===n&&s.set(t,{cursor:n,preference:o,value:p}),p}),fc(d=>nt(()=>(Rd("session-context.describe",d),l))))}let u;try{u=cpi(e.store,t)}catch(l){return Rd("session-context.figure",l),be(void 0)}if(u===null)return i&&s.set(t,{cursor:n,preference:o,value:void 0}),be(void 0);if(c===void 0){const l=Object.freeze({tokens:u,window:null});return i&&s.set(t,{cursor:n,preference:o,value:l}),be(l)}return i&&s.set(t,{cursor:n,preference:o,value:Object.freeze({tokens:u,window:null})}),c({sessionId:t,preference:r}).pipe(mt(({contextWindow:l})=>l),fc(l=>nt(()=>(Rd("session-context.describe",l),null))),mt(l=>{const d=Object.freeze({tokens:u,window:l});return i&&s.get(t)?.cursor===n&&s.set(t,{cursor:n,preference:o,value:d}),d}))}var I9e,upi=A({"../../packages/shiitake/dist/internal/session-context.js"(){"use strict";yt(),oK(),u6(),Zc(),I9e=new WeakMap}});function XJt(e){return aQt(e)}function wI(e){return hQt(e)}function YJt(e){return dQt(e)}function ZJt(e){return pQt(e)}var C9e,R9e,fee,bI,gee,eQt,O9e,P9e,yee,M9e,D9e,TL,tQt,nQt,iQt,L9e,N9e,$9e,U9e,rQt,IL,oQt,sQt,aQt,F9e,cQt,lpi,uQt,lQt,dQt,pQt,hQt,dpi,ppi,hpi,mpi,fpi,gpi,mQt,ypi,vpi,_pi,vee=A({"../../packages/shiitake/dist/client-wire.js"(){"use strict";b6(),I0(),Yc(),wt(),Ei(),Hv(),k6(),Zc(),C9e=v8e.mapFields(({extensionId:e,correlation:t})=>({extensionId:e,correlation:t})),R9e=G({requestId:Ue(ie),meta:Ue(Gv),data:Ue(Sl),origin:Ue(C9e),id:ie,sequence:rt.check(Js(0)),commandId:dt(ie),value:I7e}),fee=ct(["manual","threshold","overflow"]),bI=G({queue:Et([G({state:Ce("idle")}),G({state:Ce("queued"),commandId:Td,runningWork:dt(G({phase:ct(["thinking","streaming","running_tool","waiting_on_you","cancelling"])}))}),G({state:Ce("running"),commandId:Td})]),cancellationRequested:ai,retry:dt(G({attempt:rt.check(Js(0)),maxAttempts:rt.check(Js(0)),delayMs:rt.check(zt(0)),errorMessage:ie,scheduledAt:rt.check(zt(0))})),activeTool:dt(ie),lastModelChoiceSequence:dt(rt.check(Js(0))),compaction:dt(G({trigger:fee}))}),gee=ie,eQt=Et([G({status:Ce("running"),revision:gee,value:Sl,catalog:Ue(Sl)}),G({status:Ce("stopped"),revision:gee,reason:ie})]),O9e=Vs(ie,eQt),P9e=G({id:ie,version:ie,revision:gee,status:ct(["running","stopped"]),reason:dt(ie),stoppedAt:dt(on)}),yee=G({commandId:ie,outcome:ct(["completed","cancelled","failed","interrupted"]),sequence:rt.check(Js(0)),diagnostic:dt(ie),meta:Ue(Gv)}),M9e=G({id:ie,sequence:rt.check(Js(0)),at:rt.check(zt(0)),tokensBefore:on,tokensAfter:dt(on),trigger:dt(fee)}),D9e=G({id:ie,sequence:rt.check(Js(0)),at:rt.check(zt(0)),trigger:fee,result:ct(["nothing_to_compact","failed","stale","insufficient"]),diagnostic:dt(ie)}),TL=ie.check(vn(e=>new TextEncoder().encode(e).byteLength<=65536)),tQt=G({messageId:ie,revision:rt.check(zt(0)),text:TL,thinking:TL,textOffset:rt.check(zt(0)),thinkingOffset:rt.check(zt(0)),textTruncated:ai,thinkingTruncated:ai}),nQt=G({commandId:ie,requestId:ie,meta:Ue(Gv),origin:Ue(C9e),text:ie,images:Ue(lt($ve)),delivery:ct(["steer","followUp"])}),iQt=G({toolCallId:ie,revision:rt.check(zt(0)),tail:ie.check(vn(e=>new TextEncoder().encode(e).byteLength<=8192&&e.split(`
|
|
1356
1356
|
`).length<=200)),droppedBytes:rt.check(zt(0)),totalBytes:rt.check(zt(0))}),L9e=lt(iQt).check(ft(4)),N9e=G({total:rt.check(zt(0)),prompts:lt(nQt),hasMore:ai}),$9e=G({tokens:rt.check(zt(0)),window:dt(rt.check(Js(0)))}),U9e=G({parent:Ue(Fw),sessionId:ie,cursor:dt(ie),hasMore:ai,oldestCursor:Ue(dt(ie)),messages:lt(R9e),terminals:lt(yee),sandboxFailures:Ue(lt(kZ)),compactions:Ue(lt(M9e)),compactionNotices:Ue(lt(D9e)),pending:N9e,activity:bI,progress:dt(tQt),toolOutput:L9e,extensions:O9e,attention:G1e,context:Ue($9e)}),rQt=Et([G({kind:Ce("heartbeat")}),G({kind:Ce("activity"),activity:bI}),G({kind:Ce("tool_output"),toolOutput:L9e,activity:bI}),G({kind:Ce("update"),delivery:ct(["replay","live"]),cursor:dt(ie),messages:lt(R9e),terminals:lt(yee),sandboxFailures:Ue(lt(kZ)),compactions:Ue(lt(M9e)),compactionNotices:Ue(lt(D9e)),pending:N9e,activity:bI,extensions:O9e,attention:G1e,context:Ue($9e)}),G({kind:Ce("progress"),progress:G({messageId:ie,revision:rt.check(zt(0)),text:G({offset:rt.check(zt(0)),append:TL}),thinking:G({offset:rt.check(zt(0)),append:TL})}),activity:bI}),G({kind:Ce("reset"),reason:Ce("history_unavailable"),cursor:dt(ie),baseline:U9e})]),IL=G({status:Ce("accepted"),commandId:ie,sessionId:Ue(ie)}),oQt=G({status:Ce("held"),reason:Ce("recipient_offline"),message:Ce("waiting: recipient offline")}),sQt=Et([IL,oQt]),aQt=it(ti(sQt),{onExcessProperty:"error"}),F9e=G({status:Ce("unknown")}),cQt=Et([IL,F9e]),lpi=it(ti(cQt)),uQt=Et([IL,F9e,G({status:Ce("too_late"),commandId:ie})]),lQt=G({sessionId:ie}),dQt=it(ti(U9e),{onExcessProperty:"error"}),pQt=it(ti(rQt),{onExcessProperty:"error"}),hQt=it(ti(IL)),dpi=it(ti(uQt)),ppi=it(ti(lQt)),hpi=it(ti(Dht)),mpi=it(ti(P9e)),fpi=it(ti(lt(P9e))),gpi=it(ti(Sl)),mQt=G({acceptedSender:dt(ie),delegator:dt(ie),terminal:yee,content:ie,usage:lt(G({provider:ie,model:ie,usage:kg})),toolCalls:rt.check(zt(0)),waitingOnYou:lt(G({itemId:ie,kind:ie,summary:ie})).check(ft(8))}),ypi=it(ti(G({sessions:lt(Et([G({sessionId:Td,createdAt:on,lastActivityAt:on,settledAt:Ue(on),title:ie,state:ct(["needs_you","running","errored","done"])}),G({sessionId:Td,state:Ce("unavailable")})])),next:Ht(Td)}))),vpi=it(ti(G({sessionId:Td}))),_pi=it(ti(G({deleted:ai})))}}),fQt,B9e=A({"../../packages/shiitake/dist/session-liveness.js"(){"use strict";fQt=15e3}});function gQt(e,t){return e.readQueueHead(t).pipe(Me(n=>(n.state==="queued"?e.runningWork(n.jobId):be(null)).pipe(mt(i=>({head:n,runningWork:i})))))}function wpi(e,t,n){return gQt(t,n).pipe(mt(({head:i,runningWork:r})=>T9e(e.store,n,i,r)))}function bpi(e,t){return t===void 0?e:Object.freeze({...e,context:t})}function _ee(e,t,n,i,r={}){return gQt(t,n).pipe(Me(({head:o,runningWork:s})=>(r.beforeRead?.(),Zli(e.store,n,()=>T9e(e.store,n,o,s),i,()=>t.extensions.project(n),a=>({snapshot:a,context:QJt(e,n,a.cursor,i?.before===void 0)}),e.createdBy))),Me(({snapshot:o,context:s})=>(r.afterRead?.(),s.pipe(mt(a=>bpi(o,a))))))}function xpi(e,t){return kt({try:()=>Object.freeze({sessionId:zr(e),options:oSn(t)}),catch:n=>n instanceof Ne?n:new Ne("contract","invalid","Subscribe options are invalid")})}function j9e(e,t,n,i=!1,r={}){return t.assertOpen.pipe(gt(_ee(e,t,n,{includeSandboxFailures:i},r)),mt(o=>Object.freeze({kind:"reset",reason:"history_unavailable",cursor:o.cursor,baseline:o})))}function Spi(e){return[[e],Lt({after:e.cursor??void 0,delivery:e.baseline.hasMore?"replay":"live",awaitSignal:!e.baseline.hasMore})]}function yQt(e,t,n,i,r,o=!1){const s=r.kind==="live"?r.registration:void 0;let a=r.kind==="live"?gL(r.progress):null,c=[];const u=()=>j9e(e,t,n,o,r.kind==="replay"?{beforeRead:r.checkpoint}:{afterRead:r.stamp}).pipe(mt(p=>(a=gL(p.baseline.progress),c=p.baseline.toolOutput,r.kind==="replay"?[[p],$t()]:Spi(p)))),l=p=>{const h=p.facts.queue,m=h.state!=="running"?null:Ali(e.store,n,h.commandId,a);if(m===void 0)return;const f=[];return m!==null&&(f.push({kind:"progress",progress:m,activity:p.facts}),a={messageId:m.messageId,revision:m.revision,text:m.text.offset+m.text.append.length,thinking:m.thinking.offset+m.thinking.append.length}),(c.length!==p.toolOutput.length||c.some((g,y)=>g!==p.toolOutput[y]))&&(c=p.toolOutput,f.push({kind:"tool_output",toolOutput:c,activity:p.facts})),f},d={after:i,delivery:r.kind,awaitSignal:r.kind==="live"};return Uwe(d,p=>(s===void 0?be(void 0):p.awaitSignal?s.awaitSignal.pipe(Me(h=>s.pollSignal.pipe(mt(m=>m===void 0?h:uSn(h,m))))):s.pollSignal).pipe(Me(h=>h==="closed"?be([[],$t()]):h==="reset"?u():t.assertOpen.pipe(gt(wpi(e,t,n)),Me(m=>{if(r.kind==="replay"&&r.checkpoint(),s?.setQueued(m.facts.queue.state==="queued"),(h==="progress"||h==="activity")&&p.delivery==="live"){const f=l(m);return f===void 0?u():(r.kind==="live"&&r.stamp(),be([[...h==="activity"?[{kind:"activity",activity:m.facts}]:[],...f],Lt({...p,awaitSignal:!0})]))}return odi(e.store,n,p.after,p.delivery,m,()=>t.extensions.project(n),o,f=>{const g=f.kind==="page"?f.frames.flatMap(v=>v.kind==="progress"||v.kind==="activity"||v.kind==="tool_output"||v.kind==="heartbeat"?[]:[v.cursor]).at(-1):void 0,y=f.kind==="page"&&!f.hasMore&&f.frames.some(v=>v.kind==="update"&&v.cursor!==p.after)?QJt(e,n,g??null):be(void 0);return{page:f,latestCursor:g,context:y}}).pipe(Me(({page:f,latestCursor:g,context:y})=>{if(f.kind==="reset")return u();r.kind==="live"&&r.stamp(),f.hasMore||(c=m.toolOutput);const v=f.hasMore?[]:l(m);if(v===void 0)return u();const _={after:g??p.after,delivery:f.hasMore?p.delivery:"live",awaitSignal:!f.hasMore};return y.pipe(mt(x=>[[...x===void 0?f.frames:f.frames.map(w=>w.kind==="update"&&w.cursor===g?Object.freeze({...w,context:x}):w),...v],r.kind==="replay"&&!f.hasMore?$t():Lt(_)]))}))})))))}function kpi(e,t,n,i){const r=new Map,o=rA();let s=0;const a=(c,u)=>Ut(()=>{let l=r.get(c);l===void 0&&(l={lock:AH(1),feed:void 0},r.set(c,l));const d=l;return d.lock.withPermit(Rp(p=>je(function*(){if(r.get(c)!==d)return yield*a(c,u);let h=d.feed;if(h===void 0){const f=yield*n.register(c).pipe(Lu(()=>nt(()=>{r.get(c)===d&&r.delete(c)}))),g={stopped:!1},y=aSn(()=>{v()}),v=()=>{g.stopped||(g.stopped=!0,f.close(),g.producer?.interruptUnsafe(),g.heartbeat?.interruptUnsafe(),y.end(),d.feed=void 0,r.get(c)===d&&r.delete(c))};h={registration:f,frames:y,stop:v},d.feed=h;const _=yield*p(_ee(e,t,c,{includeSandboxFailures:!0})).pipe(Lu(()=>nt(v)));f.setQueued(_.activity.queue.state==="queued");let x=f.revision;g.producer=yield*Af(yQt(e,t,c,_.cursor??void 0,{kind:"live",registration:f,progress:_.progress,stamp:()=>{x=f.revision}},!0).pipe(QH(w=>nt(()=>{y.publish(w,x)})),fc(w=>nt(()=>{y.end(w)})),du(nt(v))),o,{uninterruptible:!1}).pipe(BW(i)),g.stopped||(g.heartbeat=yield*Af(Mwe(zh(fQt).pipe(mi({kind:"heartbeat"}))).pipe(QH(w=>nt(()=>{y.publish(w)}))),o,{uninterruptible:!1}).pipe(BW(i)))}const m=h.frames.register(u);return{feed:h,queue:m}})))});return{acquire:(c,u)=>Rp(l=>Ut(()=>{if(s>=64)return xe(new Ne("runtime","rejected","Observation capacity is exhausted"));s+=1;let d=!1;const p=()=>{d||(d=!0,s-=1)};return l(a(c,u)).pipe(mt(({feed:h,queue:m})=>({feed:h,queue:Object.freeze({...m,close:()=>{p(),m.close()}})})),Lu(()=>nt(p)))})),close:nt(()=>{for(const c of r.values())c.feed?.stop();r.clear()}).pipe(gt(Ro(o,Hs)))}}function vQt(e){return Uwe(null,()=>e.take.pipe(mt(t=>t==="closed"?[[],$t()]:[[t],Lt(null)])))}function _Qt(e,t,n,i){let r=t,o=gL(n);return e.pipe(j6(s=>je(function*(){let a=s==="reset"?yield*i():s;if(a.kind==="heartbeat")return[a];if(a.kind==="progress"){const m=o?.messageId===a.progress.messageId?o:null;if(m!==null&&m.revision>=a.progress.revision)return[];const f=m?.text??0,g=m?.thinking??0;a.progress.text.offset>f||a.progress.thinking.offset>g?a=yield*i():o={messageId:a.progress.messageId,revision:a.progress.revision,text:a.progress.text.offset+a.progress.text.append.length,thinking:a.progress.thinking.offset+a.progress.thinking.append.length}}if(a.kind==="reset")return r=a.cursor,o=gL(a.baseline.progress),[a];if(a.kind!=="update")return[a];const c=r===null?void 0:$9(r),u=a.cursor===null?void 0:$9(a.cursor);if(c!==void 0&&u!==void 0&&c.generation!==u.generation){const m=yield*i();return r=m.cursor,o=gL(m.baseline.progress),[m]}const l=c?.sequence??0,d=u!==void 0&&u.sequence>l?a.cursor:r,p=m=>m?.some(f=>f.sequence<=l)===!0;if(d===a.cursor&&!p(a.messages)&&!p(a.terminals)&&!a.compactions?.some(m=>cKt(m)<=l)&&!p(a.compactionNotices))return r=a.cursor,[a];const h={...a,cursor:d,messages:a.messages.filter(m=>m.sequence>l),terminals:a.terminals.filter(m=>m.sequence>l)};return a.compactions!==void 0&&(h.compactions=a.compactions.filter(m=>cKt(m)>l)),a.compactionNotices!==void 0&&(h.compactionNotices=a.compactionNotices.filter(m=>m.sequence>l)),r=h.cursor,[h]})),Nvt)}function Epi(e,t,n,i,r){return Yv(t.assertOpen.pipe(gt(xpi(i,r)),Me(o=>yl(n.acquire(o.sessionId,o.options.includeSandboxFailures===!0),({queue:s})=>nt(s.close)).pipe(mt(({feed:s,queue:a})=>{const c=()=>{a.checkpoint(s.registration.revision)};return _Qt(yQt(e,t,o.sessionId,o.options.after,{kind:"replay",checkpoint:c},o.options.includeSandboxFailures===!0).pipe(KH(vQt(a))),o.options.after??null,null,()=>j9e(e,t,o.sessionId,o.options.includeSandboxFailures===!0,{beforeRead:c}))})))))}function Api(e,t){return kt({try:()=>Object.freeze({sessionId:zr(e),options:Lht(t)}),catch:n=>n instanceof Ne?n:new Ne("contract","invalid","Watch options are invalid")})}function Tpi(e,t,n,i,r){return t.assertOpen.pipe(gt(Api(i,r)),Me(o=>Rp(s=>je(function*(){const{feed:a,queue:c}=yield*n.acquire(o.sessionId,o.options.includeSandboxFailures===!0),u=()=>{c.checkpoint(a.registration.revision)};return yield*s(t.assertOpen.pipe(gt(_ee(e,t,o.sessionId,o.options,{beforeRead:u})),mt(l=>Object.freeze({snapshot:l,changes:_Qt(vQt(c),l.cursor,l.progress,()=>j9e(e,t,o.sessionId,o.options.includeSandboxFailures===!0,{beforeRead:u})).pipe(zvt(nt(c.close))),close:nt(c.close)})))).pipe(Lu(()=>nt(c.close)))}))))}function wee(e,t,n){return z7e(e,t,{encode:i=>JSON.stringify(i),decode:n})}function Ipi(e,t,n,i){const r=kpi(e,t,n,i),o=e.store,s=rL(o);return Object.freeze({read:(a,c)=>s.pipe(gt(_ee(e,t,a,c)),Me(u=>wee(o,u,YJt))),subscribe:(a,c)=>Yv(s.pipe(mi(Epi(e,t,r,a,c).pipe(j6(u=>wee(o,u,ZJt)))))),watch:(a,c)=>s.pipe(gt(Tpi(e,t,r,a,c)),Me(u=>wee(o,u.snapshot,YJt).pipe(mt(l=>Object.freeze({...u,snapshot:l,changes:u.changes.pipe(j6(d=>wee(o,d,ZJt)))})),Lu(()=>u.close.pipe(Cv))))),close:r.close})}var Cpi=A({"../../packages/shiitake/dist/internal/session-observation.js"(){"use strict";yt(),ri(),zu(),M4(),Sp(),Jr(),Ei(),I0(),jf(),JJt(),upi(),Eg(),vee(),Zc(),B9e()}});function Rpi(e){return Object.freeze({list:e.assertOpen.pipe(mt(()=>e.extensions.list())),resume:t=>e.assertOpen.pipe(gt(e.extensions.resume(t))),call:(t,n,i)=>e.assertOpen.pipe(gt(e.extensions.call({scope:"agent"},t,n,i)))})}function Dk(e,t,n){return e.assertOpen.pipe(gt(kt({try:()=>n(zr(t)),catch:i=>i instanceof Ne?i:new Ne("store","rejected","Session owner operation failed")})))}function Opi(e,t){return kt({try:()=>{const n=omt(t);if(n._tag==="Failure")throw new Ne("contract","invalid","Session command is invalid");return Object.freeze({sessionId:zr(e),command:n.success})},catch:n=>n instanceof Ne?n:new Ne("contract","invalid","Session command is invalid")})}function W9e(e,t,n,i,r,o){let s={sessionId:t,command:n,when:"now",origin:{kind:"user"}};return i!==void 0&&(s={...s,meta:i}),r!==void 0&&(s={...s,mail:r}),o!==void 0&&(s={...s,reply:o}),e.assertOpen.pipe(gt(e.door.admit(s)),Me(a=>a.status==="accepted"?be({status:"accepted",commandId:a.commandId}):xe(new Ne("runtime","unavailable","Session command was not admitted"))))}function Ppi(e,t,n,i,r){return t.assertOpen.pipe(gt(Dk(t,n,o=>{e.meta?.identityPath!==void 0&&r!==void 0&&mui(e.store,o,i.commandId,d8e(e.store,e.meta.identityPath,r))})),gt(jli(e.store,n,i.commandId,i.onlyIfPending,()=>t.readQueueHeadTransactional(n),t.recordAcceptedCancellation,r)),Me(o=>o===void 0?be({status:"too_late",commandId:i.commandId}):(o.active?t.signalCancellation(o.accepted.commandId,o.accepted.entryId):t.requestWake).pipe(mi({status:"accepted",commandId:o.accepted.commandId}))))}function Mpi(e,t,n,i){return t.assertOpen.pipe(gt(t.commit(qli(e.store,n,()=>t.readQueueHeadTransactional(n),t.recordAcceptedCancellation,i))),Me(r=>r===void 0?t.requestWake:t.signalCancellation(r.commandId,r.entryId)))}function Dpi(e,t,n,i){return t.assertOpen.pipe(gt(Hli(e.store,{sessionId:n,type:"branch",entryId:i.entryId,assertIdleSession:t.assertIdleSession})),mi(void 0))}function Lpi(e,t,n,i){return t.assertOpen.pipe(gt(Vli(e.store,{sessionId:n,type:"fork",entryId:i.entryId,assertIdleSession:t.assertIdleSession})))}function Npi(e,t,n,i,r){const o=s=>s===void 0||s.length===0?pt:opi(s,rL(e.store));return t.assertOpen.pipe(gt(Opi(n,r)),Me(s=>$pi(e,i).pipe(mt(a=>({...s,checked:a})))),Me(({sessionId:s,command:a,checked:c})=>{switch(a.type){case"prompt":return o(a.text).pipe(gt(W9e(t,s,a,c)));case"compact":return o(a.instructions).pipe(gt(W9e(t,s,a,c)));case"abort":return Mpi(e,t,s,c).pipe(mi(void 0));case"cancel":return Ppi(e,t,s,a,c);case"branch":return Dpi(e,t,s,a);case"fork":return Lpi(e,t,s,a);case"operator":return o(a.text).pipe(gt(t.assertOpen),gt(Gli(e.store,{sessionId:s,requestId:a.requestId,author:a.author,meta:c,text:a.text,assertIdleSession:t.assertIdleSession})),mi(void 0));case"title":return t.commit(Dk(t,s,u=>{Lui(e.store,u,a.title)})).pipe(hs(()=>nt(()=>{o1e(e.store)})),mi(void 0))}}))}function $pi(e,t){return kt({try:()=>t===void 0?void 0:lH(e.meta,t),catch:n=>n instanceof Ne?n:new Ne("contract","invalid","Host metadata is invalid")})}function Upi(e,t,n){const i=dSn(e.store),r=Ipi(e,t,i,n),o=(a,c)=>{function u(l){return Npi(e,t,a,c,l)}return Object.freeze({command:u,withdraw:l=>t.assertOpen.pipe(gt(t.door.withdraw(a,l))),abort:u({type:"abort"}),send:(l,d)=>nt(()=>d?.requestId??Od()).pipe(Me(p=>{const h={type:"prompt",delivery:d?.delivery??"steer",requestId:p,text:l};return u(d?.images===void 0?h:{...h,images:d.images}).pipe(or(m=>m.requestId===p?m:new Ne(m.boundary,m.cause,m.message,p)))})),cancel:l=>u({type:"cancel",...l}),latestPending:Dk(t,a,l=>vli(e.store,l,e.meta?.identityPath===void 0||c===void 0?void 0:d8e(e.store,e.meta.identityPath,c))),modelPreference:Object.freeze({read:Dk(t,a,l=>KGt(e.store,l)),set:l=>kt({try:()=>xk(l),catch:()=>new Ne("contract","invalid","Model preference is invalid")}).pipe(Me(d=>t.commit(Dk(t,a,p=>(Dui(e.store,p,d),p))).pipe(hs(p=>nt(()=>{_o(e.store,p)})),Ef)))}),extension:l=>Object.freeze({call:(d,p,h)=>t.assertOpen.pipe(gt(t.extensions.call({scope:"session",sessionId:a},l,d,p,h)))}),read:l=>t.assertOpen.pipe(gt(r.read(a,l))),readSettlement:(l,d=0)=>Rv(je(function*(){yield*t.assertOpen;const p=yield*kt({try:()=>({sessionId:zr(a),...d9(jht({commandId:l,timeoutMs:d}),"Settlement request is invalid")}),catch:g=>g instanceof Ne?g:new Ne("contract","invalid","Settlement request is invalid")}),h=yield*yl(i.register(p.sessionId,"settlement"),g=>nt(g.close)),m=MKt(e.store,p.sessionId,p.commandId),f=yield*m;return f!==void 0||p.timeoutMs===0?f:yield*je(function*(){for(;;){if((yield*h.awaitSignal)==="closed")return yield*xe(new Ne("runtime","closed","Shiitake is closed"));const y=yield*m;if(y!==void 0)return y}}).pipe(dA(p.timeoutMs),mt(sa))})),subscribe:l=>r.subscribe(a,l),watch:l=>r.watch(a,l)})},s=Object.freeze({createSession:a=>t.assertOpen.pipe(gt(edi(e.store,a,t.storage.admitNew))),deleteSession:a=>t.assertOpen.pipe(gt(ndi(e.store,{sessionId:a,assertIdleSession:t.assertIdleSession}))),listSessions:a=>t.assertOpen.pipe(gt(rdi(e.store,a))),extensions:Rpi(t),session:a=>o(a,void 0),close:t.beginClose.pipe(gt(r.close),gt(i.close))});return Object.freeze({...s,prepareConfiguration:t.prepareConfiguration,grants:Object.freeze({deliver:(a,c)=>Dk(t,a,u=>e.store.transactionSync(()=>JHt(e.store,u,c))),read:a=>Dk(t,a,c=>XHt(e.store,c))}),withMeta:a=>Object.freeze({...s,session:c=>o(c,a)})})}function Fpi(e){const t=y9.safeParse(e.meta);return t.success&&t.data.delegation?.steer===!0}function Bpi(e,t,n,i,r,o){if(t.to.sessionId===void 0){if(i!==void 0||t.replyTo.length===0)throw new Error("Only delegated work can create a recipient Session");return e.door.transact(s=>{const a=e.createSessionWithinTransaction(t.key),c=o?.(a);c!==void 0&&e.stageSessionGrantsWithinTransaction(a,c);const u={...t,to:{...t.to,sessionId:a}},l={sessionId:a,requireExistingSession:!0,command:{requestId:t.key,delivery:"followUp",type:"prompt",text:t.content},when:"now",origin:{kind:"user"},mail:u,onAccepted:(p,h)=>{if(r===void 0)throw new Error("Recipient Agent mail outbox is unavailable");r(zkn(t,a,h,Date.now()))}},d=s(n===void 0?l:{...l,meta:n});if(d.status!=="accepted")throw new Error("Sessionless addressed mail was not admitted");return e.recordCreatedSessionDelegatorWithinTransaction(a,u),{status:"accepted",commandId:d.commandId,sessionId:a}})}return W9e(e,t.to.sessionId,{requestId:t.key,delivery:i!==void 0||Fpi(t)?"steer":"followUp",type:"prompt",text:t.content},n,t,i)}var jpi=A({"../../packages/shiitake/dist/internal/coordinator.js"(){"use strict";ba(),eL(),qv(),M9(),yt(),ri(),Ei(),I0(),spi(),jf(),Cpi(),Eg(),k6(),Zc()}}),CL,z9e,Hl,wQt,bQt,xI=A({"../../packages/shiitake/dist/extension-contract.js"(){"use strict";wt(),CL=ie.pipe(Ze(rn(1)),Ze(ft(128)),Ze(Ks(/^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$/u))),z9e=ie.pipe(Ze(rn(1)),Ze(ft(64)),Ze(Ks(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u))),Hl=CL.pipe(G8("ExtensionId")),wQt=ie.pipe(Ze(Ks(/^sha256:[0-9a-f]{64}$/u)),G8("ExtensionRevision")),bQt=ie.pipe(Ze(Ks(/^sha256:[0-9a-f]{64}$/u)),G8("ExtensionFingerprint"))}});function RL(e){return Ut(()=>{const t=e();return Wh(t)?t:Tr({try:()=>Promise.resolve(t),catch:n=>new xQt({cause:n})})})}function SI(e,t){const n=e(t);if(n instanceof Promise||Wh(n)&&!c0(n))throw new bee;return n}function q9e(e){return Ut(()=>{const t=e();if(t instanceof Promise)throw new bee;return c0(t)?be(t):Wh(t)?t:be(t)})}var xQt,bee,OL=A({"../../packages/shiitake/dist/internal/extension-hook.js"(){"use strict";Uh(),yt(),ri(),xQt=class extends Wo("ExtensionHookError"){},bee=class extends Error{constructor(){super("Extension transaction handler must return synchronously"),this.name="AsyncExtensionTransactionError"}}}});function Wpi(e,t){const n=SQt[e.scope],i=Tt(n),r=Tt(e.input,{onExcessProperty:"error"}),o=s=>s.pipe(Me(a=>Nye(e.output)(a).pipe(Me(Sd(Sl)),gl)));return s=>Fc(i(s.sessionId),a=>$h(r(s.input),c=>{const u=s.caller===void 0?{sessionId:a,input:c}:{sessionId:a,input:c,caller:s.caller};return"prepare"in t?Ut(()=>t.prepare(u)).pipe(mt(o)):be(o(q9e(()=>t(u))))}))}function zpi(e,t){const n=new Map;for(const i of Object.keys(t)){const r=e[i],o=t[i];r===void 0||o===void 0||n.set(i,Wpi(r,o))}return n}var SQt,qpi=A({"../../packages/shiitake/dist/internal/extension-command-registry.js"(){"use strict";yt(),ki(),wt(),OL(),Hv(),SQt={agent:Ed,session:ie}}}),kQt,Hpi=A({"../../packages/mycelium/dist/define.js"(){"use strict";Gwe(),kQt=Object.freeze({module:zwe,operation:l1t,gate:f1t})}});function Gpi(e,t,n,i,r){return Object.freeze({tool:(o,s)=>{const a=e?.[o];if(a===void 0)throw new Error(`Extension declares no command named ${o}`);const c=GA(a.input),u=Sd(a.output);return kQt.operation({description:s.description,replay:"unsafe",input:a.input,output:a.output,execute:d=>Bc(je(function*(){if(!r)return yield*xe(new Ne("extensions","unavailable","Extension is unavailable"));const p=t().get(o);if(p===void 0)return yield*kf(new Error(`Command ${o} has no handler`));const h=yield*c(d).pipe(Me(EQt)),m=p({sessionId:a.scope==="session"?i.sessionId:null,input:h});if(Sn(m))return yield*xe(m.failure);const f=yield*n({prepare:m.success});return yield*u(f)}))})}})}var EQt,Vpi=A({"../../packages/shiitake/dist/internal/extension-command-tools.js"(){"use strict";Hpi(),yt(),ki(),wt(),Ei(),Hv(),EQt=Sd(Sl)}});function AQt(e){const t=new WeakMap;for(const[n,i]of Object.entries(e))t.set(i,n);return p4(e,va(n=>{const i=t.get(n);if(i===void 0)throw new Error("Extension handle factory is not registered");return n(i)}))}function Kpi(e,t){const n=p4(e,va(a=>c=>a.bind(t,c))),i=AQt(n),r=p4(i,va(a=>a.read)),o=Object.freeze({...p4(i,va(a=>a.update)),observe:t.observeUpdate}),s=Object.freeze(p4(i,va(a=>Object.freeze({get:a.update.get,page:a.update.page}))));return Object.freeze({...r,update:a=>t.update(()=>SI(a,o)),read:a=>t.update(()=>SI(a,s))})}function Jpi(e,t){return Object.freeze(AQt(p4(e,va(n=>i=>t.document(i,n)))))}var Qpi=A({"../../packages/shiitake/dist/internal/extension-context.js"(){"use strict";L8(),OL()}});function Xpi(e){return e[xee]?.()}var xee,TQt=A({"../../packages/shiitake/dist/internal/extension-definitions.js"(){"use strict";xee=Symbol.for("@fungi.computer/shiitake/extension-definition-reader")}});function Ypi(e){return CQt(e)}function IQt(e){const t=Object.keys(e);return t.includes("collections")&&t.every(n=>V9e.has(n))}function Ig(e){const t=MQt(e)?{id:e}:e;return RQt.fromIdentity({id:OQt(t.id),version:PQt(t.version??"0.0.0")})}function Zpi(e,t){if(t.projection?.catalog!==void 0&&t.catalog===void 0)throw new Error("A projected catalog requires an advertised catalog");const n=[];t.attention===!0&&n.push("attention"),(e.declaresState||e.declaresDocuments)&&n.push("state"),t.hooks?.onSettled!==void 0&&n.push("settled","send"),t.commands!==void 0&&n.push("commands","send"),(t.hooks?.onTimer!==void 0||t.timers===!0)&&n.push("timers","send"),t.projection!==void 0&&n.push("projection"),t.tools!==void 0&&n.push("run_tools"),t.files!==void 0&&n.push("files"),t.prompt!==void 0&&n.push("prompt"),t.compaction!==void 0&&n.push("compaction_handoff");const i={protocol:"shiitake.extension/v0",id:e.id,version:e.version,requests:[...new Set(n)]},r={id:e.id,commands:t.commands?.specs??{},projection:t.projection===void 0?null:{schema:t.projection.schema}},{hooks:o,commands:s,projection:a,prompt:c,tools:u,files:l,compaction:d}=t,p=o?.onSettled,h=o?.onTimer,m={manifest:i,contract:r,config:e.config,state:e.state,activate:y=>{const v=Object.freeze({...y.context,config:e.config,state:Kpi(e.state.collections,y),documents:Jpi(e.documents,y)});return je(function*(){o?.start!==void 0&&(yield*RL(()=>o.start?.(v)));const _=s===void 0?new Map:zpi(s.specs,s.handlers(v)),x={commands:_};p!==void 0&&Object.assign(x,{onSettled:b=>q9e(()=>p(v,b))}),h!==void 0&&Object.assign(x,{onTimer:b=>"prepare"in h?Ut(()=>h.prepare(v,b)):be(q9e(()=>h(v,b)))}),u!==void 0&&Object.assign(x,{moduleForRun:b=>RL(()=>u(v,b,Gpi(s?.specs,()=>_,v.transact,b,v.grants.includes("commands")))).pipe(mt(S=>c0(S)?S:Lh(S)))}),l!==void 0&&Object.assign(x,{filesForRun:b=>RL(()=>l(v,b)).pipe(mt(S=>c0(S)?S:Lh(S)))}),c!==void 0&&Object.assign(x,{prompt:b=>c(v,b)}),a!==void 0&&Object.assign(x,{project:b=>{const S=SI(()=>a.read(v,b),void 0);return c0(S)?S:E2(S)}});const w=a?.catalog;if(a!==void 0&&w!==void 0&&Object.assign(x,{projectCatalog:b=>w(it(a.schema)(b))}),d!==void 0){const b=d(v);Object.assign(x,{compactionHandoff:{consume:S=>RL(()=>b.consume(S))}})}return x})}};e.declaresDocuments&&Object.assign(m,{documents:e.documents}),t.catalog!==void 0&&Object.assign(m,{catalog:t.catalog});const f=CTe(),g=Object.assign(f({manifest:i,[xee]:()=>m}),{contract:r});return Object.defineProperty(g,xee,{enumerable:!1}),Object.freeze(g)}function Cg(e,t){const n={schema:e,...t,bind:(i,r)=>({read:i.collection(r,n),update:i.updateCollection(r,n)}),indexFromEncoded:i=>$h(Tt(e)(i),r=>n.index?.(r)??null)};return Object.defineProperty(n,G9e,{value:!0}),Object.freeze(n)}var CQt,kI,H9e,ux,PL,Ua,Ty,ehi,G9e,V9e,RQt,OQt,PQt,MQt,Fs=A({"../../packages/shiitake/dist/extensions.js"(){"use strict";b6(),RTe(),Ts(),Uh(),yt(),ri(),ki(),wt(),xI(),xI(),xI(),qpi(),Vpi(),Qpi(),TQt(),OL(),OL(),Hv(),CQt=it(ti(Sl)),kI=class extends Ou()("@fungi.computer/shiitake/ExtensionRead"){},H9e=class extends Ou()("@fungi.computer/shiitake/ExtensionTx"){},ux=class extends Wo("ExtensionStateError"){},PL=class extends Wo("AdmissionError"){},Ua=class extends Wo("ExtensionCommandError"){},Ty=class extends Wo("ExtensionStop"){},ehi=class extends Wo("ExtensionActivationError"){},G9e=Symbol.for("@fungi.computer/shiitake/collection"),V9e=new Set(["version","collections","migrations"]),RQt=class cU{metadata;constructor(t){this.metadata=t}static fromIdentity(t){return new cU({...t,config:{},state:{version:1,collections:{},migrations:{}},documents:{},declaresState:!1,declaresDocuments:!1})}config(t){return new cU({...this.metadata,config:t})}state(t){const n=IQt(t)?t:{collections:t};if(IQt(t)?!Object.values(t.collections).every(i=>G9e in i):Object.keys(t).some(i=>V9e.has(i)))throw new Error("A collection named collections, version or migrations needs the full state declaration");return new cU({...this.metadata,state:{version:n.version??1,collections:n.collections,migrations:n.migrations??{}},declaresState:!0})}documents(t){return new cU({...this.metadata,documents:t,declaresDocuments:!0})}define(t){return Zpi(this.metadata,t)}},OQt=it(Hl),PQt=it(z9e),MQt=Uf(ie)}});function See(e,t){const n=Iq(e.schema)(t);if(n._tag==="Failure")throw new ux({reason:"encode",message:"Session document does not match its schema"});const i=Tt(Sl)(n.success);if(i._tag==="Failure")throw new ux({reason:"encode",message:"Session document must encode finite JSON"});const r=JSON.stringify(i.success);if(new TextEncoder().encode(r).byteLength>e.maxBytes)throw new ux({reason:"bound",message:"Session document exceeds maxBytes"});return r}function DQt(e){return{...it(LQt)(e),schema:pD(ZA(e.schema)),initial:See(e,e.initial)}}var LQt,NQt=A({"../../packages/shiitake/dist/internal/document-codec.js"(){"use strict";wt(),nIe(),Fs(),Hv(),LQt=G({fork:ct(["inherit-at-fork-point","current","fresh"]),maxBytes:rt.pipe(Ze(Js(0)),Ze(Da(Number.MAX_SAFE_INTEGER)))})}});function Gl(e){return new Ne("extensions","invalid",e)}function kee(e){return new Set(e).size!==e.length}function K9e(e){return JSON.stringify(e,(t,n)=>pd(n)?Object.fromEntries(Object.entries(n).sort(([i],[r])=>i<r?-1:i>r?1:0)):n)}function J9e(e){return Tr({try:async()=>{const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return Array.from(new Uint8Array(t),n=>n.toString(16).padStart(2,"0")).join("")},catch:()=>new Ne("extensions","rejected","Extension digest failed")})}function thi(e,t){const{manifest:n,contract:i,state:r,config:o,catalog:s}=e,a={manifest:{protocol:n.protocol,id:n.id,version:n.version,requests:[...n.requests].sort()},commands:Object.fromEntries(Object.entries(i.commands).map(([u,l])=>[u,{scope:l.scope,input:pD(ZA(l.input)),output:pD(ZA(l.output))}])),projection:i.projection===null?null:pD(ZA(i.projection.schema)),state:{version:r.version,collections:Object.fromEntries(Object.entries(r.collections).map(([u,l])=>[u,pD(ZA(l.schema))]))},config:o},c=Object.keys(t).length===0?a:{...a,documents:Object.fromEntries(Object.entries(t).map(([u,l])=>[u,DQt(l)]))};return s===void 0?c:{...c,catalog:s}}function nhi(e){if(zQt(e.manifest)._tag==="Failure")throw Gl("Extension manifest is invalid");const n=e.manifest;if(kee(n.requests))throw Gl("Extension capability requests are invalid");if(e.contract.id!==n.id)throw Gl("Extension contract identity does not match its manifest");if(!Number.isSafeInteger(e.state.version)||e.state.version<1)throw Gl("Extension state version is invalid");for(const i of Object.keys(e.state.collections))if(i==="update"||i==="read"||i==="observe"||Y9e(i)._tag==="Failure")throw Gl("Extension collection name is invalid");if(e.catalog!==void 0&&!n.requests.includes("commands"))throw Gl("An extension catalog requires the commands capability");return n}function $Qt(e){return je(function*(){const t=e?.roster??[],n=e?.grants??[],i=yield*kt({try:()=>{if(t.length>Q9e)throw Gl("Extension roster is invalid");const r=t.map(l=>{const d=Xpi(l);if(d===void 0)throw Gl("Extension roster entry was not defined");const p=d.documents??{};for(const[m,f]of Object.entries(p)){if(Y9e(m)._tag==="Failure")throw Gl("Session document name is invalid");DQt(f)}const h=nhi(d);if(Object.keys(p).length>0&&!h.requests.includes("state"))throw Gl("Session documents require the state capability");return{definition:d,documents:p,manifest:h}}),o=r.map(({manifest:l})=>l.id);if(kee(o))throw new Ne("extensions","conflict","Extension identities conflict");const s=qQt(n);if(s._tag==="Failure")throw Gl("Extension grants are invalid");if(kee(s.success.map(({id:l})=>l)))throw Gl("Extension grant identities are invalid");const a=new Map;for(const l of s.success){const d=r.find(({manifest:p})=>p.id===l.id);if(d===void 0||kee(l.capabilities)||l.capabilities.some(p=>!d.manifest.requests.includes(p)))throw Gl("Extension grant is invalid");a.set(l.id,l.capabilities)}if(r.filter(({manifest:l})=>a.get(l.id)?.includes("compaction_handoff")).length>1)throw new Ne("extensions","conflict","Compaction handoff slot is already owned");if(r.filter(({manifest:l})=>a.get(l.id)?.includes("files")).length>1)throw new Ne("extensions","conflict","Files slot is already owned");return r.map(l=>({...l,grants:a.get(l.manifest.id)??[]})).sort((l,d)=>l.manifest.id<d.manifest.id?-1:l.manifest.id>d.manifest.id?1:0)},catch:r=>r instanceof Ne?r:Gl("Extension roster is invalid")});return yield*lo(i,r=>je(function*(){const o=yield*kt({try:()=>K9e(thi(r.definition,r.documents)),catch:()=>Gl("Extension schemas cannot be described")}),s=`sha256:${yield*J9e(o)}`,a=[...r.grants].sort(),c=`sha256:${yield*J9e(K9e([s,a]))}`;return Object.freeze({id:r.manifest.id,manifest:r.manifest,definition:r.definition,documents:r.documents,grants:new Set(a),revision:it(wQt)(s),fingerprint:it(bQt)(c)})}))})}function UQt(e){return J9e(K9e({protocol:"shiitake.extension/v0",runContract:1,fileTools:[...e].sort()}))}var Q9e,FQt,X9e,BQt,jQt,WQt,zQt,qQt,Y9e,Z9e=A({"../../packages/shiitake/dist/internal/extension-roster.js"(){"use strict";NQt(),yt(),Xn(),wt(),nIe(),Ei(),TQt(),xI(),Q9e=64,FQt=ct(["state","attention","settled","send","timers","commands","projection","run_tools","files","prompt","compaction_handoff"]),X9e=lt(FQt).pipe(Ze(ft(10))),BQt=G({protocol:Ce("shiitake.extension/v0"),id:CL,version:z9e,requests:X9e}),jQt=lt(G({id:CL,capabilities:X9e,grantKey:Ue(CL)})).pipe(Ze(ft(Q9e))),WQt=ie.pipe(Ze(Ks(/^[a-z][A-Za-z0-9_]{0,63}$/u))),zQt=Tt(BQt,{onExcessProperty:"error"}),qQt=Tt(jQt,{onExcessProperty:"error"}),Y9e=Tt(WQt)}});function ihi(e){return new Ne("model","rejected",e)}function rhi(e,t){const n={input:e.input+t.input,output:e.output+t.output,cacheRead:e.cacheRead+t.cacheRead,cacheWrite:e.cacheWrite+t.cacheWrite,totalTokens:e.totalTokens+t.totalTokens,cost:{input:e.cost.input+t.cost.input,output:e.cost.output+t.cost.output,cacheRead:e.cost.cacheRead+t.cost.cacheRead,cacheWrite:e.cost.cacheWrite+t.cost.cacheWrite,total:e.cost.total+t.cost.total}};return(e.cacheWrite1h!==void 0||t.cacheWrite1h!==void 0)&&(n.cacheWrite1h=(e.cacheWrite1h??0)+(t.cacheWrite1h??0)),(e.reasoning!==void 0||t.reasoning!==void 0)&&(n.reasoning=(e.reasoning??0)+(t.reasoning??0)),n}function ohi(e){let t;for(const o of e)o.kind==="compaction"&&(t=o);const n=t,i=n===void 0?0:Math.max(0,e.findIndex(({id:o})=>o===n.head)),r=e.flatMap((o,s)=>o.kind==="message"&&s>=i?[o.message]:[]);return n===void 0?r:[n.model,...r]}function shi(e,t,n){const i=Pci(),r=t[n];if(r?.kind==="compaction"&&r.details!==void 0){for(const o of r.details.readFiles)i.read.add(o);for(const o of r.details.modifiedFiles)i.edited.add(o)}for(const o of e)WHt(o,i);return i}function ahi(e,t,n,i){for(let r=t;r<n;r+=1){const o=e[r];if(o?.kind==="message"){if(o.message.role==="assistant")return!1;if(o.message.role==="toolResult"&&i.has(o.message.toolCallId))return!0}}return!1}function chi(e,t,n){const i=[];let r=new Set;for(let o=t;o<n;o+=1){const s=e[o];if(s?.kind!=="message")continue;const a=s.message;a.role==="assistant"?(i.push(o),r=new Set(a.content.flatMap(c=>c.type==="toolCall"?[c.id]:[]))):a.role==="user"&&!ahi(e,o+1,n,r)&&i.push(o)}return i}function uhi(e,t,n,i){const r=chi(e,t,n);let o=0;for(let s=n-1;s>=t;s-=1){const a=e[s];if(a?.kind==="message"&&(o+=iK(a.message),o>=i))return r.find(c=>c>=s)??r.at(-1)}}function lhi(e,t,n){const i=e[n],r=i?.kind==="message"&&i.message.role==="user";let o=-1;if(!r)for(let s=n;s>=t;s-=1){const a=e[s];if(a?.kind==="message"&&a.message.role==="user"){o=s;break}}return{isSplitTurn:!r&&o>=0,turnStartIndex:o}}function dhi(e,t,n,i){const r=uhi(e,t,n,i);return r===void 0?{firstKeptEntryIndex:t,isSplitTurn:!1,turnStartIndex:-1}:{firstKeptEntryIndex:r,...lhi(e,t,r)}}function eOe(e,t){if(e.at(-1)?.kind==="compaction")return;let i,r=-1,o=0;for(let f=e.length-1;f>=0;f-=1){const g=e[f];if(g?.kind==="compaction"){i=Oci(g.model),r=f;const y=e.findIndex(v=>v.id===g.head);o=y>=0?y:f+1;break}}const s=e.flatMap((f,g)=>f.kind==="message"&&g>=o?[f]:[]),a=A3(ohi(e)).tokens,c=dhi(s,0,s.length,t.keepRecentTokens),u=s[c.firstKeptEntryIndex];if(u?.kind!=="message")return;const l=c.isSplitTurn?c.turnStartIndex:c.firstKeptEntryIndex,d=Object.freeze(s.slice(0,l).map(({message:f})=>f)),p=Object.freeze(c.isSplitTurn?s.slice(c.turnStartIndex,c.firstKeptEntryIndex).map(({message:f})=>f):[]);if(d.length===0&&p.length===0)return;const h=shi(d,e,r);for(const f of p)WHt(f,h);const m={firstKeptEntryId:u.id,messagesToSummarize:d,turnPrefixMessages:p,isSplitTurn:c.isSplitTurn,tokensBefore:a,fileOps:h,settings:t};return i===void 0?m:{...m,previousSummary:i}}function phi(e,t,n,i){const r={...n,cacheRetention:"none",sessionId:n.sessionId??ZAe()};return IDt(()=>Promise.resolve((i??TTe)(e,Zv(t),r)).then(o=>o.result()),VQt,r.signal)}function hhi(e){return{systemPrompt:qHt,messages:[{role:"user",content:[{type:"text",text:e}],timestamp:Date.now()}]}}function mhi(e,t,n){const i=e.previousSummary??"",r=t?VHt:HHt,o=n===void 0?r:`${r}
|
package/dist/whats-new.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"release":"0.
|
|
1
|
+
{"release":"0.59.0","lines":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/spore",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.3",
|
|
4
4
|
"description": "Spore by Fungi: open-source AI agents for your terminal and ACP editor, powered by Shiitake by Fungi.",
|
|
5
5
|
"homepage": "https://docs.fungi.computer/shiitake",
|
|
6
6
|
"keywords": [
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"@opencode-ai/pty": "0.3.0"
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@fungi.computer/spore-native-linux-x64": "0.17.
|
|
49
|
-
"@fungi.computer/spore-native-linux-arm64": "0.17.
|
|
50
|
-
"@fungi.computer/spore-native-darwin-arm64": "0.17.
|
|
51
|
-
"@fungi.computer/spore-native-darwin-x64": "0.17.
|
|
48
|
+
"@fungi.computer/spore-native-linux-x64": "0.17.3",
|
|
49
|
+
"@fungi.computer/spore-native-linux-arm64": "0.17.3",
|
|
50
|
+
"@fungi.computer/spore-native-darwin-arm64": "0.17.3",
|
|
51
|
+
"@fungi.computer/spore-native-darwin-x64": "0.17.3",
|
|
52
52
|
"@oven/bun-darwin-x64": "1.4.4",
|
|
53
53
|
"@oven/bun-darwin-aarch64": "1.4.4",
|
|
54
54
|
"@oven/bun-linux-x64": "1.4.4",
|