@yuriai/web 0.1.21 → 0.1.23

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 (107) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/{AgentAvatar-Dn3d91Bp.js → AgentAvatar-C2p8G_Xw.js} +1 -1
  3. package/dist/assets/{AssistantView-DQiNW-MW.js → AssistantView-Cl8dtJE-.js} +3 -3
  4. package/dist/assets/{DiagramView-BmhwoZBs.js → DiagramView-zXlQky2c.js} +1 -1
  5. package/dist/assets/{FadeInOnReveal-D7ifJQAw.js → FadeInOnReveal-DhAYqopy.js} +1 -1
  6. package/dist/assets/{Icon-DZmADJWp.js → Icon-DKFfVCeK.js} +1 -1
  7. package/dist/assets/{ImageLoadingPlaceholder-Dw4P79Ms.js → ImageLoadingPlaceholder-DD2g7FjK.js} +1 -1
  8. package/dist/assets/{LoadingImage-CCKvcYRc.js → LoadingImage-Dc7hnEQ7.js} +1 -1
  9. package/dist/assets/{MarkdownRenderer-cLMYjCOZ.js → MarkdownRenderer-C1PXw_8U.js} +2 -2
  10. package/dist/assets/{MarkdownRendererImpl-Bv94t0JE.js → MarkdownRendererImpl-CWVOJcvk.js} +1 -1
  11. package/dist/assets/{MarkstreamRendererImpl-BXX_Gr__.js → MarkstreamRendererImpl-BwkPAY1P.js} +1 -1
  12. package/dist/assets/{MobileDetailNavigation-DiMju5tJ.js → MobileDetailNavigation-B4ZBK4cl.js} +1 -1
  13. package/dist/assets/{MobileShareBridge-BvT-pieE.js → MobileShareBridge-B5LUJJ99.js} +1 -1
  14. package/dist/assets/{MobileTabPageHeader-6TnrgU8f.js → MobileTabPageHeader-CkUhuZP6.js} +1 -1
  15. package/dist/assets/{MultiRunWindow-BKAWbnyr.js → MultiRunWindow-CqNrUij5.js} +1 -1
  16. package/dist/assets/{OnboardingScreen-DE2iB21m.js → OnboardingScreen-Dau5R5ew.js} +1 -1
  17. package/dist/assets/{OverlayScrollbar-BlzvB3ct.js → OverlayScrollbar-eBG-DXgX.js} +1 -1
  18. package/dist/assets/{SettingsView-CUuhQWoK.js → SettingsView-vZx4AKc1.js} +3 -3
  19. package/dist/assets/{SettingsWindow-h59i73ov.js → SettingsWindow-Rqxks-AG.js} +1 -1
  20. package/dist/assets/{TerminalView-Zo7cDHfo.js → TerminalView-CGYEbWpv.js} +1 -1
  21. package/dist/assets/{ToolOutputDialog-DDBPTFEY.js → ToolOutputDialog-B24XEhve.js} +1 -1
  22. package/dist/assets/{YuriLogo-Dm011NCM.js → YuriLogo-CgTkNYZf.js} +1 -1
  23. package/dist/assets/{appThemeRegistry-DK-CSk5S.js → appThemeRegistry-DD8LRHDT.js} +1 -1
  24. package/dist/assets/{button-CEcZQm-B.js → button-LPikURUk.js} +1 -1
  25. package/dist/assets/{capgoAdapter-CZGKOfbD.js → capgoAdapter-BCy22KX-.js} +1 -1
  26. package/dist/assets/{collapsible-B6ON5Mai.js → collapsible-CbQmi7qt.js} +1 -1
  27. package/dist/assets/{diagram-9xxUjDb_.js → diagram-DWkoS1Uc.js} +1 -1
  28. package/dist/assets/{dialog-CjPdvmr0.js → dialog-D8AYQa70.js} +1 -1
  29. package/dist/assets/{dropdown-menu.styles-Cm3A3LAl.js → dropdown-menu.styles-BqAI_N66.js} +1 -1
  30. package/dist/assets/{es-CqWNlkik.js → es-Le3f45R2.js} +1 -1
  31. package/dist/assets/{fileMentionTouchSelection-9jKjMJHB.js → fileMentionTouchSelection-CnxrRlNO.js} +1 -1
  32. package/dist/assets/{fr-CpxexYkk.js → fr-Knp2_Wkz.js} +1 -1
  33. package/dist/assets/{gitApi-IVSP2ro3.js → gitApi-D3cHH50Y.js} +1 -1
  34. package/dist/assets/{input-yYSzMq8L.js → input-CAhwlkOT.js} +1 -1
  35. package/dist/assets/{insertionBoundaries-3xRx4bIM.js → insertionBoundaries-19EJsmCA.js} +1 -1
  36. package/dist/assets/{ja-ByTgQPSi.js → ja-_KJ_VLgM.js} +1 -1
  37. package/dist/assets/{ko-BGfRP-3B.js → ko-CmWIeRHF.js} +1 -1
  38. package/dist/assets/{main-C3lkHYme.js → main-BO2UnYBd.js} +2 -2
  39. package/dist/assets/{main-SwAGPxrJ.js → main-b2a4ZRXC.js} +4 -4
  40. package/dist/assets/{markdownHeightCache-w0HDCLwk.js → markdownHeightCache-CylzGsAe.js} +1 -1
  41. package/dist/assets/{mcpQueries-DF-qg0ML.js → mcpQueries-BBt1ELI8.js} +1 -1
  42. package/dist/assets/{miniChat-KQ7dhYRy.js → miniChat-BpvsuSKB.js} +2 -2
  43. package/dist/assets/{mobile-GqxrcIvm.js → mobile-CyklTbWh.js} +2 -2
  44. package/dist/assets/{mobileBackNavigation-CM08LMho.js → mobileBackNavigation-Df81BnZ5.js} +1 -1
  45. package/dist/assets/{multirun-w_nrm1ZM.js → multirun-BrpKcjYv.js} +1 -1
  46. package/dist/assets/{native-config-B2T-ZIEW.js → native-config-C3EM05Jz.js} +1 -1
  47. package/dist/assets/{pl-DIwCzbXW.js → pl-BoXY-ki3.js} +1 -1
  48. package/dist/assets/{platform-7bX6qtBV.js → platform-CCTs9UKZ.js} +1 -1
  49. package/dist/assets/{projectMeta-C6-BO3Sf.js → projectMeta-DOs0HlSf.js} +1 -1
  50. package/dist/assets/{pt-BR-4MjIbbWQ.js → pt-BR-C3gsTrhe.js} +1 -1
  51. package/dist/assets/{renderElectronMiniChatApp-DWdbSIM5.js → renderElectronMiniChatApp-DaeIwT-e.js} +2 -2
  52. package/dist/assets/{renderMobileApp-Dzc3S0T9.js → renderMobileApp-C-Rhiqyk.js} +5 -5
  53. package/dist/assets/{runtimeConfig-BkVhmUl_.js → runtimeConfig-CQ3TyMLm.js} +1 -1
  54. package/dist/assets/{runtimeEndpointReset-DOv4PgLe.js → runtimeEndpointReset-CINPdy23.js} +2 -2
  55. package/dist/assets/{scheduledTaskNavigation-BhsUww-K.js → scheduledTaskNavigation-FME9NQYP.js} +1 -1
  56. package/dist/assets/{sessionChangeSummary-CtU8ntJA.js → sessionChangeSummary-DYp-0K8f.js} +1 -1
  57. package/dist/assets/{sessionLookup-BPj-TfyV.js → sessionLookup-BMSCT9Y1.js} +1 -1
  58. package/dist/assets/{sortable-tabs-strip-MyKMqyvw.js → sortable-tabs-strip-DiXAHgws.js} +1 -1
  59. package/dist/assets/speechSettingsQueries-Ci2kILTe.js +4 -0
  60. package/dist/assets/src-DlJVKekb.css +2 -0
  61. package/dist/assets/{store-JjNwX_aQ.js → store-CnVXA4NH.js} +2 -2
  62. package/dist/assets/{terminalApi-BHXvha-U.js → terminalApi-DhXTmxps.js} +1 -1
  63. package/dist/assets/{textarea-CO8JEdzP.js → textarea-BZhmG_bD.js} +1 -1
  64. package/dist/assets/{tooltip-Dmw1nU2I.js → tooltip-CFuO3PUH.js} +1 -1
  65. package/dist/assets/{types-FsIkN0-g.js → types-Du8LnIGl.js} +1 -1
  66. package/dist/assets/{uk-D9WsfZqn.js → uk-VUOVH9qH.js} +1 -1
  67. package/dist/assets/{useAppFontEffects-BBmnsBzL.js → useAppFontEffects-C-CZuq33.js} +5 -5
  68. package/dist/assets/{useDesktopWindowControlsLayout-2uBv60jr.js → useDesktopWindowControlsLayout-C8BGnh2S.js} +1 -1
  69. package/dist/assets/{useEffectiveDirectory-_OW1qW0a.js → useEffectiveDirectory-B85HOZow.js} +1 -1
  70. package/dist/assets/{useFontPreferences-D9PX5t6Y.js → useFontPreferences-CMyrMAmq.js} +1 -1
  71. package/dist/assets/{useMobileNavigationStore-BwspReaN.js → useMobileNavigationStore-_8410bpu.js} +7 -7
  72. package/dist/assets/{useWorkerHighlightedLines-BBUyEoH8.js → useWorkerHighlightedLines-D4HmbcHr.js} +1 -1
  73. package/dist/assets/vendor-opencode-client-XDI8AfPJ.js +12 -0
  74. package/dist/assets/{zh-CN-CAIBZPD7.js → zh-CN-CqOn122C.js} +1 -1
  75. package/dist/assets/{zh-TW-IpFLeeKe.js → zh-TW-53yr6Fdj.js} +1 -1
  76. package/dist/index.html +9 -9
  77. package/dist/mini-chat.html +9 -9
  78. package/dist/mobile.html +9 -9
  79. package/package.json +3 -3
  80. package/server/lib/config-sync/DOCUMENTATION.md +6 -2
  81. package/server/lib/config-sync/magpie.js +31 -6
  82. package/server/lib/config-sync/magpie.test.js +94 -1
  83. package/server/lib/opencode/DOCUMENTATION.md +9 -9
  84. package/server/lib/opencode/ensure-cli.js +12 -14
  85. package/server/lib/opencode/ensure-cli.test.js +8 -8
  86. package/server/lib/opencode/env-runtime.test.js +1 -1
  87. package/server/lib/opencode/opencode2-pin.js +3 -4
  88. package/server/lib/opencode/opencode2-pin.test.js +5 -4
  89. package/server/lib/opencode/owned-runtime-upgrade.js +4 -11
  90. package/server/lib/opencode/owned-runtime-upgrade.test.js +4 -0
  91. package/server/lib/opencode/routes.js +2 -1
  92. package/server/lib/opencode/routes.test.js +1 -1
  93. package/server/lib/opencode/runtime-contract.js +3 -4
  94. package/server/lib/opencode/session-directory-runtime.js +2 -13
  95. package/server/lib/opencode/session-directory-runtime.test.js +69 -4
  96. package/server/lib/opencode/upgrade-screen.js +9 -5
  97. package/server/lib/opencode/upgrade-screen.test.js +20 -0
  98. package/server/lib/opencode/version-alignment.test.js +6 -6
  99. package/server/lib/session-index/DOCUMENTATION.md +18 -8
  100. package/server/lib/session-index/routes.js +3 -1
  101. package/server/lib/session-index/routes.test.js +2 -0
  102. package/server/lib/session-index/service.js +23 -0
  103. package/server/lib/session-index/sync-runtime.js +75 -20
  104. package/server/lib/session-index/sync-runtime.test.js +5 -5
  105. package/dist/assets/speechSettingsQueries-BicoJlEO.js +0 -4
  106. package/dist/assets/src-CfEhXfYn.css +0 -2
  107. package/dist/assets/vendor-opencode-client-MF2GBrFx.js +0 -12
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{it as t,rt as n}from"./vendor-base-ui-CdzJ6My_.js";import{v as r}from"./useUIStore-NMQx_cnG.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{f as a,r as o,t as s}from"./button-CEcZQm-B.js";import{n as c}from"./useThemeSystem-8jhE4Zyk.js";import{n as l}from"./Icon-DZmADJWp.js";import{i as u,n as d,t as f}from"./tooltip-Dmw1nU2I.js";import{n as p}from"./MarkdownRenderer-cLMYjCOZ.js";import{n as m,o as h,s as g,t as _}from"./markdown-worker-7FvUo2nm.js";import{t as v}from"./vendor-tanstack-react-virtual-B_EO--9t.js";import{n as y}from"./markdownTheme-DHoKvD6O.js";var b=e(t(),1),x=i(),S=n(),C=`w-[min(30rem,calc(100cqw-1rem))] min-w-[280px] max-w-full overflow-hidden rounded-xl shadow-[inset_0_1px_0_0_rgba(255,255,255,0.8),inset_0_0_0_1px_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.10),0_1px_2px_-0.5px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.08),0_12px_20px_-4px_rgba(0,0,0,0.08)] dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.12),inset_0_0_0_1px_rgba(255,255,255,0.08),0_0_0_1px_rgba(0,0,0,0.36),0_1px_1px_-0.5px_rgba(0,0,0,0.22),0_3px_3px_-1.5px_rgba(0,0,0,0.20),0_6px_6px_-3px_rgba(0,0,0,0.16)]`,w={maxWidth:`min(28rem, calc(100cqw - 4ch))`,backgroundColor:`var(--surface-elevated)`,color:`var(--surface-elevated-foreground)`},T=`flex items-center justify-between gap-3 border-b border-[var(--surface-subtle)] px-3 py-2.5`,E=`text-xs font-medium leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,D=`text-xs tabular-nums leading-4 text-muted-foreground md:text-[0.8125rem] md:leading-5`,O=`m-0 list-none divide-y divide-[var(--surface-subtle)] p-0`,k=`${O} max-h-[min(22rem,50vh)] overflow-y-auto`,A=`${O} w-full`,ee={className:`p-0 rounded-none`,maxHeightClass:`max-h-[46vh]`,disableHorizontal:!0},j=`px-2.5 py-1.5 text-xs leading-4 md:py-2 md:text-[0.8125rem] md:leading-5`,M=`flex min-w-0 items-center gap-1 text-xs leading-4 text-muted-foreground md:gap-1.5 md:text-[0.8125rem] md:leading-5`,te=`min-w-0 truncate text-xs leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,ne=`inline-flex shrink-0 items-center gap-1 text-xs leading-4 tabular-nums text-muted-foreground md:text-[0.8125rem] md:leading-5`,re=`h-3 w-3 shrink-0 md:h-3.5 md:w-3.5`,ie={in_progress:`text-foreground`,pending:`text-foreground`,completed:`text-muted-foreground line-through`,cancelled:`text-muted-foreground line-through`},ae={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},N=e=>{let t=(0,x.c)(26),{todo:n,isActive:r,activeRef:i}=e,{t:s}=a(),c=oe.has(n.status)?n.status:`pending`,p=ae[c],m;t[0]!==s||t[1]!==p?(m=s(p),t[0]=s,t[1]=p,t[2]=m):m=t[2];let h=m,g;t[3]===c?g=t[4]:(g=c===`in_progress`?(0,S.jsx)(l,{name:`record-circle`,className:`h-3.5 w-3.5 text-[var(--status-info)]`,"aria-hidden":`true`}):c===`completed`?(0,S.jsx)(l,{name:`checkbox-circle`,className:`h-3.5 w-3.5 text-[var(--status-success)]`,"aria-hidden":`true`}):(0,S.jsx)(l,{name:`time`,className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),t[3]=c,t[4]=g);let _=g,v=r?`step`:void 0,y=r&&`bg-[var(--surface-muted)] before:absolute before:inset-y-2 before:left-0 before:w-0.5 before:rounded-full before:bg-[var(--status-info)]`,b;t[5]===y?b=t[6]:(b=o(`group relative grid min-w-0 grid-cols-[1rem_minmax(0,1fr)] items-start gap-2.5`,j,y),t[5]=y,t[6]=b);let C;t[7]!==_||t[8]!==h?(C=(0,S.jsx)(u,{asChild:!0,children:(0,S.jsx)(`span`,{className:`flex size-4 items-center justify-center`,"aria-label":h,children:_})}),t[7]=_,t[8]=h,t[9]=C):C=t[9];let w;t[10]===h?w=t[11]:(w=(0,S.jsx)(d,{side:`left`,sideOffset:6,children:h}),t[10]=h,t[11]=w);let T;t[12]!==C||t[13]!==w?(T=(0,S.jsxs)(f,{children:[C,w]}),t[12]=C,t[13]=w,t[14]=T):T=t[14];let E=ie[c],D;t[15]===E?D=t[16]:(D=o(`block whitespace-normal break-words`,E),t[15]=E,t[16]=D);let O;t[17]!==D||t[18]!==n.content?(O=(0,S.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,S.jsx)(`span`,{className:D,children:n.content})}),t[17]=D,t[18]=n.content,t[19]=O):O=t[19];let k;return t[20]!==i||t[21]!==O||t[22]!==v||t[23]!==b||t[24]!==T?(k=(0,S.jsxs)(`li`,{ref:i,"aria-current":v,className:b,children:[T,O]}),t[20]=i,t[21]=O,t[22]=v,t[23]=b,t[24]=T,t[25]=k):k=t[25],k},oe=new Set([`in_progress`,`pending`,`completed`,`cancelled`]),P=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),F=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,I=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=F(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},L=e=>`<pre><code>${P(e)}</code></pre>`,R=e=>{let t=(0,x.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=b.useRef(null),p;t[0]===d?p=t[1]:(p=y(d),t[0]=d,t[1]=p);let m=p,h,g;t[2]!==n||t[3]!==s||t[4]!==u?(h=()=>{let e=f.current;e&&(e.innerHTML=L(n),I(e,u,s))},g=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=h,t[6]=g):(h=t[5],g=t[6]),b.useLayoutEffect(h,g);let v,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(v=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return _(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,I(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=v,t[12]=C):(v=t[11],C=t[12]),b.useEffect(v,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=m,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,S.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},z=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},B=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},V=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,H=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,U=(e,t)=>!e||typeof e!=`object`?String(e):g(e,t||``),W=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},G=e=>{if(!e||typeof e!=`object`)return;let t=W(e.patch)??W(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=W(e.patch)??W(e.diff);if(t)return t}},K=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},q=(e,t,n)=>{let r=z(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&V(r)&&(r=H(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=G(n);if(e)return e}return r},se=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{it as t,rt as n}from"./vendor-base-ui-CdzJ6My_.js";import{v as r}from"./useUIStore-NMQx_cnG.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{f as a,r as o,t as s}from"./button-LPikURUk.js";import{n as c}from"./useThemeSystem-8jhE4Zyk.js";import{n as l}from"./Icon-DKFfVCeK.js";import{i as u,n as d,t as f}from"./tooltip-CFuO3PUH.js";import{n as p}from"./MarkdownRenderer-C1PXw_8U.js";import{n as m,o as h,s as g,t as _}from"./markdown-worker-7FvUo2nm.js";import{t as v}from"./vendor-tanstack-react-virtual-B_EO--9t.js";import{n as y}from"./markdownTheme-DHoKvD6O.js";var b=e(t(),1),x=i(),S=n(),C=`w-[min(30rem,calc(100cqw-1rem))] min-w-[280px] max-w-full overflow-hidden rounded-xl shadow-[inset_0_1px_0_0_rgba(255,255,255,0.8),inset_0_0_0_1px_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.10),0_1px_2px_-0.5px_rgba(0,0,0,0.08),0_4px_8px_-2px_rgba(0,0,0,0.08),0_12px_20px_-4px_rgba(0,0,0,0.08)] dark:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.12),inset_0_0_0_1px_rgba(255,255,255,0.08),0_0_0_1px_rgba(0,0,0,0.36),0_1px_1px_-0.5px_rgba(0,0,0,0.22),0_3px_3px_-1.5px_rgba(0,0,0,0.20),0_6px_6px_-3px_rgba(0,0,0,0.16)]`,w={maxWidth:`min(28rem, calc(100cqw - 4ch))`,backgroundColor:`var(--surface-elevated)`,color:`var(--surface-elevated-foreground)`},T=`flex items-center justify-between gap-3 border-b border-[var(--surface-subtle)] px-3 py-2.5`,E=`text-xs font-medium leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,D=`text-xs tabular-nums leading-4 text-muted-foreground md:text-[0.8125rem] md:leading-5`,O=`m-0 list-none divide-y divide-[var(--surface-subtle)] p-0`,k=`${O} max-h-[min(22rem,50vh)] overflow-y-auto`,A=`${O} w-full`,ee={className:`p-0 rounded-none`,maxHeightClass:`max-h-[46vh]`,disableHorizontal:!0},j=`px-2.5 py-1.5 text-xs leading-4 md:py-2 md:text-[0.8125rem] md:leading-5`,M=`flex min-w-0 items-center gap-1 text-xs leading-4 text-muted-foreground md:gap-1.5 md:text-[0.8125rem] md:leading-5`,te=`min-w-0 truncate text-xs leading-4 text-foreground md:text-[0.8125rem] md:leading-5`,ne=`inline-flex shrink-0 items-center gap-1 text-xs leading-4 tabular-nums text-muted-foreground md:text-[0.8125rem] md:leading-5`,re=`h-3 w-3 shrink-0 md:h-3.5 md:w-3.5`,ie={in_progress:`text-foreground`,pending:`text-foreground`,completed:`text-muted-foreground line-through`,cancelled:`text-muted-foreground line-through`},ae={in_progress:`chat.statusRow.todo.status.inProgress`,pending:`chat.statusRow.todo.status.pending`,completed:`chat.statusRow.todo.status.completed`,cancelled:`chat.statusRow.todo.status.cancelled`},N=e=>{let t=(0,x.c)(26),{todo:n,isActive:r,activeRef:i}=e,{t:s}=a(),c=oe.has(n.status)?n.status:`pending`,p=ae[c],m;t[0]!==s||t[1]!==p?(m=s(p),t[0]=s,t[1]=p,t[2]=m):m=t[2];let h=m,g;t[3]===c?g=t[4]:(g=c===`in_progress`?(0,S.jsx)(l,{name:`record-circle`,className:`h-3.5 w-3.5 text-[var(--status-info)]`,"aria-hidden":`true`}):c===`completed`?(0,S.jsx)(l,{name:`checkbox-circle`,className:`h-3.5 w-3.5 text-[var(--status-success)]`,"aria-hidden":`true`}):(0,S.jsx)(l,{name:`time`,className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),t[3]=c,t[4]=g);let _=g,v=r?`step`:void 0,y=r&&`bg-[var(--surface-muted)] before:absolute before:inset-y-2 before:left-0 before:w-0.5 before:rounded-full before:bg-[var(--status-info)]`,b;t[5]===y?b=t[6]:(b=o(`group relative grid min-w-0 grid-cols-[1rem_minmax(0,1fr)] items-start gap-2.5`,j,y),t[5]=y,t[6]=b);let C;t[7]!==_||t[8]!==h?(C=(0,S.jsx)(u,{asChild:!0,children:(0,S.jsx)(`span`,{className:`flex size-4 items-center justify-center`,"aria-label":h,children:_})}),t[7]=_,t[8]=h,t[9]=C):C=t[9];let w;t[10]===h?w=t[11]:(w=(0,S.jsx)(d,{side:`left`,sideOffset:6,children:h}),t[10]=h,t[11]=w);let T;t[12]!==C||t[13]!==w?(T=(0,S.jsxs)(f,{children:[C,w]}),t[12]=C,t[13]=w,t[14]=T):T=t[14];let E=ie[c],D;t[15]===E?D=t[16]:(D=o(`block whitespace-normal break-words`,E),t[15]=E,t[16]=D);let O;t[17]!==D||t[18]!==n.content?(O=(0,S.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,S.jsx)(`span`,{className:D,children:n.content})}),t[17]=D,t[18]=n.content,t[19]=O):O=t[19];let k;return t[20]!==i||t[21]!==O||t[22]!==v||t[23]!==b||t[24]!==T?(k=(0,S.jsxs)(`li`,{ref:i,"aria-current":v,className:b,children:[T,O]}),t[20]=i,t[21]=O,t[22]=v,t[23]=b,t[24]=T,t[25]=k):k=t[25],k},oe=new Set([`in_progress`,`pending`,`completed`,`cancelled`]),P=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),F=e=>e?Object.entries(e).map(([e,t])=>t==null?``:`${e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}:${typeof t==`number`?`${t}px`:t};`).join(``):``,I=(e,t,n)=>{let r=e.querySelector(`pre`);r&&(r.style.margin=`0`,r.style.background=`transparent`,r.style.whiteSpace=t?`pre-wrap`:`pre`,t&&(r.style.wordBreak=`break-word`,r.style.overflowWrap=`break-word`));let i=e.querySelector(`code`);if(i){let e=F(n);e&&i.setAttribute(`style`,`${i.getAttribute(`style`)??``}${e}`)}},L=e=>`<pre><code>${P(e)}</code></pre>`,R=e=>{let t=(0,x.c)(21),{code:n,language:r,className:i,style:a,codeStyle:s,wrap:l}=e,u=l!==void 0&&l,{currentTheme:d}=c(),f=b.useRef(null),p;t[0]===d?p=t[1]:(p=y(d),t[0]=d,t[1]=p);let m=p,h,g;t[2]!==n||t[3]!==s||t[4]!==u?(h=()=>{let e=f.current;e&&(e.innerHTML=L(n),I(e,u,s))},g=[n,u,s],t[2]=n,t[3]=s,t[4]=u,t[5]=h,t[6]=g):(h=t[5],g=t[6]),b.useLayoutEffect(h,g);let v,C;t[7]!==n||t[8]!==s||t[9]!==r||t[10]!==u?(v=()=>{let e=f.current;if(!e)return;let t=!0,i=new AbortController;return _(n,(r||`text`).toLowerCase(),{signal:i.signal,priority:`visible`}).then(n=>{!t||!e||!n||(e.innerHTML=n,I(e,u,s))}),()=>{t=!1,i.abort()}},C=[n,r,u,s],t[7]=n,t[8]=s,t[9]=r,t[10]=u,t[11]=v,t[12]=C):(v=t[11],C=t[12]),b.useEffect(v,C);let w;t[13]===i?w=t[14]:(w=o(`typography-code`,i),t[13]=i,t[14]=w);let T=m,E;t[15]!==a||t[16]!==T?(E={...T,...a},t[15]=a,t[16]=T,t[17]=E):E=t[17];let D;return t[18]!==w||t[19]!==E?(D=(0,S.jsx)(`div`,{ref:f,className:w,style:E}),t[18]=w,t[19]=E,t[20]=D):D=t[20],D},z=e=>{let t=e.replace(/^<file>\s*\n?/,``).replace(/\n?<\/file>\s*$/,``);return t=t.replace(/^\s*\d{5}\|\s?/gm,``),t.trim()},B=(e,t=``)=>{if(typeof e==`string`)return e;if(e==null)return t;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},V=e=>e?e.includes(`<diagnostics`)||e.includes(`<file_diagnostics>`)||e.includes(`LSP errors detected`)||e.includes(`This file has errors`):!1,H=e=>e?e.replace(/\n{0,2}LSP errors detected[\s\S]*?<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/\n{0,2}This file has errors[\s\S]*?<\/file_diagnostics>/g,``).replace(/<diagnostics[^>]*>[\s\S]*?<\/diagnostics>/g,``).replace(/<file_diagnostics>[\s\S]*?<\/file_diagnostics>/g,``).trim():``,U=(e,t)=>!e||typeof e!=`object`?String(e):g(e,t||``),W=e=>{if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}if(e&&typeof e==`object`){let t=e.patch;if(typeof t==`string`){let e=t.trim();return e.length>0?e:void 0}}},G=e=>{if(!e||typeof e!=`object`)return;let t=W(e.patch)??W(e.diff);if(t)return t;let n=Array.isArray(e.files)?e.files:[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=W(e.patch)??W(e.diff);if(t)return t}},K=e=>{if(!e||typeof e!=`string`)return{data:null,isJson:!1};let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`)||!t.endsWith(`}`)&&!t.endsWith(`]`)||t.length<2)return{data:null,isJson:!1};try{let e=JSON.parse(t);return typeof e==`object`&&e?{data:e,isJson:!0}:{data:null,isJson:!1}}catch{return{data:null,isJson:!1}}},q=(e,t,n)=>{let r=z(e);if((t===`edit`||t===`multiedit`||t===`write`||t===`apply_patch`)&&V(r)&&(r=H(r)),(t===`edit`||t===`multiedit`||t===`apply_patch`)&&r.trim().length===0){let e=G(n);if(e)return e}return r},se=e=>{let t=e.match(/<type>(file|directory)<\/type>/i)?.[1]?.toLowerCase()??`unknown`,n=(e.match(/<content>([\s\S]*?)<\/content>/i)?.[1]??e).replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),r=e=>/\(\s*File has more lines\..*offset.*\)/i.test(e.trim());return{type:t,lines:n.map(e=>{let n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);if(t!==`directory`){let t=e.match(/^(\d+):\s?(.*)$/);if(t){let e=t[2],n=e.trim(),i=n.startsWith(`(`)&&n.endsWith(`)`)||r(n);return{lineNumber:i?null:Number(t[1]),text:e,isInfo:i}}}return{lineNumber:null,text:e,isInfo:i}}).filter((e,t,n)=>{if(e.text.trim().length>0)return!0;let r=n[t-1],i=n[t+1],a=!!(r?.isInfo||i?.isInfo),o=e.lineNumber!==null;return!(a&&o)})}},ce=(e,t)=>{try{let n=e.trim().split(`
4
4
  `).filter(Boolean);if(n.length===0)return null;let i=[];return n.forEach(e=>{let t=e.match(/^(\s*)(.+)$/);if(t){let[,e,n]=t,r=Math.floor(e.length/2),a=!n.endsWith(`/`);i.push({name:n.replace(/\/$/,``),depth:r,isFile:a})}}),(0,S.jsx)(`div`,{className:o(`w-full min-w-0 font-mono space-y-0.5`,t?.unstyled?null:`p-3 bg-muted/20 rounded-xl border border-border/30`),style:r.tool.popup,children:i.map((e,t)=>(0,S.jsx)(`div`,{className:`min-w-0`,style:{paddingLeft:`${e.depth*20}px`},children:e.isFile?(0,S.jsx)(`span`,{className:`text-foreground/90 block truncate`,children:e.name}):(0,S.jsxs)(`span`,{className:`font-semibold text-foreground block truncate`,children:[e.name,`/`]})},t))})}catch{return null}},le={backgroundColor:`var(--status-info)`,opacity:.6},ue=(e,t,n)=>{try{let i=e.trim().split(`
@@ -0,0 +1,12 @@
1
+ var e=Object.defineProperty,t=e=>e;function n(e,n){this[e]=t.bind(null,n)}var r=(t,r)=>{for(var i in r)e(t,i,{get:r[i],enumerable:!0,configurable:!0,set:n.bind(r,i)})},i={};r(i,{SharedEvents:()=>i,make:()=>a});function a(e){let t,n=4096;function r(e){e.connected=void 0,e.controller.abort(),t===e&&(t=void 0)}async function i(t){let n,i={};try{if(t.controller.signal.aborted)return;for(n=e(t.controller.signal,()=>{t.subscribers.forEach(e=>e.activity?.())})[Symbol.asyncIterator]();!t.controller.signal.aborted;){let e=await n.next();if(e.done||t.controller.signal.aborted)break;e.value.type===`server.connected`&&(t.connected=e.value),t.subscribers.forEach(t=>t.push(e.value))}}catch(e){i={error:e}}finally{r(t);try{await n?.return?.()}catch(e){`error`in i||(i={error:e})}t.subscribers.forEach(e=>e.finish(i))}}return{subscribe(e){return{[Symbol.asyncIterator](){let a=[],o=[],s=!1,c,l,u=e?.types?.length?new Set(e.types):void 0,d=e=>!u||e.type===`server.connected`||u.has(e.type);function f(t,n=!0){c=t,n&&(o.length=0),e?.signal?.removeEventListener(`abort`,p),l?.subscribers.delete(m)&&!l.subscribers.size&&r(l),a.splice(0).forEach(e=>{`error`in t?e.reject(t.error):e.resolve({done:!0,value:void 0})})}function p(){f({})}let m={activity:e?.onActivity,finish(e){f(e,!1)},push(e){if(c||!d(e))return;let t=a.shift();if(t){t.resolve({done:!1,value:e});return}if(o.length===n){f({error:Error(`Event subscriber exceeded its ${n}-event capacity`)});return}o.push(e)}};function h(){if(c)return;let e=!t;l=t??{controller:new AbortController,subscribers:new Set},t=l,l.subscribers.add(m),l.connected&&m.push(l.connected),e&&i(l)}return{next(){let t=o.shift();if(t)return Promise.resolve({done:!1,value:t});if(c)return`error`in c?Promise.reject(c.error):Promise.resolve({done:!0,value:void 0});if(e?.signal?.aborted)return p(),Promise.resolve({done:!0,value:void 0});let n=Promise.withResolvers();return a.push(n),s||(s=!0,e?.signal?.addEventListener(`abort`,p,{once:!0}),h()),n.promise},return(){return f({}),Promise.resolve({done:!0,value:void 0})}}}}}}}var o=class extends Error{reason;name=`ClientError`;constructor(e,t){let n=t?.detail??(t?.cause instanceof Error?t.cause.message:void 0);super(n?`${e}: ${n}`:e,t),this.reason=e}};r({},{make:()=>c});var s=16777216;function c(e){let t=e.fetch??globalThis.fetch,n=(t,n)=>{let r=new URL(e.baseUrl);r.pathname.endsWith(`/`)||(r.pathname+=`/`);let i=new URL(t.path.slice(1),r);for(let[e,n]of Object.entries(t.query??{}))u(i.searchParams,e,n);let a=new Headers(e.headers);for(let[e,n]of Object.entries(t.headers??{}))n!=null&&a.set(e,String(n));for(let[e,t]of new Headers(n?.headers))a.set(e,t);return t.body!==void 0&&!a.has(`content-type`)&&a.set(`content-type`,t.binaryBody?`application/octet-stream`:`application/json`),{url:i,init:{method:t.method,signal:n?.signal,headers:a,body:t.body===void 0?void 0:t.binaryBody?t.body:JSON.stringify(t.body)}}},r=async(e,r)=>{try{let i=n(e,r);return await t(i.url,i.init)}catch(e){throw new o(`Transport`,{cause:e})}},i=async(e,t)=>{if(t.declaredStatuses.includes(e.status))throw f(await d(e));try{await e.body?.cancel()}catch{}throw new o(`UnexpectedStatus`,{cause:{status:e.status},detail:String(e.status)})},a=async(e,t)=>{let n=await r(e,t);if(n.status!==e.successStatus)return i(n,e);if(e.binary)return new Uint8Array(await n.arrayBuffer());if(e.empty){try{await n.body?.cancel()}catch{}return}return await d(n)},c=(e,t)=>({async*[Symbol.asyncIterator](){let n=await r(e,t);if(n.status!==e.successStatus&&await i(n,e),!p(n,`text/event-stream`)){try{await n.body?.cancel()}catch{}throw new o(`UnsupportedContentType`,{detail:n.headers.get(`content-type`)})}if(n.body===null)throw new o(`MalformedResponse`);let a=n.body.getReader(),c=new TextDecoder,l=``;try{for(;;){let e;try{e=await a.read()}catch(e){throw new o(`Transport`,{cause:e})}if(e.done||t?.onActivity?.(),l+=c.decode(e.value,{stream:!e.done}),l.length>s)throw new o(`SseEventTooLarge`);let n=!e.done&&l.endsWith(`\r`);n&&(l=l.slice(0,-1)),l=l.replaceAll(`\r
2
+ `,`
3
+ `).replaceAll(`\r`,`
4
+ `),n&&(l+=`\r`),e.done&&l!==``&&(l+=`
5
+
6
+ `);let r=l.indexOf(`
7
+
8
+ `);for(;r>=0;){let e=l.slice(0,r);l=l.slice(r+2);let t=e.split(`
9
+ `).flatMap(e=>e.startsWith(`data:`)?[e.slice(5).trimStart()]:[]).join(`
10
+ `);if(t!==``)try{yield JSON.parse(t)}catch(e){throw new o(`MalformedResponse`,{cause:e})}r=l.indexOf(`
11
+
12
+ `)}if(e.done)return}}finally{try{await a.cancel()}catch{}a.releaseLock()}}});return{server:{info:e=>a({method:`GET`,path:`/api/info`,successStatus:200,declaredStatuses:[400,401],empty:!1},e),pair:e=>a({method:`POST`,path:`/api/pair`,successStatus:200,declaredStatuses:[400,401],empty:!1},e),connect:(e,t)=>a({method:`GET`,path:`/auth/connect/${encodeURIComponent(e.code)}`,successStatus:200,declaredStatuses:[400,401],empty:!1},t)},location:{get:(e,t)=>a({method:`GET`,path:`/api/location`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),reload:e=>a({method:`POST`,path:`/api/location/reload`,successStatus:204,declaredStatuses:[400,401,503],empty:!0},e)},agent:{list:(e,t)=>a({method:`GET`,path:`/api/agent`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),get:(e,t)=>a({method:`GET`,path:`/api/agent/${encodeURIComponent(e.agentID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},plugin:{list:(e,t)=>a({method:`GET`,path:`/api/plugin`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),gui:(e,t)=>a({method:`GET`,path:`/api/plugin/gui`,query:{location:e.location,id:e.id},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),check:(e,t)=>a({method:`POST`,path:`/api/plugin/check`,query:{location:e?.location},body:{target:e?.target},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),update:(e,t)=>a({method:`POST`,path:`/api/plugin/update`,query:{location:e.location},body:{targets:e.targets},successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t)},session:{list:(e,t)=>a({method:`GET`,path:`/api/session`,query:{limit:e?.limit,order:e?.order,search:e?.search,parentID:e?.parentID,archived:e?.archived,directory:e?.directory,project:e?.project,subpath:e?.subpath,cursor:e?.cursor},successStatus:200,declaredStatuses:[400,401],empty:!1},t),stats:(e,t)=>a({method:`GET`,path:`/api/experimental/session/stats`,query:{from:e?.from,to:e?.to,project:e?.project,timezone:e?.timezone,tools:e?.tools},successStatus:200,declaredStatuses:[400,401],empty:!1},t).then(e=>e.data),create:(e,t)=>a({method:`POST`,path:`/api/session`,body:{id:e?.id,parentID:e?.parentID,title:e?.title,agent:e?.agent,model:e?.model,location:e?.location,metadata:e?.metadata,permissions:e?.permissions},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),import:(e,t)=>a({method:`POST`,path:`/api/experimental/session/import`,body:{info:e.info,messages:e.messages,location:e.location},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(e=>e.data),export:(e,t)=>a({method:`GET`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/export`,query:{sanitize:e.sanitize},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then(e=>e.data),active:e=>a({method:`GET`,path:`/api/session/active`,successStatus:200,declaredStatuses:[400,401],empty:!1},e).then(e=>e.data),get:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),remove:(e,t)=>a({method:`DELETE`,path:`/api/session/${encodeURIComponent(e.sessionID)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),fork:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/fork`,body:{before:e.before},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),switchAgent:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/agent`,body:{agent:e.agent},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),switchModel:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/model`,body:{model:e.model},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),update:(e,t)=>a({method:`PATCH`,path:`/api/session/${encodeURIComponent(e.sessionID)}`,body:{title:e.title,metadata:e.metadata,permissions:e.permissions,archived:e.archived},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),move:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/move`,body:{directory:e.directory,delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),prompt:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/prompt`,body:{id:e.id,text:e.text,files:e.files,agents:e.agents,skills:e.skills,metadata:e.metadata,delivery:e.delivery,resume:e.resume},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(e=>e.data),command:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/command`,body:{name:e.name,text:e.text,files:e.files,agents:e.agents,skills:e.skills,delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404,500],empty:!0},t),skill:(e,t)=>a({method:`POST`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/skill`,body:{id:e.id,resume:e.resume},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),synthetic:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/synthetic`,body:{id:e.id,text:e.text,description:e.description,metadata:e.metadata,delivery:e.delivery,resume:e.resume},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(e=>e.data),shell:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/shell`,body:{id:e.id,command:e.command},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),compact:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/compact`,body:{id:e.id,delivery:e.delivery},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(e=>e.data),wait:(e,t)=>a({method:`POST`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/wait`,successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),revert:{stage:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/revert/stage`,body:{messageID:e.messageID,files:e.files},successStatus:200,declaredStatuses:[400,401,404,409,500],empty:!1},t).then(e=>e.data),clear:(e,t)=>a({method:`DELETE`,path:`/api/session/${encodeURIComponent(e.sessionID)}/revert`,successStatus:204,declaredStatuses:[400,401,404,409,500],empty:!0},t),commit:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/revert/commit`,successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},context:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/context`,successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then(e=>e.data),diff:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/diff`,query:{from:e.from,to:e.to,context:e.context},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t).then(e=>e.data),inbox:{list:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),cancel:(e,t)=>a({method:`DELETE`,path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox/${encodeURIComponent(e.inboxID)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),update:(e,t)=>a({method:`PATCH`,path:`/api/session/${encodeURIComponent(e.sessionID)}/inbox/${encodeURIComponent(e.inboxID)}`,body:{delivery:e.delivery},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},instructions:{entry:{list:(e,t)=>a({method:`GET`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),put:(e,t)=>a({method:`PUT`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries/${encodeURIComponent(e.key)}`,body:{value:e.value},successStatus:204,declaredStatuses:[400,401,404,413],empty:!0},t),remove:(e,t)=>a({method:`DELETE`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/instructions/entries/${encodeURIComponent(e.key)}`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},generate:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/generate`,body:{prompt:e.prompt},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(e=>e.data),log:(e,t)=>c({method:`GET`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/log`,query:{after:e.after,follow:e.follow},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),interrupt:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/interrupt`,query:{resume:e.resume},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),background:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/background`,successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),message:{get:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/message/${encodeURIComponent(e.messageID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data)},form:{list:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/form`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),create:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/form`,body:{id:e.id,title:e.title,metadata:e.metadata,fields:e.fields},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(e=>e.data),get:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),reply:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}/reply`,body:{answer:e.answer},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t),cancel:(e,t)=>a({method:`DELETE`,path:`/api/session/${encodeURIComponent(e.sessionID)}/form/${encodeURIComponent(e.formID)}`,query:{message:e.message},successStatus:204,declaredStatuses:[400,401,404,409],empty:!0},t)},environment:(e,t)=>a({method:`PUT`,path:`/api/session/${encodeURIComponent(e.sessionID)}/environment`,body:{variables:e.variables},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),view:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/view`,body:{idle:e.idle},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},message:{list:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/message`,query:{limit:e.limit,order:e.order,cursor:e.cursor,type:e.type},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t)},model:{list:(e,t)=>a({method:`GET`,path:`/api/model`,query:{location:e?.location,types:e?.types},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),default:(e,t)=>a({method:`GET`,path:`/api/model/default`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},generate:{text:(e,t)=>a({method:`POST`,path:`/api/experimental/generate/text`,body:{prompt:e.prompt,model:e.model},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then(e=>e.data),image:(e,t)=>a({method:`POST`,path:`/api/experimental/generate/image`,body:{model:e.model,prompt:e.prompt,images:e.images,n:e.n,aspect:e.aspect,resolution:e.resolution},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then(e=>e.data),decisions:(e,t)=>a({method:`POST`,path:`/api/experimental/generate/decisions`,body:{model:e.model,input:e.input,questions:e.questions},successStatus:200,declaredStatuses:[400,401,404,422,502,503],empty:!1},t).then(e=>e.data)},voice:{models:e=>a({method:`GET`,path:`/api/experimental/voice/models`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},e).then(e=>e.data),session:(e,t)=>a({method:`POST`,path:`/api/experimental/voice/session`,body:{model:e.model,session:e.session,transport:e.transport},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(e=>e.data)},provider:{list:(e,t)=>a({method:`GET`,path:`/api/provider`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),get:(e,t)=>a({method:`GET`,path:`/api/provider/${encodeURIComponent(e.providerID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},integration:{list:(e,t)=>a({method:`GET`,path:`/api/integration`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>a({method:`GET`,path:`/api/integration/${encodeURIComponent(e.integrationID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),wellknown:{add:(e,t)=>a({method:`POST`,path:`/api/experimental/integration/wellknown`,query:{location:e.location},body:{url:e.url},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},connect:{key:(e,t)=>a({method:`POST`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/key`,query:{location:e.location},body:{key:e.key,answer:e.answer,label:e.label},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),external:(e,t)=>a({method:`POST`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/external`,query:{location:e.location},body:{methodID:e.methodID,answer:e.answer,label:e.label},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},oauth:{connect:(e,t)=>a({method:`POST`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth`,query:{location:e.location},body:{methodID:e.methodID,answer:e.answer,label:e.label},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),status:(e,t)=>a({method:`GET`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),complete:(e,t)=>a({method:`POST`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}/complete`,query:{location:e.location},body:{code:e.code},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),cancel:(e,t)=>a({method:`DELETE`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/oauth/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},command:{connect:(e,t)=>a({method:`POST`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command`,query:{location:e.location},body:{methodID:e.methodID,label:e.label},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),status:(e,t)=>a({method:`GET`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),cancel:(e,t)=>a({method:`DELETE`,path:`/api/integration/${encodeURIComponent(e.integrationID)}/connect/command/${encodeURIComponent(e.attemptID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}},mcp:{list:(e,t)=>a({method:`GET`,path:`/api/mcp`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),add:(e,t)=>a({method:`PUT`,path:`/api/experimental/mcp/${encodeURIComponent(e.server)}`,query:{location:e.location},body:{config:e.config},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),remove:(e,t)=>a({method:`DELETE`,path:`/api/experimental/mcp/${encodeURIComponent(e.server)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),connect:(e,t)=>a({method:`POST`,path:`/api/experimental/mcp/${encodeURIComponent(e.server)}/connect`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),disconnect:(e,t)=>a({method:`POST`,path:`/api/experimental/mcp/${encodeURIComponent(e.server)}/disconnect`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),resource:{catalog:(e,t)=>a({method:`GET`,path:`/api/mcp/resource`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},client:{token:(e,t)=>a({method:`POST`,path:`/api/experimental/client-mcp/token`,query:{location:e.location,name:e.name},headers:{"x-opencode-ticket":e[`x-opencode-ticket`]},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t)}},credential:{list:e=>a({method:`GET`,path:`/api/credential`,successStatus:200,declaredStatuses:[400,401],empty:!1},e).then(e=>e.data),create:(e,t)=>a({method:`POST`,path:`/api/credential`,body:{id:e.id,integrationID:e.integrationID,label:e.label,value:e.value,activate:e.activate},successStatus:200,declaredStatuses:[400,401,409],empty:!1},t).then(e=>e.data),update:(e,t)=>a({method:`PATCH`,path:`/api/credential/${encodeURIComponent(e.credentialID)}`,body:{label:e.label},successStatus:204,declaredStatuses:[400,401],empty:!0},t),activate:(e,t)=>a({method:`POST`,path:`/api/credential/${encodeURIComponent(e.credentialID)}/activate`,successStatus:204,declaredStatuses:[400,401],empty:!0},t),remove:(e,t)=>a({method:`DELETE`,path:`/api/credential/${encodeURIComponent(e.credentialID)}`,successStatus:204,declaredStatuses:[400,401],empty:!0},t)},project:{list:(e,t)=>a({method:`GET`,path:`/api/project`,query:{archived:e?.archived},successStatus:200,declaredStatuses:[400,401],empty:!1},t),update:(e,t)=>a({method:`PATCH`,path:`/api/project/${encodeURIComponent(e.projectID)}`,body:{canonical:e.canonical,name:e.name,icon:e.icon,commands:e.commands},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},form:{list:(e,t)=>a({method:`GET`,path:`/api/form`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},permission:{request:{list:(e,t)=>a({method:`GET`,path:`/api/permission/request`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},saved:{list:(e,t)=>a({method:`GET`,path:`/api/permission/saved`,query:{projectID:e?.projectID},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),update:(e,t)=>a({method:`PATCH`,path:`/api/permission/saved/${encodeURIComponent(e.id)}`,body:{action:e.action,resource:e.resource},successStatus:200,declaredStatuses:[400,401,404,409],empty:!1},t).then(e=>e.data),remove:(e,t)=>a({method:`DELETE`,path:`/api/permission/saved/${encodeURIComponent(e.id)}`,successStatus:204,declaredStatuses:[400,401],empty:!0},t)},create:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/permission`,body:{id:e.id,action:e.action,resources:e.resources,save:e.save,metadata:e.metadata,source:e.source,agent:e.agent},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),list:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/permission`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),get:(e,t)=>a({method:`GET`,path:`/api/session/${encodeURIComponent(e.sessionID)}/permission/${encodeURIComponent(e.requestID)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},t).then(e=>e.data),reply:(e,t)=>a({method:`POST`,path:`/api/session/${encodeURIComponent(e.sessionID)}/permission/${encodeURIComponent(e.requestID)}/reply`,body:{decision:e.decision,message:e.message},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},file:{read:(e,t)=>a({method:`GET`,path:`/api/fs/read/${l(e.path)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1,binary:!0},t),list:(e,t)=>a({method:`GET`,path:`/api/fs/list`,query:{location:e?.location,path:e?.path},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),find:(e,t)=>a({method:`GET`,path:`/api/fs/find`,query:{location:e.location,query:e.query,type:e.type,limit:e.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),write:(e,t)=>a({method:`POST`,path:`/api/experimental/fs/write`,query:{location:e.location,path:e.path},body:e.payload,successStatus:200,declaredStatuses:[400,401,404],empty:!1,binaryBody:!0},t),watch:(e,t)=>a({method:`POST`,path:`/api/experimental/fs/watch`,query:{location:e.location},body:{path:e.path},successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),unwatch:(e,t)=>a({method:`DELETE`,path:`/api/experimental/fs/watch`,query:{location:e.location},body:{path:e.path},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},command:{list:(e,t)=>a({method:`GET`,path:`/api/command`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},skill:{list:(e,t)=>a({method:`GET`,path:`/api/skill`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},rpc:{call:(e,t)=>a({method:`POST`,path:`/api/rpc/${encodeURIComponent(e.rpcID)}/${encodeURIComponent(e.method)}`,query:{location:e.location},body:{input:e.input},successStatus:200,declaredStatuses:[400,401,404,500],empty:!1},t)},event:{subscribe:(e,t)=>c({method:`GET`,path:`/api/event`,query:{types:e?.types},successStatus:200,declaredStatuses:[400,401],empty:!1},t)},pty:{list:(e,t)=>a({method:`GET`,path:`/api/pty`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>a({method:`POST`,path:`/api/pty`,query:{location:e?.location},body:{command:e?.command,args:e?.args,cwd:e?.cwd,title:e?.title,env:e?.env},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>a({method:`GET`,path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),update:(e,t)=>a({method:`PUT`,path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},body:{title:e.title,size:e.size},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>a({method:`DELETE`,path:`/api/pty/${encodeURIComponent(e.ptyID)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),connect:{token:(e,t)=>a({method:`POST`,path:`/api/pty/${encodeURIComponent(e.ptyID)}/connect-token`,query:{location:e.location},headers:{"x-opencode-ticket":e[`x-opencode-ticket`]},successStatus:200,declaredStatuses:[400,401,403,404],empty:!1},t)}},experimental:{persistentPty:{read:(e,t)=>a({method:`GET`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal/read`,query:{lines:e.lines},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then(e=>e.data),list:(e,t)=>a({method:`GET`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal`,successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then(e=>e.data),create:(e,t)=>a({method:`POST`,path:`/api/experimental/session/${encodeURIComponent(e.sessionID)}/terminal`,body:{command:e.command,args:e.args,cwd:e.cwd,title:e.title,env:e.env,size:e.size},successStatus:200,declaredStatuses:[400,401,503],empty:!1},t).then(e=>e.data),shutdown:e=>a({method:`POST`,path:`/api/experimental/persistent-pty/shutdown`,successStatus:204,declaredStatuses:[400,401,503],empty:!0},e),handoff:e=>a({method:`POST`,path:`/api/experimental/persistent-pty/handoff`,successStatus:200,declaredStatuses:[400,401,503],empty:!1},e),get:(e,t)=>a({method:`GET`,path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(e=>e.data),update:(e,t)=>a({method:`PUT`,path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,body:{attachmentID:e.attachmentID,size:e.size},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(e=>e.data),snapshot:(e,t)=>a({method:`GET`,path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}/snapshot`,successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t).then(e=>e.data),remove:(e,t)=>a({method:`DELETE`,path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}`,successStatus:204,declaredStatuses:[400,401,404,503],empty:!0},t),connectToken:(e,t)=>a({method:`POST`,path:`/api/experimental/persistent-pty/${encodeURIComponent(e.ptyID)}/connect-token`,headers:{"x-opencode-ticket":e[`x-opencode-ticket`]},successStatus:200,declaredStatuses:[400,401,403,404,503],empty:!1},t).then(e=>e.data)},media:{get:(e,t)=>a({method:`GET`,path:`/api/experimental/media/${encodeURIComponent(e.hash)}`,successStatus:200,declaredStatuses:[400,401,404],empty:!1,binary:!0},t)}},shell:{list:(e,t)=>a({method:`GET`,path:`/api/shell`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>a({method:`POST`,path:`/api/shell`,query:{location:e.location},body:{command:e.command,cwd:e.cwd,timeout:e.timeout,metadata:e.metadata},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),get:(e,t)=>a({method:`GET`,path:`/api/shell/${encodeURIComponent(e.id)}`,query:{location:e.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),output:(e,t)=>a({method:`GET`,path:`/api/shell/${encodeURIComponent(e.id)}/output`,query:{location:e.location,cursor:e.cursor,limit:e.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>a({method:`DELETE`,path:`/api/shell/${encodeURIComponent(e.id)}`,query:{location:e.location},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},reference:{list:(e,t)=>a({method:`GET`,path:`/api/reference`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},worktree:{list:(e,t)=>a({method:`GET`,path:`/api/worktree`,query:{projectID:e.projectID},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),create:(e,t)=>a({method:`POST`,path:`/api/worktree`,body:{projectID:e.projectID,from:e.from,branch:e.branch,directory:e.directory,name:e.name},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),remove:(e,t)=>a({method:`DELETE`,path:`/api/worktree`,body:{projectID:e.projectID,directory:e.directory,force:e.force},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t),refresh:(e,t)=>a({method:`POST`,path:`/api/worktree/refresh`,body:{projectID:e.projectID},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)},vcs:{init:(e,t)=>a({method:`POST`,path:`/api/vcs/init`,query:{location:e?.location,provider:e?.provider},successStatus:204,declaredStatuses:[400,401,404,409,501,503],empty:!0},t),get:(e,t)=>a({method:`GET`,path:`/api/vcs`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),base:(e,t)=>a({method:`GET`,path:`/api/vcs/base`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),status:(e,t)=>a({method:`GET`,path:`/api/vcs/status`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),branch:{list:(e,t)=>a({method:`GET`,path:`/api/vcs/branch`,query:{location:e?.location,search:e?.search,limit:e?.limit},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t)},diff:(e,t)=>a({method:`GET`,path:`/api/vcs/diff`,query:{location:e.location,mode:e.mode,base:e.base,context:e.context,untracked:e.untracked},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},debug:{heapDump:(e,t)=>a({method:`POST`,path:`/api/debug/heap-dump`,query:{directory:e?.directory},successStatus:200,declaredStatuses:[400,401,500],empty:!1},t),location:{list:e=>a({method:`GET`,path:`/api/debug/location`,successStatus:200,declaredStatuses:[400,401],empty:!1},e),evict:(e,t)=>a({method:`DELETE`,path:`/api/debug/location`,query:{location:e?.location},successStatus:204,declaredStatuses:[400,401],empty:!0},t)}},migration:{v1:{status:e=>a({method:`GET`,path:`/api/experimental/migration/v1`,successStatus:200,declaredStatuses:[400,401],empty:!1},e)}},websearch:{providers:(e,t)=>a({method:`GET`,path:`/api/websearch/provider`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t),query:(e,t)=>a({method:`POST`,path:`/api/websearch`,query:{location:e.location},body:{query:e.query,providerID:e.providerID},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},usage:{limits:(e,t)=>a({method:`GET`,path:`/api/experimental/usage/limits`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404,503],empty:!1},t)},config:{get:(e,t)=>a({method:`GET`,path:`/api/config`,query:{location:e?.location},successStatus:200,declaredStatuses:[400,401,404],empty:!1},t),shells:e=>a({method:`GET`,path:`/api/config/shell`,successStatus:200,declaredStatuses:[400,401,404],empty:!1},e),update:(e,t)=>a({method:`PATCH`,path:`/api/experimental/config`,body:{shell:e.shell},successStatus:204,declaredStatuses:[400,401,404],empty:!0},t)}}}function l(e){return e.split(`/`).map(encodeURIComponent).join(`/`)}function u(e,t,n){if(n!==void 0){if(n===null){e.append(t,`null`);return}if(Array.isArray(n)){for(let r of n)u(e,t,r);return}if(typeof n==`object`){for(let[r,i]of Object.entries(n))u(e,`${t}[${r}]`,i);return}e.append(t,String(n))}}async function d(e){if(!p(e,`application/json`)&&!e.headers.get(`content-type`)?.includes(`+json`)){try{await e.body?.cancel()}catch{}throw new o(`UnsupportedContentType`,{detail:e.headers.get(`content-type`)})}let t;try{t=await e.text()}catch(e){throw new o(`Transport`,{cause:e})}if(t===``)throw new o(`MalformedResponse`);try{return JSON.parse(t)}catch(e){throw new o(`MalformedResponse`,{cause:e})}}function f(e){let t=Object.assign(Error(e.message??e.data?.message),e);return e._tag&&(t.name=e._tag),t}function p(e,t){return e.headers.get(`content-type`)?.split(`;`,1)[0]?.trim().toLowerCase()===t}var m=e=>typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`PermissionNotFoundError`,h=e=>typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`RpcError`,g=e=>typeof e==`object`&&!!e&&`_tag`in e&&e._tag===`RpcInternalError`;function _(e,t){return n=>{let r=(e,r)=>{if(!Object.hasOwn(n.events,e))throw Error(`Unknown RPC event: ${n.id}.${e}`);let i=v(n,e);return{[Symbol.asyncIterator](){let e=new AbortController,n=r?.signal?AbortSignal.any([e.signal,r.signal]):e.signal,a=async function*(){try{for await(let e of t.subscribe({signal:n})){if(n.aborted)return;e.type===i&&(yield e)}}catch(e){if(!n.aborted)throw e}finally{e.abort()}}();return{next:()=>a.next(),return:()=>(e.abort(),a.return())}}}};return Object.assign(Object.fromEntries(Object.keys(n.methods).map(t=>[t,async(r,i)=>{try{return(await e.rpc.call({rpcID:n.id,method:t,input:r,location:i?.location},{signal:i?.signal,headers:i?.headers})).output}catch(e){throw!h(e)&&!g(e)?e:e.data===void 0?{type:e.type,message:e.message}:{type:e.type,message:e.message,data:e.data}}}])),{events:{subscribe:r,on:(e,t,n)=>{let i=new AbortController,a=n?.signal?AbortSignal.any([i.signal,n.signal]):i.signal,o=r(e,{signal:a});return(async()=>{for await(let e of o)await t(e)})().catch(e=>console.error(e)),()=>i.abort()}}})}}function v(e,t){return`rpc.${e.id}.${t}`}var y={};r(y,{OpenCode:()=>y,make:()=>b});function b(e){let t=c(e),n=a((e,n)=>t.event.subscribe(void 0,{signal:e,onActivity:n}));return{...t,rpc:Object.assign(_(t,n),t.rpc),event:n}}export{m as n,o as r,y as t};