@wjarka/cezarion 0.14.9-dev.842 → 0.14.9-dev.878

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.
Files changed (66) hide show
  1. package/README.md +8 -0
  2. package/dist/ci-wait/controller.d.ts +12 -12
  3. package/dist/core/claude-cli-runner.js +1 -1
  4. package/dist/core/claude-cli-runner.js.map +1 -1
  5. package/dist/core/cursor-acp-runner.d.ts +2 -0
  6. package/dist/core/cursor-acp-runner.js +116 -26
  7. package/dist/core/cursor-acp-runner.js.map +1 -1
  8. package/dist/core/cursor-provider-error.d.ts +3 -0
  9. package/dist/core/cursor-provider-error.js +13 -3
  10. package/dist/core/cursor-provider-error.js.map +1 -1
  11. package/dist/core/opencode-server-runner.js +12 -5
  12. package/dist/core/opencode-server-runner.js.map +1 -1
  13. package/dist/core/pi-runner.js +17 -4
  14. package/dist/core/pi-runner.js.map +1 -1
  15. package/dist/delegation/results.js +10 -6
  16. package/dist/delegation/results.js.map +1 -1
  17. package/dist/delegation/transport.d.ts +50 -50
  18. package/dist/git-worktree.d.ts +3 -1
  19. package/dist/git-worktree.js +26 -4
  20. package/dist/git-worktree.js.map +1 -1
  21. package/dist/runs/retention.d.ts +7 -2
  22. package/dist/runs/retention.js +39 -7
  23. package/dist/runs/retention.js.map +1 -1
  24. package/dist/runs/store.js +1 -1
  25. package/dist/runs/store.js.map +1 -1
  26. package/dist/server/server.d.ts +1211 -1211
  27. package/dist/server/server.js +5 -2
  28. package/dist/server/server.js.map +1 -1
  29. package/dist/task-cli/cli.js +36 -2
  30. package/dist/task-cli/cli.js.map +1 -1
  31. package/dist/workflows/run.d.ts +8 -0
  32. package/dist/workflows/run.js +80 -13
  33. package/dist/workflows/run.js.map +1 -1
  34. package/package.json +3 -3
  35. package/scripts/mock-cursor-acp.mjs +17 -3
  36. package/scripts/mock-cursor-hang-stdin.mjs +16 -0
  37. package/scripts/mock-pi-rpc.mjs +15 -4
  38. package/web/dist/assets/{agent-accounts-JPfZPgKn.js → agent-accounts-tNk0wiKj.js} +1 -1
  39. package/web/dist/assets/centered-state-DXxIJA15.js +43 -0
  40. package/web/dist/assets/{collapsible-CTymFdL7.js → collapsible-D3Lh_nlG.js} +1 -1
  41. package/web/dist/assets/{commit-list-BZpYGQl2.js → commit-list-CgoIXaVd.js} +1 -1
  42. package/web/dist/assets/{compare-variants-9VkybaQ7.js → compare-variants-2AnPP6ez.js} +1 -1
  43. package/web/dist/assets/{diff-controls-CpcHG3Mm.js → diff-controls-BCazakYu.js} +1 -1
  44. package/web/dist/assets/{dropdown-menu-_YAzCaoQ.js → dropdown-menu-CyFz8H2A.js} +1 -1
  45. package/web/dist/assets/{git-toolbar-BvKDz6uS.js → git-toolbar-DT4Q02mZ.js} +1 -1
  46. package/web/dist/assets/{github-CgjJCGrD.js → github-vwoJvCTz.js} +1 -1
  47. package/web/dist/assets/{index-BJtve0Pm.js → index-1YNk4P3I.js} +4 -4
  48. package/web/dist/assets/{markdown-CFWZnvMh.js → markdown-0VE-LMFx.js} +1 -1
  49. package/web/dist/assets/{pill-QfwkuR50.js → pill-BU5y1CTd.js} +1 -1
  50. package/web/dist/assets/{project-router-CkAA39N5.js → project-router-EEnXzYjj.js} +1 -1
  51. package/web/dist/assets/{prompt-templates-Cfna_S0T.js → prompt-templates-D8lCwJds.js} +1 -1
  52. package/web/dist/assets/{repo-git-DgzgJ0cP.js → repo-git-CYDGngEk.js} +1 -1
  53. package/web/dist/assets/{run-diff-YbCEQn5I.js → run-diff-C-Ij6Y04.js} +1 -1
  54. package/web/dist/assets/{run-header-DMgIbr1d.js → run-header-DYiqx0qE.js} +1 -1
  55. package/web/dist/assets/{skills-BW79kUTd.js → skills-CH6TkMy9.js} +1 -1
  56. package/web/dist/assets/{tab-link-MIHvczEm.js → tab-link-CQc65wEy.js} +1 -1
  57. package/web/dist/assets/{task-changes-C96ekt94.js → task-changes-CEi-l2GZ.js} +1 -1
  58. package/web/dist/assets/{task-commits-DBfcMZyG.js → task-commits-BYdWmsx1.js} +1 -1
  59. package/web/dist/assets/{task-files-BKpH8dKQ.js → task-files-DHUEF1Fh.js} +1 -1
  60. package/web/dist/assets/{task-thread-Dnq7Ek6W.js → task-thread-DAxvkDvr.js} +2 -2
  61. package/web/dist/assets/{textarea-D2vAVgYW.js → textarea-BOXhPgVD.js} +1 -1
  62. package/web/dist/assets/{thread-loading-NW8Mthco.js → thread-loading-D9dDLmql.js} +1 -1
  63. package/web/dist/assets/{token-metrics-D188e6_0.js → token-metrics-DJeOZ5n-.js} +1 -1
  64. package/web/dist/assets/{workflows-BFY1hgp3.js → workflows-CpHaJbUe.js} +1 -1
  65. package/web/dist/index.html +11 -11
  66. package/web/dist/assets/centered-state-HwCqQkH3.js +0 -43
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{At as r,Ba as i,G as a,Gt as o,Pt as s,X as ee,Y as te,_ as ne,d as c,f as l,g as re,ga as u,h as ie,hr as ae,in as oe,m as d,p as f,qt as se,t as ce,ta as le,tn as ue,v as de,vr as fe,y as pe}from"./centered-state-HwCqQkH3.js";import{_ as me,b as he,t as p,v as m}from"./utils-DKheTxGD.js";import{a as ge,i as _e,r as ve}from"./agent-accounts-JPfZPgKn.js";import{E as ye,F as be,M as xe,j as Se,r as Ce}from"./prompt-templates-Cfna_S0T.js";import{u as we}from"./project-router-CkAA39N5.js";import{i as Te,n as Ee,r as De,t as Oe}from"./skills-DFBiAuJG.js";import{t as ke}from"./use-submit-shortcut-KWJsC906.js";var h=n(),g=e(t(),1);function Ae(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function je(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function Me(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat||Ae(e.target)&&!je(e.target))}function _(e,t){let n=g.useRef(t);g.useLayoutEffect(()=>{n.current=t}),g.useEffect(()=>{let t=t=>{Me(t,e)&&(t.preventDefault(),n.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function Ne(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||Ae(e.target))}function Pe(e,t=typeof navigator>`u`?``:navigator.platform){let n=e.toUpperCase();return/mac|iphone|ipad|ipod/i.test(t)?`⌘${n}`:`Ctrl+${n}`}function v(e,t){let n=g.useRef(t);g.useLayoutEffect(()=>{n.current=t}),g.useEffect(()=>{let t=t=>{Ne(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function y({...e}){return(0,h.jsx)(l,{"data-slot":`sheet`,...e})}function b({...e}){return(0,h.jsx)(pe,{"data-slot":`sheet-trigger`,...e})}function Fe({...e}){return(0,h.jsx)(f,{"data-slot":`sheet-close`,...e})}function Ie({...e}){return(0,h.jsx)(ne,{"data-slot":`sheet-portal`,...e})}function x({className:e,...t}){return(0,h.jsx)(re,{"data-slot":`sheet-overlay`,className:p(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Le({className:e,children:t,side:n=`right`,showCloseButton:r=!0,overlayClassName:i,...a}){return(0,h.jsxs)(Ie,{children:[(0,h.jsx)(x,{className:i}),(0,h.jsxs)(d,{"data-slot":`sheet-content`,className:p(`fixed z-50 flex flex-col gap-4 bg-background shadow-modal transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...a,children:[t,r&&(0,h.jsxs)(f,{className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,h.jsx)(ue,{className:`size-4`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function S({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sheet-header`,className:p(`flex flex-col gap-1.5 p-4`,e),...t})}function Re({className:e,...t}){return(0,h.jsx)(de,{"data-slot":`sheet-title`,className:p(`font-semibold text-foreground`,e),...t})}function ze({className:e,...t}){return(0,h.jsx)(ie,{"data-slot":`sheet-description`,className:p(`text-sm text-muted-foreground`,e),...t})}function C(e){let[t,n]=g.useState(()=>Date.now());return g.useEffect(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Be={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,bmp:`image/bmp`,avif:`image/avif`,md:`text/markdown`,markdown:`text/markdown`,txt:`text/plain`,log:`text/plain`,pdf:`application/pdf`};function w(e){return m(e.type)?e.type:Be[e.name.split(`.`).pop()?.toLowerCase()??``]??null}async function Ve(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));let r=btoa(n),i=w(e)??`application/octet-stream`,a=he(i);return{mediaType:i,data:r,...a?{preview:`data:${i};base64,${r}`}:{},name:e.name||(a?`pasted image`:`pasted.${me(i)}`),isImage:a}}function He(e,t){let n=[],r=[],i=t;for(let t of e){let e=t.name||`attachment`;if(w(t)===null){r.push(`${e} is not a supported attachment (images, PDF and plain-text files such as TXT or MD)`);continue}if(t.size>5242880){r.push(`${e} is too large (max 5 MB)`);continue}if(i>=4){r.push(`${e} skipped — max 4 attachments per message`);continue}n.push(t),i+=1}return{accepted:n,rejected:r}}var Ue=new Set([`/`,`@`]);function We(e,t){for(let n=t-1;n>=0;--n){let r=e[n];if(/\s/.test(r))return null;if(Ue.has(r))return n>0&&!/\s/.test(e[n-1])?null:{trigger:r,start:n,query:e.slice(n+1,t)}}return null}function Ge(e,t,n,r){let i=`${t.trigger}${r} `;return{text:e.slice(0,t.start)+i+e.slice(n),caret:t.start+i.length}}function Ke(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}function qe(e,t){let n=e,r=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let i=t.results[e],a=i[0]?.transcript??``;i.isFinal?n+=a:r+=a}return{finalText:n,interim:r}}function Je(e){let[t,n]=g.useState(null),r=g.useRef(null),i=g.useRef(``),[a]=g.useState(()=>Ke()!==void 0),o=g.useCallback(()=>{let e=r.current;r.current=null,i.current=``,n(null),e&&(e.onresult=null,e.onerror=null,e.onend=null,e.abort())},[]);return g.useEffect(()=>o,[o]),{supported:a,recording:t,start:g.useCallback(()=>{if(r.current)return;let t=Ke();if(!t)return;let a;try{a=new t,a.lang=navigator.language||`en-US`,a.continuous=!0,a.interimResults=!0;let s=Date.now();a.onresult=e=>{let t=qe(i.current,e);i.current=t.finalText,n({transcript:t.finalText+t.interim,startedAt:s})},a.onerror=t=>{e(`Dictation failed${t.error?` — ${t.error}`:``}`),o()},a.start(),r.current=a,n({transcript:``,startedAt:s})}catch{e(`Dictation failed — the microphone could not be started`),o()}},[e,o]),cancel:g.useCallback(()=>o(),[o]),finish:g.useCallback(()=>{let e=r.current,a=(i.current+``).trim()===``?``:i.current,o=t?.transcript??a;return e&&(e.onresult=null,e.onerror=null,e.onend=null,e.stop()),r.current=null,i.current=``,n(null),o.trim()},[t])}}function T(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`}var Ye=new Map,Xe={KeyA:`Yes, approved.`,KeyC:`Continue.`};function E({onSubmit:e,retainDraftUntilSuccess:t=!1,onStop:n,onFinish:ne,finishing:l=!1,secondaryAction:re,stopOnEmpty:ie=!1,stopping:d=!1,emptySubmitLabel:f,compactFeedback:ce=!1,idleFeedback:de,pendingLabel:pe=`Starting task…`,failureHint:me=`Could not confirm submission. Check Tasks before you retry. Your draft is kept.`,clearOnSuccess:he=!0,onPendingChange:m,value:we,onValueChange:je,autoFocus:Me=!1,mobileCollapsible:_=!1,mobileDisclosureKey:Ne,footerStart:Pe,footerEnd:v,sessionControls:y,executionOptions:b,agentOptions:Fe,sendAriaLabel:Ie=`Send`,disabled:x=!1,disabledReason:Le=`Session closed — Continue to reopen.`,allowEmptySubmit:S=!1,placeholder:Re=`Reply — / for skills, @ for files…`,ariaLabel:ze=`Reply to the agent`,autocompleteSkills:C=!0,quickReplies:Be=!1,getMentionCandidates:w,ref:Ue}){let[Ke,qe]=(0,g.useState)(``),T=we??Ke,E=(0,g.useRef)(T);E.current=T;let $e=(0,g.useRef)(je);$e.current=je;let D=(0,g.useCallback)(e=>{let t=typeof e==`function`?e(E.current):e;qe(t),$e.current?.(t)},[]),[O,k]=(0,g.useState)([]),A=(0,g.useRef)(O);A.current=O;let[et,tt]=(0,g.useState)(!1),j=d||et,M=(0,g.useRef)(j);M.current=j;let N=T.trim()!==``||O.length>0,nt=!N&&(n!==void 0&&ie||j),rt=!N&&!nt&&ne!==void 0,it=nt||rt||!N&&f!==void 0,at=!N&&f?f:Ie,[P,F]=(0,g.useState)(!1),I=(0,g.useRef)(!1),ot=(0,g.useRef)(0),L=(0,g.useRef)(!0);(0,g.useEffect)(()=>(L.current=!0,()=>{L.current=!1}),[]);let[R,z]=(0,g.useState)(null),B=j||t&&P,V=()=>M.current||t&&I.current,[H,U]=(0,g.useState)(null),[st,ct]=(0,g.useState)(``),[lt,ut]=(0,g.useState)(!1),W=(0,g.useRef)(null),G=(0,g.useId)(),dt=(0,g.useId)(),ft=(0,g.useRef)(new Map),pt=Ne===void 0?ft.current:Ye,mt=Ne??`default`,[,ht]=(0,g.useReducer)(e=>e+1,0),K=pt.get(mt)??!1,gt=_&&!K,_t=(0,g.useRef)(null),q=(0,g.useRef)(null),J=ae(C&&lt),Y=fe(),vt=i(),X=Je(e=>u(e,{tone:`danger`}));(0,g.useEffect)(()=>{Me&&W.current?.focus()},[]),(0,g.useImperativeHandle)(Ue,()=>({insertAtCaret:e=>{if(V())return;let t=W.current,n=Ce(E.current,t?.selectionStart??E.current.length,e);D(n.text),q.current=n.caret,t?.focus()}}),[D,t]);let yt=(0,g.useCallback)(()=>{let e=W.current;if(!e||x||V()){U(null);return}let t=We(e.value,e.selectionStart??e.value.length);if(t?.trigger===`/`&&!C||t?.trigger===`@`&&w===void 0)return U(null);t?.trigger===`/`&&ut(!0),U(t)},[C,x,w,t]),Z=(0,g.useMemo)(()=>H===null?[]:H.trigger===`/`?Ee(J.data??[],H.query,Y.data?.skillUsage).map(e=>({value:`${e.name} ${e.path}`,insert:e.name,label:e.name,description:e.description,emphasized:Te(e)})):(w?.()??[]).filter(e=>De(e,H.query)).map(e=>({value:e,insert:e,label:e,emphasized:!1})),[w,J.data,H,Y.data?.skillUsage]),bt=Z.some(e=>e.value===st)?st:Z[0]?.value,xt=H!==null,St=(0,g.useCallback)(()=>U(null),[]),Ct=e=>{let t=W.current;if(!t||H===null||V())return;let n=t.selectionStart??t.value.length,r=Ge(t.value,H,n,e.insert);H.trigger===`/`&&Y.data!==void 0&&le({skillUsage:Oe(Y.data.skillUsage,e.insert)}).then(()=>vt.invalidateQueries({queryKey:oe.uiState})).catch(()=>{}),D(r.text),q.current=r.caret,U(null),t.focus()};(0,g.useLayoutEffect)(()=>{let e=q.current,t=W.current;e!==null&&t&&(t.setSelectionRange(e,e),q.current=null)},[T]),(0,g.useLayoutEffect)(()=>{let e=W.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,220)}px`)},[T,K]);let wt=(0,g.useCallback)(e=>{if(x||V())return;let n=ot.current,r=He(e,A.current.length);for(let e of r.rejected)u(e,{tone:`danger`});for(let e of r.accepted)Ve(e).then(e=>{!L.current||t&&I.current&&!M.current||n!==ot.current||k(t=>t.length>=4?t:[...t,e])},()=>u(`${e.name||`Attachment`} could not be read — try attaching it again`,{tone:`danger`}))},[x,t]),Tt=e=>{let t=[...e.clipboardData?.items??[]].filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);t.length!==0&&(e.preventDefault(),wt(t))},Et=e=>{let t=[...e.dataTransfer?.files??[]];t.length!==0&&(e.preventDefault(),wt(t))},Q=(0,g.useCallback)(async(n,r,i)=>{let a=n.trim();if(!(x||d||I.current)&&!(a===``&&r.length===0&&!S)){I.current=!0,t&&(ot.current+=1),F(!0),z(null),m?.(!0),U(null),i&&!t&&(D(``),k([]));try{await e(a,r.map(({mediaType:e,data:t})=>({mediaType:e,data:t}))),L.current&&t&&he&&(E.current===n&&D(``),A.current===r&&k([]))}catch(e){if(!L.current&&t)return;let a=e instanceof Error?e.message:String(e);t?z(a):(u(a,{tone:`danger`}),i&&(D(e=>e===``?n:`${n}\n${e}`),k(e=>[...r,...e].slice(0,4))))}finally{I.current=!1,L.current&&(m?.(!1),F(!1))}}},[S,x,d,e,t,he,m,D]),Dt=(0,g.useCallback)(()=>{x||d||I.current||Q(E.current,A.current,!0)},[x,d,Q]),Ot=async()=>{if(!(!n||d||I.current)){I.current=!0,F(!0),tt(!0),z(null);try{await n()}catch(e){L.current&&z(e instanceof Error?e.message:String(e))}finally{I.current=!1,L.current&&(F(!1),tt(!1))}}},kt=e=>{if(xt){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),Z.length===0)return;let t=Z.findIndex(e=>e.value===bt),n=e.key===`ArrowDown`?1:-1,r=Z[(t+n+Z.length)%Z.length];ct(r.value);return}if(e.key===`Escape`){e.preventDefault(),St();return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){let t=Z.find(e=>e.value===bt);if(t){e.preventDefault(),Ct(t);return}St()}}ke({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.preventDefault(),Dt())};(0,g.useEffect)(()=>{if(!Be||x)return;let e=e=>{if(!e.altKey||e.metaKey||e.ctrlKey||e.repeat||Ae(e.target))return;let t=Xe[e.code];t!==void 0&&(e.preventDefault(),Q(t,[],!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x,Be,Q]);let At=e=>{if(x||M.current||I.current&&(e||t))return;let n=X.finish();if(n===``)return;let r=T.trim()===``?n:`${T.replace(/\s*$/,``)} ${n}`;if(e){t&&D(r),Q(r,O,!0);return}D(r),q.current=r.length,W.current?.focus()},$=X.recording,jt=X.supported?(0,h.jsxs)(c,{type:`button`,variant:`ghost`,size:`sm`,disabled:x||B,"aria-label":`Start dictation`,title:`Dictation`,className:p(`h-11 gap-1.5 px-2.5 text-xs font-medium text-muted-foreground md:h-8`,gt&&`hidden md:inline-flex`),onClick:()=>{V()||X.start()},children:[(0,h.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),b||y?null:`Dictation`]}):null,Mt=rt?(0,h.jsxs)(c,{type:`button`,"data-slot":`composer-finish`,"aria-label":l?`Finishing…`:`Finish`,"aria-busy":l||void 0,title:`Close the session and mark this task done`,disabled:P||j||l,className:`h-11 w-auto gap-[7px] px-5 active:opacity-80`,onClick:()=>void ne?.(),children:[(0,h.jsx)(te,{"aria-hidden":`true`}),l?`Finishing…`:`Finish`]}):null,Nt=n||j?(0,h.jsxs)(c,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":j?`Stopping…`:`Stop`,"aria-busy":j||void 0,title:j?`Waiting for execution to stop`:`Stop execution; keep existing work`,disabled:P||j,className:p(`h-11 min-w-11 active:opacity-80`,it?`w-auto px-3`:`w-11`),onClick:()=>void Ot(),children:[(0,h.jsx)(o,{"aria-hidden":`true`,className:`size-3 fill-current`}),it?j?`Stopping…`:`Stop`:null]}):null,Pt=j||P||R!==null||de!=null,Ft=(0,h.jsx)(h.Fragment,{children:t||n||d?(0,h.jsx)(`div`,{className:p(`overflow-y-auto text-xs leading-5 text-muted-foreground`,ce&&!Pt?`h-0`:`px-3 pb-2 md:px-4`,ce?Pt&&`min-h-6`:`h-24 md:h-20`),children:(0,h.jsx)(`div`,{id:`${G}-submission`,role:R===null?`status`:`alert`,"aria-atomic":`true`,tabIndex:R===null?void 0:0,className:`break-words`,children:j?`Stopping execution. Your draft is kept.`:P?pe:R===null?de??null:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`font-medium text-foreground`,children:R}),(0,h.jsx)(`p`,{children:me})]})})}):null}),It=(0,h.jsxs)(`div`,{"data-slot":`composer-submit-row`,className:p(`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1 md:flex-nowrap`,b&&`new-task-submission`),children:[b||y?null:jt,v?(0,h.jsx)(`div`,{id:dt,"data-slot":`composer-footer-end`,className:p(`min-w-0 flex-wrap items-center gap-1.5 md:flex-nowrap`,b&&`mr-auto`,_&&`max-md:[&_button]:min-h-11 max-md:[&_button]:min-w-11`,gt?`hidden md:flex`:`flex`),children:(0,h.jsx)(`div`,{className:`contents`,inert:B||void 0,children:v})}):null,(0,h.jsxs)(`div`,{className:`flex min-w-[100px] items-center justify-end gap-1`,"data-slot":`composer-actions`,children:[Nt??re,Mt,!nt&&!rt?(0,h.jsxs)(c,{type:`button`,size:`icon-sm`,"aria-label":at,"aria-busy":P&&!j||void 0,disabled:x||P||j||!N&&!S,className:p(b?`h-12 w-full gap-2 px-6`:y?`h-11 w-auto gap-2 px-5`:`size-11`,!N&&f&&`w-auto px-3`,`active:opacity-80`),onClick:Dt,children:[!y&&!N&&f?(0,h.jsx)(be,{"aria-hidden":`true`}):null,b||y||!N&&f?at:null,y||N||!f?(0,h.jsx)(a,{"aria-hidden":`true`}):null]}):null]})]});return(0,h.jsxs)(ve,{open:xt,onOpenChange:e=>e?void 0:St(),children:[(0,h.jsx)(_e,{asChild:!0,children:(0,h.jsxs)(`div`,{ref:_t,"data-slot":`composer`,"data-disabled":x||void 0,onDrop:Et,onDragOver:e=>e.preventDefault(),className:p(b&&`new-task-composer`,y&&`session-composer`,x&&`opacity-80`),children:[(0,h.jsxs)(`div`,{"data-slot":`composer-editor`,className:p(`rounded-xl border border-[var(--composer-border)] bg-card shadow-none transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/15`,b&&`new-task-editor`),children:[O.length>0?(0,h.jsx)(`div`,{"data-slot":`composer-thumbs`,className:`flex flex-nowrap items-center gap-2 overflow-x-auto px-4 pt-3 md:flex-wrap md:overflow-visible`,children:O.map((e,t)=>(0,h.jsxs)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,title:B?`Attachment submitted`:`Click to remove`,disabled:B,className:p(`group relative shrink-0 overflow-hidden rounded-md border border-border`,e.isImage?`size-12`:`flex h-12 min-w-11 max-w-[200px] items-center gap-1.5 bg-muted/40 px-2.5 text-xs text-muted-foreground`),onClick:()=>{V()||k(e=>e.filter((e,n)=>n!==t))},children:[e.isImage?(0,h.jsx)(`img`,{src:e.preview,alt:``,className:`size-full object-cover`}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,h.jsx)(`span`,{className:`absolute inset-0 hidden items-center justify-center bg-background/70 group-hover:flex group-focus-visible:flex`,children:(0,h.jsx)(ue,{"aria-hidden":`true`,className:`size-4`})})]},`${e.name}-${t}`))}):null,(0,h.jsx)(`label`,{htmlFor:G,className:b?`hidden px-5 pt-5 text-xs text-muted-foreground md:block`:`sr-only`,children:b?`Task description`:ze}),(0,h.jsx)(`textarea`,{ref:W,id:G,autoComplete:`off`,rows:1,value:T,disabled:x,readOnly:B,"aria-busy":B||void 0,"aria-describedby":t?`${G}-submission`:void 0,"aria-label":ze,placeholder:x?Le:Re,className:p(`block min-h-11 w-full resize-none bg-transparent px-3 pt-2.5 pb-1 text-base leading-normal outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed md:min-h-[54px] md:px-4 md:pt-3 md:text-sm`,gt?`max-h-11 md:max-h-[220px]`:`max-h-[220px]`,b&&`md:text-base`),onChange:e=>{V()||(D(e.target.value),yt())},onKeyDown:kt,onSelect:yt,onPaste:Tt}),b?(0,h.jsxs)(`p`,{"data-slot":`composer-skill-hint`,className:`flex items-center gap-2 px-5 pt-3 pb-2 text-xs text-muted-foreground`,children:[(0,h.jsx)(se,{"aria-hidden":`true`,className:`size-[15px] shrink-0`}),`Type / for a skill or workflow`]}):null,y&&$?(0,h.jsx)(`div`,{"data-slot":`session-controls`,inert:B||void 0,children:y}):null,$?(0,h.jsxs)(`div`,{children:[(0,h.jsx)(Qe,{transcript:$.transcript,startedAt:$.startedAt,insertionDisabled:B,onCancel:X.cancel,onInsert:()=>At(!1),onInsertAndSend:()=>At(!0)}),Nt?(0,h.jsx)(`div`,{className:`flex justify-end px-2 pb-2`,children:Nt}):null]}):(0,h.jsxs)(`div`,{"data-slot":`composer-toolbar`,className:`flex flex-wrap items-center gap-1 gap-y-1 px-1.5 pt-1 pb-1.5 md:gap-y-1.5 md:px-2 md:pt-1.5 md:pb-2`,children:[y?(0,h.jsx)(`div`,{"data-slot":`session-controls`,inert:B||void 0,children:y}):null,(0,h.jsxs)(`div`,{"data-slot":`composer-footer-start`,className:p(`flex min-w-0 flex-wrap items-center gap-1`,b&&`w-full`),children:[(0,h.jsx)(Ze,{disabled:x||B,onFiles:wt}),_?(0,h.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`size-11 md:hidden`,"aria-label":K?`Collapse composer`:`Expand composer`,"aria-expanded":K,"aria-controls":v?`${G} ${dt}`:G,onClick:()=>{pt.set(mt,!K),ht()},children:(0,h.jsx)(ee,{"aria-hidden":`true`,className:p(`transition-transform motion-reduce:transition-none`,!K&&`rotate-180`)})}):null,(0,h.jsx)(`div`,{className:`contents`,inert:B||void 0,children:Pe}),b||y?(0,h.jsx)(`div`,{children:jt}):null]}),b?null:It]}),b?null:Ft]}),b?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{"data-slot":`composer-agent-options`,inert:B||void 0,children:Fe}),(0,h.jsx)(`div`,{"data-slot":`composer-execution-panel`,inert:B||void 0,children:b}),It,(0,h.jsx)(`div`,{"data-slot":`composer-feedback`,children:Ft})]}):null]})}),(0,h.jsx)(ge,{side:`top`,align:`start`,sideOffset:8,className:`w-80 max-w-[calc(100vw-2rem)] p-0`,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{_t.current?.contains(e.target)&&e.preventDefault()},children:(0,h.jsx)(ye,{shouldFilter:!1,value:bt??``,onValueChange:ct,children:(0,h.jsx)(xe,{"data-slot":`composer-menu`,"data-trigger":H?.trigger,className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] p-1`,children:Z.length===0?(0,h.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:H?.trigger===`@`?`No files seen in this session yet — full file search arrives with the Files tab.`:J.isPending?`Loading skills…`:`No matching skills.`}):Z.map(e=>(0,h.jsxs)(Se,{value:e.value,"data-slot":`composer-menu-item`,"data-emphasized":e.emphasized||void 0,onSelect:()=>Ct(e),children:[(0,h.jsx)(`span`,{className:p(`shrink-0 truncate`,e.emphasized&&`font-semibold`,H?.trigger===`@`&&`font-mono text-xs`),children:e.label}),e.description?(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null]},e.value))})})})]})}function Ze({disabled:e,onFiles:t}){let n=(0,g.useRef)(null);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,title:`Attach an image, PDF, TXT or MD file (or paste a screenshot)`,disabled:e,className:`size-11 text-muted-foreground`,onClick:()=>n.current?.click(),children:(0,h.jsx)(s,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,h.jsx)(`input`,{ref:n,type:`file`,accept:`image/*,application/pdf,text/plain,text/markdown,.pdf,.txt,.md,.markdown,.log`,multiple:!0,className:`hidden`,"aria-hidden":`true`,tabIndex:-1,onChange:e=>{t([...e.target.files??[]]),e.target.value=``}})]})}function Qe({transcript:e,startedAt:t,insertionDisabled:n,onCancel:r,onInsert:i,onInsertAndSend:o}){let s=C(1e3);return(0,h.jsxs)(`div`,{"data-slot":`dictation-overlay`,role:`status`,"aria-label":`Dictation in progress`,className:`flex items-center gap-2.5 rounded-b-xl border-t border-border bg-muted/60 px-3 py-2`,children:[(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none animate-pulse rounded-full bg-danger motion-reduce:animate-none`}),(0,h.jsx)(`span`,{"data-slot":`dictation-timer`,className:`text-xs font-medium text-muted-foreground tabular-nums`,children:T(t,s)}),(0,h.jsx)(`span`,{"data-slot":`dictation-transcript`,"aria-live":`polite`,className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e===``?(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`Listening…`}):e}),(0,h.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Cancel dictation`,className:`size-11 text-muted-foreground md:size-8`,onClick:r,children:(0,h.jsx)(ue,{"aria-hidden":`true`})}),(0,h.jsx)(c,{type:`button`,variant:`outline`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription`,className:`size-11 md:size-8`,onClick:i,children:(0,h.jsx)(te,{"aria-hidden":`true`})}),(0,h.jsx)(c,{type:`button`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription and send`,className:`size-11 md:size-8`,onClick:o,children:(0,h.jsx)(a,{"aria-hidden":`true`})})]})}function $e(){return(0,h.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,h.jsx)(ce,{icon:(0,h.jsx)(we,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading task…`,subtitle:`Fetching the run and its session transcript.`})})}export{Fe as a,S as c,Pe as d,_ as f,y as i,Re as l,E as n,Le as o,v as p,C as r,ze as s,$e as t,b as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{At as r,Ba as i,G as a,Gt as o,Pt as s,X as ee,Y as te,_ as ne,d as c,f as l,g as re,ga as u,h as ie,hr as ae,in as oe,m as d,p as f,qt as se,t as ce,ta as le,tn as ue,v as de,vr as fe,y as pe}from"./centered-state-DXxIJA15.js";import{_ as me,b as he,t as p,v as m}from"./utils-DKheTxGD.js";import{a as ge,i as _e,r as ve}from"./agent-accounts-tNk0wiKj.js";import{E as ye,F as be,M as xe,j as Se,r as Ce}from"./prompt-templates-D8lCwJds.js";import{u as we}from"./project-router-EEnXzYjj.js";import{i as Te,n as Ee,r as De,t as Oe}from"./skills-DFBiAuJG.js";import{t as ke}from"./use-submit-shortcut-KWJsC906.js";var h=n(),g=e(t(),1);function Ae(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function je(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function Me(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat||Ae(e.target)&&!je(e.target))}function _(e,t){let n=g.useRef(t);g.useLayoutEffect(()=>{n.current=t}),g.useEffect(()=>{let t=t=>{Me(t,e)&&(t.preventDefault(),n.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function Ne(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||Ae(e.target))}function Pe(e,t=typeof navigator>`u`?``:navigator.platform){let n=e.toUpperCase();return/mac|iphone|ipad|ipod/i.test(t)?`⌘${n}`:`Ctrl+${n}`}function v(e,t){let n=g.useRef(t);g.useLayoutEffect(()=>{n.current=t}),g.useEffect(()=>{let t=t=>{Ne(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function y({...e}){return(0,h.jsx)(l,{"data-slot":`sheet`,...e})}function b({...e}){return(0,h.jsx)(pe,{"data-slot":`sheet-trigger`,...e})}function Fe({...e}){return(0,h.jsx)(f,{"data-slot":`sheet-close`,...e})}function Ie({...e}){return(0,h.jsx)(ne,{"data-slot":`sheet-portal`,...e})}function x({className:e,...t}){return(0,h.jsx)(re,{"data-slot":`sheet-overlay`,className:p(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Le({className:e,children:t,side:n=`right`,showCloseButton:r=!0,overlayClassName:i,...a}){return(0,h.jsxs)(Ie,{children:[(0,h.jsx)(x,{className:i}),(0,h.jsxs)(d,{"data-slot":`sheet-content`,className:p(`fixed z-50 flex flex-col gap-4 bg-background shadow-modal transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...a,children:[t,r&&(0,h.jsxs)(f,{className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,h.jsx)(ue,{className:`size-4`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function S({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sheet-header`,className:p(`flex flex-col gap-1.5 p-4`,e),...t})}function Re({className:e,...t}){return(0,h.jsx)(de,{"data-slot":`sheet-title`,className:p(`font-semibold text-foreground`,e),...t})}function ze({className:e,...t}){return(0,h.jsx)(ie,{"data-slot":`sheet-description`,className:p(`text-sm text-muted-foreground`,e),...t})}function C(e){let[t,n]=g.useState(()=>Date.now());return g.useEffect(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Be={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,bmp:`image/bmp`,avif:`image/avif`,md:`text/markdown`,markdown:`text/markdown`,txt:`text/plain`,log:`text/plain`,pdf:`application/pdf`};function w(e){return m(e.type)?e.type:Be[e.name.split(`.`).pop()?.toLowerCase()??``]??null}async function Ve(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));let r=btoa(n),i=w(e)??`application/octet-stream`,a=he(i);return{mediaType:i,data:r,...a?{preview:`data:${i};base64,${r}`}:{},name:e.name||(a?`pasted image`:`pasted.${me(i)}`),isImage:a}}function He(e,t){let n=[],r=[],i=t;for(let t of e){let e=t.name||`attachment`;if(w(t)===null){r.push(`${e} is not a supported attachment (images, PDF and plain-text files such as TXT or MD)`);continue}if(t.size>5242880){r.push(`${e} is too large (max 5 MB)`);continue}if(i>=4){r.push(`${e} skipped — max 4 attachments per message`);continue}n.push(t),i+=1}return{accepted:n,rejected:r}}var Ue=new Set([`/`,`@`]);function We(e,t){for(let n=t-1;n>=0;--n){let r=e[n];if(/\s/.test(r))return null;if(Ue.has(r))return n>0&&!/\s/.test(e[n-1])?null:{trigger:r,start:n,query:e.slice(n+1,t)}}return null}function Ge(e,t,n,r){let i=`${t.trigger}${r} `;return{text:e.slice(0,t.start)+i+e.slice(n),caret:t.start+i.length}}function Ke(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}function qe(e,t){let n=e,r=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let i=t.results[e],a=i[0]?.transcript??``;i.isFinal?n+=a:r+=a}return{finalText:n,interim:r}}function Je(e){let[t,n]=g.useState(null),r=g.useRef(null),i=g.useRef(``),[a]=g.useState(()=>Ke()!==void 0),o=g.useCallback(()=>{let e=r.current;r.current=null,i.current=``,n(null),e&&(e.onresult=null,e.onerror=null,e.onend=null,e.abort())},[]);return g.useEffect(()=>o,[o]),{supported:a,recording:t,start:g.useCallback(()=>{if(r.current)return;let t=Ke();if(!t)return;let a;try{a=new t,a.lang=navigator.language||`en-US`,a.continuous=!0,a.interimResults=!0;let s=Date.now();a.onresult=e=>{let t=qe(i.current,e);i.current=t.finalText,n({transcript:t.finalText+t.interim,startedAt:s})},a.onerror=t=>{e(`Dictation failed${t.error?` — ${t.error}`:``}`),o()},a.start(),r.current=a,n({transcript:``,startedAt:s})}catch{e(`Dictation failed — the microphone could not be started`),o()}},[e,o]),cancel:g.useCallback(()=>o(),[o]),finish:g.useCallback(()=>{let e=r.current,a=(i.current+``).trim()===``?``:i.current,o=t?.transcript??a;return e&&(e.onresult=null,e.onerror=null,e.onend=null,e.stop()),r.current=null,i.current=``,n(null),o.trim()},[t])}}function T(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`}var Ye=new Map,Xe={KeyA:`Yes, approved.`,KeyC:`Continue.`};function E({onSubmit:e,retainDraftUntilSuccess:t=!1,onStop:n,onFinish:ne,finishing:l=!1,secondaryAction:re,stopOnEmpty:ie=!1,stopping:d=!1,emptySubmitLabel:f,compactFeedback:ce=!1,idleFeedback:de,pendingLabel:pe=`Starting task…`,failureHint:me=`Could not confirm submission. Check Tasks before you retry. Your draft is kept.`,clearOnSuccess:he=!0,onPendingChange:m,value:we,onValueChange:je,autoFocus:Me=!1,mobileCollapsible:_=!1,mobileDisclosureKey:Ne,footerStart:Pe,footerEnd:v,sessionControls:y,executionOptions:b,agentOptions:Fe,sendAriaLabel:Ie=`Send`,disabled:x=!1,disabledReason:Le=`Session closed — Continue to reopen.`,allowEmptySubmit:S=!1,placeholder:Re=`Reply — / for skills, @ for files…`,ariaLabel:ze=`Reply to the agent`,autocompleteSkills:C=!0,quickReplies:Be=!1,getMentionCandidates:w,ref:Ue}){let[Ke,qe]=(0,g.useState)(``),T=we??Ke,E=(0,g.useRef)(T);E.current=T;let $e=(0,g.useRef)(je);$e.current=je;let D=(0,g.useCallback)(e=>{let t=typeof e==`function`?e(E.current):e;qe(t),$e.current?.(t)},[]),[O,k]=(0,g.useState)([]),A=(0,g.useRef)(O);A.current=O;let[et,tt]=(0,g.useState)(!1),j=d||et,M=(0,g.useRef)(j);M.current=j;let N=T.trim()!==``||O.length>0,nt=!N&&(n!==void 0&&ie||j),rt=!N&&!nt&&ne!==void 0,it=nt||rt||!N&&f!==void 0,at=!N&&f?f:Ie,[P,F]=(0,g.useState)(!1),I=(0,g.useRef)(!1),ot=(0,g.useRef)(0),L=(0,g.useRef)(!0);(0,g.useEffect)(()=>(L.current=!0,()=>{L.current=!1}),[]);let[R,z]=(0,g.useState)(null),B=j||t&&P,V=()=>M.current||t&&I.current,[H,U]=(0,g.useState)(null),[st,ct]=(0,g.useState)(``),[lt,ut]=(0,g.useState)(!1),W=(0,g.useRef)(null),G=(0,g.useId)(),dt=(0,g.useId)(),ft=(0,g.useRef)(new Map),pt=Ne===void 0?ft.current:Ye,mt=Ne??`default`,[,ht]=(0,g.useReducer)(e=>e+1,0),K=pt.get(mt)??!1,gt=_&&!K,_t=(0,g.useRef)(null),q=(0,g.useRef)(null),J=ae(C&&lt),Y=fe(),vt=i(),X=Je(e=>u(e,{tone:`danger`}));(0,g.useEffect)(()=>{Me&&W.current?.focus()},[]),(0,g.useImperativeHandle)(Ue,()=>({insertAtCaret:e=>{if(V())return;let t=W.current,n=Ce(E.current,t?.selectionStart??E.current.length,e);D(n.text),q.current=n.caret,t?.focus()}}),[D,t]);let yt=(0,g.useCallback)(()=>{let e=W.current;if(!e||x||V()){U(null);return}let t=We(e.value,e.selectionStart??e.value.length);if(t?.trigger===`/`&&!C||t?.trigger===`@`&&w===void 0)return U(null);t?.trigger===`/`&&ut(!0),U(t)},[C,x,w,t]),Z=(0,g.useMemo)(()=>H===null?[]:H.trigger===`/`?Ee(J.data??[],H.query,Y.data?.skillUsage).map(e=>({value:`${e.name} ${e.path}`,insert:e.name,label:e.name,description:e.description,emphasized:Te(e)})):(w?.()??[]).filter(e=>De(e,H.query)).map(e=>({value:e,insert:e,label:e,emphasized:!1})),[w,J.data,H,Y.data?.skillUsage]),bt=Z.some(e=>e.value===st)?st:Z[0]?.value,xt=H!==null,St=(0,g.useCallback)(()=>U(null),[]),Ct=e=>{let t=W.current;if(!t||H===null||V())return;let n=t.selectionStart??t.value.length,r=Ge(t.value,H,n,e.insert);H.trigger===`/`&&Y.data!==void 0&&le({skillUsage:Oe(Y.data.skillUsage,e.insert)}).then(()=>vt.invalidateQueries({queryKey:oe.uiState})).catch(()=>{}),D(r.text),q.current=r.caret,U(null),t.focus()};(0,g.useLayoutEffect)(()=>{let e=q.current,t=W.current;e!==null&&t&&(t.setSelectionRange(e,e),q.current=null)},[T]),(0,g.useLayoutEffect)(()=>{let e=W.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,220)}px`)},[T,K]);let wt=(0,g.useCallback)(e=>{if(x||V())return;let n=ot.current,r=He(e,A.current.length);for(let e of r.rejected)u(e,{tone:`danger`});for(let e of r.accepted)Ve(e).then(e=>{!L.current||t&&I.current&&!M.current||n!==ot.current||k(t=>t.length>=4?t:[...t,e])},()=>u(`${e.name||`Attachment`} could not be read — try attaching it again`,{tone:`danger`}))},[x,t]),Tt=e=>{let t=[...e.clipboardData?.items??[]].filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);t.length!==0&&(e.preventDefault(),wt(t))},Et=e=>{let t=[...e.dataTransfer?.files??[]];t.length!==0&&(e.preventDefault(),wt(t))},Q=(0,g.useCallback)(async(n,r,i)=>{let a=n.trim();if(!(x||d||I.current)&&!(a===``&&r.length===0&&!S)){I.current=!0,t&&(ot.current+=1),F(!0),z(null),m?.(!0),U(null),i&&!t&&(D(``),k([]));try{await e(a,r.map(({mediaType:e,data:t})=>({mediaType:e,data:t}))),L.current&&t&&he&&(E.current===n&&D(``),A.current===r&&k([]))}catch(e){if(!L.current&&t)return;let a=e instanceof Error?e.message:String(e);t?z(a):(u(a,{tone:`danger`}),i&&(D(e=>e===``?n:`${n}\n${e}`),k(e=>[...r,...e].slice(0,4))))}finally{I.current=!1,L.current&&(m?.(!1),F(!1))}}},[S,x,d,e,t,he,m,D]),Dt=(0,g.useCallback)(()=>{x||d||I.current||Q(E.current,A.current,!0)},[x,d,Q]),Ot=async()=>{if(!(!n||d||I.current)){I.current=!0,F(!0),tt(!0),z(null);try{await n()}catch(e){L.current&&z(e instanceof Error?e.message:String(e))}finally{I.current=!1,L.current&&(F(!1),tt(!1))}}},kt=e=>{if(xt){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),Z.length===0)return;let t=Z.findIndex(e=>e.value===bt),n=e.key===`ArrowDown`?1:-1,r=Z[(t+n+Z.length)%Z.length];ct(r.value);return}if(e.key===`Escape`){e.preventDefault(),St();return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){let t=Z.find(e=>e.value===bt);if(t){e.preventDefault(),Ct(t);return}St()}}ke({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.preventDefault(),Dt())};(0,g.useEffect)(()=>{if(!Be||x)return;let e=e=>{if(!e.altKey||e.metaKey||e.ctrlKey||e.repeat||Ae(e.target))return;let t=Xe[e.code];t!==void 0&&(e.preventDefault(),Q(t,[],!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x,Be,Q]);let At=e=>{if(x||M.current||I.current&&(e||t))return;let n=X.finish();if(n===``)return;let r=T.trim()===``?n:`${T.replace(/\s*$/,``)} ${n}`;if(e){t&&D(r),Q(r,O,!0);return}D(r),q.current=r.length,W.current?.focus()},$=X.recording,jt=X.supported?(0,h.jsxs)(c,{type:`button`,variant:`ghost`,size:`sm`,disabled:x||B,"aria-label":`Start dictation`,title:`Dictation`,className:p(`h-11 gap-1.5 px-2.5 text-xs font-medium text-muted-foreground md:h-8`,gt&&`hidden md:inline-flex`),onClick:()=>{V()||X.start()},children:[(0,h.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),b||y?null:`Dictation`]}):null,Mt=rt?(0,h.jsxs)(c,{type:`button`,"data-slot":`composer-finish`,"aria-label":l?`Finishing…`:`Finish`,"aria-busy":l||void 0,title:`Close the session and mark this task done`,disabled:P||j||l,className:`h-11 w-auto gap-[7px] px-5 active:opacity-80`,onClick:()=>void ne?.(),children:[(0,h.jsx)(te,{"aria-hidden":`true`}),l?`Finishing…`:`Finish`]}):null,Nt=n||j?(0,h.jsxs)(c,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":j?`Stopping…`:`Stop`,"aria-busy":j||void 0,title:j?`Waiting for execution to stop`:`Stop execution; keep existing work`,disabled:P||j,className:p(`h-11 min-w-11 active:opacity-80`,it?`w-auto px-3`:`w-11`),onClick:()=>void Ot(),children:[(0,h.jsx)(o,{"aria-hidden":`true`,className:`size-3 fill-current`}),it?j?`Stopping…`:`Stop`:null]}):null,Pt=j||P||R!==null||de!=null,Ft=(0,h.jsx)(h.Fragment,{children:t||n||d?(0,h.jsx)(`div`,{className:p(`overflow-y-auto text-xs leading-5 text-muted-foreground`,ce&&!Pt?`h-0`:`px-3 pb-2 md:px-4`,ce?Pt&&`min-h-6`:`h-24 md:h-20`),children:(0,h.jsx)(`div`,{id:`${G}-submission`,role:R===null?`status`:`alert`,"aria-atomic":`true`,tabIndex:R===null?void 0:0,className:`break-words`,children:j?`Stopping execution. Your draft is kept.`:P?pe:R===null?de??null:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`font-medium text-foreground`,children:R}),(0,h.jsx)(`p`,{children:me})]})})}):null}),It=(0,h.jsxs)(`div`,{"data-slot":`composer-submit-row`,className:p(`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1 md:flex-nowrap`,b&&`new-task-submission`),children:[b||y?null:jt,v?(0,h.jsx)(`div`,{id:dt,"data-slot":`composer-footer-end`,className:p(`min-w-0 flex-wrap items-center gap-1.5 md:flex-nowrap`,b&&`mr-auto`,_&&`max-md:[&_button]:min-h-11 max-md:[&_button]:min-w-11`,gt?`hidden md:flex`:`flex`),children:(0,h.jsx)(`div`,{className:`contents`,inert:B||void 0,children:v})}):null,(0,h.jsxs)(`div`,{className:`flex min-w-[100px] items-center justify-end gap-1`,"data-slot":`composer-actions`,children:[Nt??re,Mt,!nt&&!rt?(0,h.jsxs)(c,{type:`button`,size:`icon-sm`,"aria-label":at,"aria-busy":P&&!j||void 0,disabled:x||P||j||!N&&!S,className:p(b?`h-12 w-full gap-2 px-6`:y?`h-11 w-auto gap-2 px-5`:`size-11`,!N&&f&&`w-auto px-3`,`active:opacity-80`),onClick:Dt,children:[!y&&!N&&f?(0,h.jsx)(be,{"aria-hidden":`true`}):null,b||y||!N&&f?at:null,y||N||!f?(0,h.jsx)(a,{"aria-hidden":`true`}):null]}):null]})]});return(0,h.jsxs)(ve,{open:xt,onOpenChange:e=>e?void 0:St(),children:[(0,h.jsx)(_e,{asChild:!0,children:(0,h.jsxs)(`div`,{ref:_t,"data-slot":`composer`,"data-disabled":x||void 0,onDrop:Et,onDragOver:e=>e.preventDefault(),className:p(b&&`new-task-composer`,y&&`session-composer`,x&&`opacity-80`),children:[(0,h.jsxs)(`div`,{"data-slot":`composer-editor`,className:p(`rounded-xl border border-[var(--composer-border)] bg-card shadow-none transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/15`,b&&`new-task-editor`),children:[O.length>0?(0,h.jsx)(`div`,{"data-slot":`composer-thumbs`,className:`flex flex-nowrap items-center gap-2 overflow-x-auto px-4 pt-3 md:flex-wrap md:overflow-visible`,children:O.map((e,t)=>(0,h.jsxs)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,title:B?`Attachment submitted`:`Click to remove`,disabled:B,className:p(`group relative shrink-0 overflow-hidden rounded-md border border-border`,e.isImage?`size-12`:`flex h-12 min-w-11 max-w-[200px] items-center gap-1.5 bg-muted/40 px-2.5 text-xs text-muted-foreground`),onClick:()=>{V()||k(e=>e.filter((e,n)=>n!==t))},children:[e.isImage?(0,h.jsx)(`img`,{src:e.preview,alt:``,className:`size-full object-cover`}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,h.jsx)(`span`,{className:`absolute inset-0 hidden items-center justify-center bg-background/70 group-hover:flex group-focus-visible:flex`,children:(0,h.jsx)(ue,{"aria-hidden":`true`,className:`size-4`})})]},`${e.name}-${t}`))}):null,(0,h.jsx)(`label`,{htmlFor:G,className:b?`hidden px-5 pt-5 text-xs text-muted-foreground md:block`:`sr-only`,children:b?`Task description`:ze}),(0,h.jsx)(`textarea`,{ref:W,id:G,autoComplete:`off`,rows:1,value:T,disabled:x,readOnly:B,"aria-busy":B||void 0,"aria-describedby":t?`${G}-submission`:void 0,"aria-label":ze,placeholder:x?Le:Re,className:p(`block min-h-11 w-full resize-none bg-transparent px-3 pt-2.5 pb-1 text-base leading-normal outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed md:min-h-[54px] md:px-4 md:pt-3 md:text-sm`,gt?`max-h-11 md:max-h-[220px]`:`max-h-[220px]`,b&&`md:text-base`),onChange:e=>{V()||(D(e.target.value),yt())},onKeyDown:kt,onSelect:yt,onPaste:Tt}),b?(0,h.jsxs)(`p`,{"data-slot":`composer-skill-hint`,className:`flex items-center gap-2 px-5 pt-3 pb-2 text-xs text-muted-foreground`,children:[(0,h.jsx)(se,{"aria-hidden":`true`,className:`size-[15px] shrink-0`}),`Type / for a skill or workflow`]}):null,y&&$?(0,h.jsx)(`div`,{"data-slot":`session-controls`,inert:B||void 0,children:y}):null,$?(0,h.jsxs)(`div`,{children:[(0,h.jsx)(Qe,{transcript:$.transcript,startedAt:$.startedAt,insertionDisabled:B,onCancel:X.cancel,onInsert:()=>At(!1),onInsertAndSend:()=>At(!0)}),Nt?(0,h.jsx)(`div`,{className:`flex justify-end px-2 pb-2`,children:Nt}):null]}):(0,h.jsxs)(`div`,{"data-slot":`composer-toolbar`,className:`flex flex-wrap items-center gap-1 gap-y-1 px-1.5 pt-1 pb-1.5 md:gap-y-1.5 md:px-2 md:pt-1.5 md:pb-2`,children:[y?(0,h.jsx)(`div`,{"data-slot":`session-controls`,inert:B||void 0,children:y}):null,(0,h.jsxs)(`div`,{"data-slot":`composer-footer-start`,className:p(`flex min-w-0 flex-wrap items-center gap-1`,b&&`w-full`),children:[(0,h.jsx)(Ze,{disabled:x||B,onFiles:wt}),_?(0,h.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`size-11 md:hidden`,"aria-label":K?`Collapse composer`:`Expand composer`,"aria-expanded":K,"aria-controls":v?`${G} ${dt}`:G,onClick:()=>{pt.set(mt,!K),ht()},children:(0,h.jsx)(ee,{"aria-hidden":`true`,className:p(`transition-transform motion-reduce:transition-none`,!K&&`rotate-180`)})}):null,(0,h.jsx)(`div`,{className:`contents`,inert:B||void 0,children:Pe}),b||y?(0,h.jsx)(`div`,{children:jt}):null]}),b?null:It]}),b?null:Ft]}),b?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{"data-slot":`composer-agent-options`,inert:B||void 0,children:Fe}),(0,h.jsx)(`div`,{"data-slot":`composer-execution-panel`,inert:B||void 0,children:b}),It,(0,h.jsx)(`div`,{"data-slot":`composer-feedback`,children:Ft})]}):null]})}),(0,h.jsx)(ge,{side:`top`,align:`start`,sideOffset:8,className:`w-80 max-w-[calc(100vw-2rem)] p-0`,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{_t.current?.contains(e.target)&&e.preventDefault()},children:(0,h.jsx)(ye,{shouldFilter:!1,value:bt??``,onValueChange:ct,children:(0,h.jsx)(xe,{"data-slot":`composer-menu`,"data-trigger":H?.trigger,className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] p-1`,children:Z.length===0?(0,h.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:H?.trigger===`@`?`No files seen in this session yet — full file search arrives with the Files tab.`:J.isPending?`Loading skills…`:`No matching skills.`}):Z.map(e=>(0,h.jsxs)(Se,{value:e.value,"data-slot":`composer-menu-item`,"data-emphasized":e.emphasized||void 0,onSelect:()=>Ct(e),children:[(0,h.jsx)(`span`,{className:p(`shrink-0 truncate`,e.emphasized&&`font-semibold`,H?.trigger===`@`&&`font-mono text-xs`),children:e.label}),e.description?(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null]},e.value))})})})]})}function Ze({disabled:e,onFiles:t}){let n=(0,g.useRef)(null);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,title:`Attach an image, PDF, TXT or MD file (or paste a screenshot)`,disabled:e,className:`size-11 text-muted-foreground`,onClick:()=>n.current?.click(),children:(0,h.jsx)(s,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,h.jsx)(`input`,{ref:n,type:`file`,accept:`image/*,application/pdf,text/plain,text/markdown,.pdf,.txt,.md,.markdown,.log`,multiple:!0,className:`hidden`,"aria-hidden":`true`,tabIndex:-1,onChange:e=>{t([...e.target.files??[]]),e.target.value=``}})]})}function Qe({transcript:e,startedAt:t,insertionDisabled:n,onCancel:r,onInsert:i,onInsertAndSend:o}){let s=C(1e3);return(0,h.jsxs)(`div`,{"data-slot":`dictation-overlay`,role:`status`,"aria-label":`Dictation in progress`,className:`flex items-center gap-2.5 rounded-b-xl border-t border-border bg-muted/60 px-3 py-2`,children:[(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none animate-pulse rounded-full bg-danger motion-reduce:animate-none`}),(0,h.jsx)(`span`,{"data-slot":`dictation-timer`,className:`text-xs font-medium text-muted-foreground tabular-nums`,children:T(t,s)}),(0,h.jsx)(`span`,{"data-slot":`dictation-transcript`,"aria-live":`polite`,className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e===``?(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`Listening…`}):e}),(0,h.jsx)(c,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Cancel dictation`,className:`size-11 text-muted-foreground md:size-8`,onClick:r,children:(0,h.jsx)(ue,{"aria-hidden":`true`})}),(0,h.jsx)(c,{type:`button`,variant:`outline`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription`,className:`size-11 md:size-8`,onClick:i,children:(0,h.jsx)(te,{"aria-hidden":`true`})}),(0,h.jsx)(c,{type:`button`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription and send`,className:`size-11 md:size-8`,onClick:o,children:(0,h.jsx)(a,{"aria-hidden":`true`})})]})}function $e(){return(0,h.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,h.jsx)(ce,{icon:(0,h.jsx)(we,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading task…`,subtitle:`Fetching the run and its session transcript.`})})}export{Fe as a,S as c,Pe as d,_ as f,y as i,Re as l,E as n,Le as o,v as p,C as r,ze as s,$e as t,b as u};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DKheTxGD.js";import{r as n}from"./markdown-CFWZnvMh.js";var r=e();function i(e){return e===void 0?`unknown`:new Intl.NumberFormat().format(e)}function a(e,t){return`Input tokens: ${i(e)}; output tokens: ${i(t)}`}function o(e,t,r=`compact`){let i=e===void 0?`—`:n(e),a=t===void 0?`—`:n(t);return r===`table`?`${i} / ${a}`:`IN ${i} · OUT ${a}`}function s({inputTokens:e,outputTokens:n,variant:i=`compact`,omitWhenUnknown:s=!0,className:c,title:l}){return s&&e===void 0&&n===void 0?null:(0,r.jsx)(`span`,{"data-slot":`directional-usage`,"aria-label":a(e,n),title:l,className:t(`font-mono tabular-nums`,c),children:o(e,n,i)})}function c(e){let t=e?.capabilities,n=t?.tokenMetrics!==!1;return{tokens:t?.tokenUsageMetrics??n,cost:t?.costMetrics??n}}export{o as i,s as n,a as r,c as t};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DKheTxGD.js";import{r as n}from"./markdown-0VE-LMFx.js";var r=e();function i(e){return e===void 0?`unknown`:new Intl.NumberFormat().format(e)}function a(e,t){return`Input tokens: ${i(e)}; output tokens: ${i(t)}`}function o(e,t,r=`compact`){let i=e===void 0?`—`:n(e),a=t===void 0?`—`:n(t);return r===`table`?`${i} / ${a}`:`IN ${i} · OUT ${a}`}function s({inputTokens:e,outputTokens:n,variant:i=`compact`,omitWhenUnknown:s=!0,className:c,title:l}){return s&&e===void 0&&n===void 0?null:(0,r.jsx)(`span`,{"data-slot":`directional-usage`,"aria-label":a(e,n),title:l,className:t(`font-mono tabular-nums`,c),children:o(e,n,i)})}function c(e){let t=e?.capabilities,n=t?.tokenMetrics!==!1;return{tokens:t?.tokenUsageMetrics??n,cost:t?.costMetrics??n}}export{o as i,s as n,a as r,c as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{Ba as i,Di as a,Fa as o,G as s,H as c,It as l,Ji as u,Jt as d,Na as f,Qt as p,Rt as m,Ti as h,Ut as g,X as _,Xt as v,Y as y,Yt as b,Zi as x,a as ee,c as S,ct as C,d as w,ga as T,hr as E,i as te,in as D,it as ne,l as re,o as O,ot as ie,r as ae,s as oe,si as k,st as se,t as ce,tn as le,u as A,vr as ue,xr as j}from"./centered-state-HwCqQkH3.js";import{t as M}from"./utils-DKheTxGD.js";import{i as N,l as de,r as P,t as fe}from"./dropdown-menu-_YAzCaoQ.js";import{i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./textarea-D2vAVgYW.js";import{i as ye,l as be,s as xe}from"./skills-DFBiAuJG.js";import{h as Se,i as Ce}from"./index-BJtve0Pm.js";import{n as we}from"./skill-empty-hint-oOtzR3v0.js";var F=e(n()),I=e(t());function Te(){var e=[...arguments];return(0,I.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var L=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function R(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ee(e){return`nodeType`in e}function z(e){return e?R(e)?e:Ee(e)?e.ownerDocument?.defaultView??window:window:window}function B(e){let{Document:t}=z(e);return e instanceof t}function V(e){return!R(e)&&e instanceof z(e).HTMLElement}function De(e){return e instanceof z(e).SVGElement}function Oe(e){return e?R(e)?e.document:Ee(e)?B(e)?e:V(e)||De(e)?e.ownerDocument:document:document:document}var H=L?I.useLayoutEffect:I.useEffect;function ke(e){let t=(0,I.useRef)(e);return H(()=>{t.current=e}),(0,I.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ae(){let e=(0,I.useRef)(null);return[(0,I.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,I.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function U(e,t){t===void 0&&(t=[e]);let n=(0,I.useRef)(e);return H(()=>{n.current!==e&&(n.current=e)},t),n}function je(e,t){let n=(0,I.useRef)();return(0,I.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Me(e){let t=ke(e),n=(0,I.useRef)(null);return[n,(0,I.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Ne(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current}var Pe={};function Fe(e,t){return(0,I.useMemo)(()=>{if(t)return t;let n=Pe[e]==null?0:Pe[e]+1;return Pe[e]=n,e+`-`+n},[e,t])}function Ie(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var W=Ie(1),Le=Ie(-1);function Re(e){return`clientX`in e&&`clientY`in e}function ze(e){if(!e)return!1;let{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function Be(e){if(!e)return!1;let{TouchEvent:t}=z(e.target);return t&&e instanceof t}function Ve(e){if(Be(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Re(e)?{x:e.clientX,y:e.clientY}:null}var G=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[G.Translate.toString(e),G.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),He=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ue(e){return e.matches(He)?e:e.querySelector(He)}var K={display:`none`};function We(e){let{id:t,value:n}=e;return I.createElement(`div`,{id:t,style:K},n)}function Ge(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return I.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Ke(){let[e,t]=(0,I.useState)(``);return{announce:(0,I.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var qe=(0,I.createContext)(null);function Je(e){let t=(0,I.useContext)(qe);(0,I.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Ye(){let[e]=(0,I.useState)(()=>new Set),t=(0,I.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,I.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Xe={draggable:`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{Ba as i,Di as a,Fa as o,G as s,H as c,It as l,Ji as u,Jt as d,Na as f,Qt as p,Rt as m,Ti as h,Ut as g,X as _,Xt as v,Y as y,Yt as b,Zi as x,a as ee,c as S,ct as C,d as w,ga as T,hr as E,i as te,in as D,it as ne,l as re,o as O,ot as ie,r as ae,s as oe,si as k,st as se,t as ce,tn as le,u as A,vr as ue,xr as j}from"./centered-state-DXxIJA15.js";import{t as M}from"./utils-DKheTxGD.js";import{i as N,l as de,r as P,t as fe}from"./dropdown-menu-CyFz8H2A.js";import{i as pe,n as me,o as he,r as ge,s as _e,t as ve}from"./textarea-BOXhPgVD.js";import{i as ye,l as be,s as xe}from"./skills-DFBiAuJG.js";import{h as Se,i as Ce}from"./index-1YNk4P3I.js";import{n as we}from"./skill-empty-hint-oOtzR3v0.js";var F=e(n()),I=e(t());function Te(){var e=[...arguments];return(0,I.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var L=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function R(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ee(e){return`nodeType`in e}function z(e){return e?R(e)?e:Ee(e)?e.ownerDocument?.defaultView??window:window:window}function B(e){let{Document:t}=z(e);return e instanceof t}function V(e){return!R(e)&&e instanceof z(e).HTMLElement}function De(e){return e instanceof z(e).SVGElement}function Oe(e){return e?R(e)?e.document:Ee(e)?B(e)?e:V(e)||De(e)?e.ownerDocument:document:document:document}var H=L?I.useLayoutEffect:I.useEffect;function ke(e){let t=(0,I.useRef)(e);return H(()=>{t.current=e}),(0,I.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ae(){let e=(0,I.useRef)(null);return[(0,I.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,I.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function U(e,t){t===void 0&&(t=[e]);let n=(0,I.useRef)(e);return H(()=>{n.current!==e&&(n.current=e)},t),n}function je(e,t){let n=(0,I.useRef)();return(0,I.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Me(e){let t=ke(e),n=(0,I.useRef)(null);return[n,(0,I.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Ne(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current}var Pe={};function Fe(e,t){return(0,I.useMemo)(()=>{if(t)return t;let n=Pe[e]==null?0:Pe[e]+1;return Pe[e]=n,e+`-`+n},[e,t])}function Ie(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var W=Ie(1),Le=Ie(-1);function Re(e){return`clientX`in e&&`clientY`in e}function ze(e){if(!e)return!1;let{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function Be(e){if(!e)return!1;let{TouchEvent:t}=z(e.target);return t&&e instanceof t}function Ve(e){if(Be(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Re(e)?{x:e.clientX,y:e.clientY}:null}var G=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[G.Translate.toString(e),G.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),He=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ue(e){return e.matches(He)?e:e.querySelector(He)}var K={display:`none`};function We(e){let{id:t,value:n}=e;return I.createElement(`div`,{id:t,style:K},n)}function Ge(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return I.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Ke(){let[e,t]=(0,I.useState)(``);return{announce:(0,I.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var qe=(0,I.createContext)(null);function Je(e){let t=(0,I.useContext)(qe);(0,I.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Ye(){let[e]=(0,I.useState)(()=>new Set),t=(0,I.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,I.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Xe={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -47,32 +47,32 @@
47
47
  }
48
48
  })()
49
49
  </script>
50
- <script type="module" crossorigin src="/assets/index-BJtve0Pm.js"></script>
50
+ <script type="module" crossorigin src="/assets/index-1YNk4P3I.js"></script>
51
51
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
53
53
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-BT31bpU6.js">
54
54
  <link rel="modulepreload" crossorigin href="/assets/utils-DKheTxGD.js">
55
- <link rel="modulepreload" crossorigin href="/assets/centered-state-HwCqQkH3.js">
56
- <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-_YAzCaoQ.js">
57
- <link rel="modulepreload" crossorigin href="/assets/agent-accounts-JPfZPgKn.js">
58
- <link rel="modulepreload" crossorigin href="/assets/textarea-D2vAVgYW.js">
55
+ <link rel="modulepreload" crossorigin href="/assets/centered-state-DXxIJA15.js">
56
+ <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-CyFz8H2A.js">
57
+ <link rel="modulepreload" crossorigin href="/assets/agent-accounts-tNk0wiKj.js">
58
+ <link rel="modulepreload" crossorigin href="/assets/textarea-BOXhPgVD.js">
59
59
  <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BHp8sXmF.js">
60
60
  <link rel="modulepreload" crossorigin href="/assets/external-link-BE6y205O.js">
61
61
  <link rel="modulepreload" crossorigin href="/assets/square-terminal-B6RYYieR.js">
62
- <link rel="modulepreload" crossorigin href="/assets/pill-QfwkuR50.js">
62
+ <link rel="modulepreload" crossorigin href="/assets/pill-BU5y1CTd.js">
63
63
  <link rel="modulepreload" crossorigin href="/assets/chevron-right-BENZ-1ZN.js">
64
- <link rel="modulepreload" crossorigin href="/assets/prompt-templates-Cfna_S0T.js">
65
- <link rel="modulepreload" crossorigin href="/assets/project-router-CkAA39N5.js">
64
+ <link rel="modulepreload" crossorigin href="/assets/prompt-templates-D8lCwJds.js">
65
+ <link rel="modulepreload" crossorigin href="/assets/project-router-EEnXzYjj.js">
66
66
  <link rel="modulepreload" crossorigin href="/assets/search-x-I9Q8pgUa.js">
67
67
  <link rel="modulepreload" crossorigin href="/assets/lib-BxQXEXDF.js">
68
68
  <link rel="modulepreload" crossorigin href="/assets/chunk-BO2N2NFS-DE6qKn3r.js">
69
69
  <link rel="modulepreload" crossorigin href="/assets/highlighter-CdHqIwFr.js">
70
- <link rel="modulepreload" crossorigin href="/assets/markdown-CFWZnvMh.js">
70
+ <link rel="modulepreload" crossorigin href="/assets/markdown-0VE-LMFx.js">
71
71
  <link rel="modulepreload" crossorigin href="/assets/skills-DFBiAuJG.js">
72
72
  <link rel="modulepreload" crossorigin href="/assets/use-submit-shortcut-KWJsC906.js">
73
- <link rel="modulepreload" crossorigin href="/assets/thread-loading-NW8Mthco.js">
73
+ <link rel="modulepreload" crossorigin href="/assets/thread-loading-D9dDLmql.js">
74
74
  <link rel="modulepreload" crossorigin href="/assets/diff-stat-Cn7rzy1H.js">
75
- <link rel="modulepreload" crossorigin href="/assets/token-metrics-D188e6_0.js">
75
+ <link rel="modulepreload" crossorigin href="/assets/token-metrics-DJeOZ5n-.js">
76
76
  <link rel="stylesheet" crossorigin href="/assets/index-D0WAgmTQ.css">
77
77
  </head>
78
78
  <body>