Lines 1-23javascript
1import{j as e,M as _n,P as at}from"./markdown-CaPdHFK5.js";import{r as c,v as In,ay as zt,h as je,a as me,b as Ie,ai as Be,X as Se,aB as it,aC as Bt,m as be,s as ot,L as Re,au as mt,F as lt,aD as ct,aE as Rn,D as Dn,t as On,N as Ln,aa as Mn,aF as jt,aG as $n,R as Ee,Y as Fn,a4 as Pn,aH as zn,x as Ut,aj as Ht,aI as Bn,av as Un,y as Hn,aJ as Gn,aK as qn,K as Wn,aL as Kn,ao as Jn,aM as Yn,aq as Xn,q as Zn,aN as Gt,C as Vn,aO as Qn,a0 as es,aP as ts,a2 as ns,u as ss,an as rs,af as as}from"./icons-CrV0VGFQ.js";import{i as Z,e as J,j as De,k as qt,w as W,l as dt,u as he,R as Wt,a as le,t as X,m as a ...
2`).replace(/\n{3,}/g,`
HighChild Process
Package source references child process execution.
web/dist/assets/SessionGrid-CC1NAZ45.jsView on unpkg · L1 4`);return e.jsx("div",{className:`markdown-content ${t}`,style:{wordBreak:"break-word"},children:e.jsx(_n,{components:{code({className:i,children:d,...p}){const x=/language-(\w+)/.exec(i||""),f=String(d).replace(/\n$/,"");return x&&x[1]?e.jsx(hs,{language:x[1],code:f}):e.jsx("code",{className:"bg-dark-hover px-1.5 py-0.5 rounded text-sm font-mono text-accent-blue",...p,children:d})},a({href:i,children:d}){return e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-accent-blue hover:underline",children:d})},table({children:i}){return e.jsx("div",{className:"overflow-x-aut ...
5`)){if(s.startsWith("---")||s.startsWith("+++")||s.startsWith("index ")||s.startsWith("diff --git")||s.startsWith("==="))continue;const a=s.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(a){n&&t.push(n),n={oldStart:parseInt(a[1],10),oldLines:parseInt(a[2]??"1",10),newStart:parseInt(a[3],10),newLines:parseInt(a[4]??"1",10),lines:[]};continue}if(!s.startsWith("\\")){if(n&&(s.startsWith("+")||s.startsWith("-")||s.startsWith(" ")||s==="")){n.lines.push(s);continue}n&&s&&(t.push(n),n=null)}}return n&&t.push(n),t}function Xt(r){let t=r.oldStart,n=r.newStart;const s=[];for(const a of r.lines ...
6`);let n=0,s=0,a=0;for(const l of t)l.startsWith("@@")?a++:l.startsWith("+")&&!l.startsWith("+++")?n++:l.startsWith("-")&&!l.startsWith("---")&&s++;return{additions:n,deletions:s,hunks:a,filesChanged:1}}function As(r){const t=[],n=(a,l)=>{if(!l)return;const u=t[t.length-1];u&&u.type===a?u.text+=l:t.push({type:a,text:l})},s=(a,l)=>{if(typeof a=="string"){n(l,a);return}const u=a.type||l;if(typeof a.content=="string"){n(u,a.content);return}for(const o of a.content)s(o,u)};for(const a of r)s(a,"");return t}function Zt(r,t){const n=at.languages[t];if(!n)return[{type:"",text:r}];try{return As(at.tok ...
7`)})]}),t.action&&e.jsxs("div",{className:"py-0.5 px-2 text-xs border-l-2 border-accent-yellow/40 bg-accent-yellow/5 rounded-r",children:[e.jsx("div",{className:"flex items-center gap-1 text-accent-yellow mb-0.5",children:"⚡ 执行"}),e.jsx("div",{className:"text-dark-text leading-snug font-mono text-[11px]",children:t.action})]}),t.toolCalls&&t.toolCalls.length>0&&t.toolCalls.map(g=>e.jsx("div",{className:"px-1 py-0.5",children:e.jsx(Qt,{toolCall:g})},g.id)),t.result&&e.jsxs("div",{className:"py-0.5 px-2 text-xs border-l-2 border-accent-green/40 bg-accent-green/5 rounded-r",children:[e.jsx("div", ...
8`),u=l.length>Xe||r.length>Ze;let o=r;!s&&u&&(o=l.slice(0,Xe).join(`
9`),o.length>Ze&&(o=`${o.slice(0,Ze).trimEnd()}…`));const i=s?n("showLess"):l.length>Xe?n("showAllLines",{n:l.length}):n("showAll");return e.jsxs("div",{className:`rounded-lg border border-dark-border bg-dark-surface p-2.5 text-xs leading-relaxed break-all whitespace-pre-wrap ${t?"font-mono":""} text-dark-text`,children:[o,u&&e.jsx("button",{type:"button",onClick:()=>a(d=>!d),className:"mt-1 block text-[11px] text-accent-blue hover:underline",children:i})]})}const Ve=15,Xs=c.memo(function({approval:t,onResolved:n}){const{t:s}=J("hook"),[a,l]=c.useState(!1),[u,o]=c.useState(Ve),i=c.useRef(null), ...
11`)})]})}const nr=c.memo(function({message:t,sessionId:n,onRegenerate:s,onDeleteMessage:a}){var h,v,R;const{t:l}=J(),u=ae(C=>{var A;if(!n||!C.generatingSessions.includes(n))return!1;const N=C.messagesBySession[n];return N?((A=N[N.length-1])==null?void 0:A.id)===t.id:!1}),o=c.useMemo(()=>t.thinkingBlocks&&t.thinkingBlocks.length>0?t.thinkingBlocks:t.thinking?[{index:Number.MIN_SAFE_INTEGER,text:t.thinking}]:[],[t.thinkingBlocks,t.thinking]),[i,d]=c.useState({}),p=c.useRef(u);c.useEffect(()=>{p.current&&!u&&d(C=>{const N={...C};for(const A of o)N[A.index]=!0;return N}),p.current=u},[u,o]);const x ...
13`)})}),e.jsx(Dt,{ts:t.timestamp,align:"right",children:e.jsx(Rt,{message:t,sessionId:n,onRegenerate:s,onDeleteMessage:a})})]})});if(b)return e.jsx("div",{className:"flex justify-center animate-fade-in-up px-1 py-1",children:e.jsx("div",{className:"text-[11px] text-dark-muted bg-dark-surface border border-dark-border/60 rounded-full px-3.5 py-1 max-w-[90%] text-center",children:t.content})});const w=!t.hookApproval&&!!(o.length>0||t.steps&&t.steps.length>0||t.toolCalls&&t.toolCalls.length>0);return e.jsx("div",{className:"group flex animate-fade-in-up px-1",children:e.jsxs("div",{className:"w-f ...
15`)})}):o.length===0&&!t.hookApproval&&((v=t.steps)!=null&&v.length)?null:o.length===0&&!t.hookApproval&&!((R=t.steps)!=null&&R.length)&&u?e.jsxs("div",{className:"flex items-center gap-3 py-1 text-xs text-dark-muted",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent-blue animate-blink"}),e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent-blue animate-blink",style:{animationDelay:"0.2s"}}),e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent-blue animate-blink",style:{animationDelay:"0.4s"}})]}),l(" ...
16`,t-1)+1,s=r.slice(n,t);return s.startsWith("/")?/\s/.test(s)?{active:!1,query:""}:{active:!0,query:s.slice(1)}:{active:!1,query:""}}const Cr=c.memo(function({sessionId:t,onSend:n,onStop:s,onPause:a,onResume:l,slashOptions:u}){const{t:o}=J(),i=ae(m=>{var k;return((k=m.sessionInputs)==null?void 0:k[t])??""}),d=ae(m=>m.setSessionInput),p=ae(m=>{var k;return((k=m.generatingSessions)==null?void 0:k.includes(t))??!1}),x=ae(m=>{var k;return((k=m.pausedSessions)==null?void 0:k.includes(t))??!1}),f=c.useRef(null),g=c.useRef(null),b=c.useRef(!1),[y,w]=c.useState([]),[h,v]=c.useState(!1),[R,C]=c.useStat ...
17`,S-1)+1,O=i.slice(0,_)+`/${m.name} `+i.slice(S);N(O),E(),requestAnimationFrame(()=>{k==null||k.focus();const I=_+m.name.length+2;k&&(k.selectionStart=k.selectionEnd=I)})},[i,N,H,E]),bn=c.useCallback(m=>{const k=f.current,S=(k==null?void 0:k.selectionStart)??i.length,_=`$${m.id} `,O=i.slice(0,S)+_+i.slice(S);N(O),C(!1),xe.current=!1,re(!1),K(""),requestAnimationFrame(()=>{k==null||k.focus();const I=S+_.length;k&&(k.selectionStart=k.selectionEnd=I)})},[i,N]),Ne=c.useCallback(m=>{const k=Array.from(m);w(S=>{const _=Pe-S.length,O=S.slice();for(const I of k.slice(0,_)){if(!Lt.test(I.name)){X.warni ...
20`:""},[y,o]),En=c.useCallback(m=>{const k=m.clipboardData.getData("text/plain");if(m.clipboardData.files&&m.clipboardData.files.length>0){m.preventDefault(),Ne(m.clipboardData.files);return}if(!k||!pr(k))return;m.preventDefault();const{label:S}=xr(k),_=f.current;if(!_)return;const O=_.selectionStart,I=_.selectionEnd,z=_.value,B=z.slice(0,O)+S+z.slice(I);N(B),requestAnimationFrame(()=>{_.selectionStart=_.selectionEnd=O+S.length})},[N,Ne]),Me=c.useCallback(async()=>{const m=mr(i);xe.current=!1,re(!1),E();const k=m.trim(),S=y.length>0;if(!k&&!S)return;const _=m.trim();if(_.startsWith("/")&&!S){co ...
21 resize-none focus:outline-none min-h-[44px] max-h-[40vh] leading-relaxed
22 disabled:opacity-50 disabled:cursor-not-allowed`}),e.jsxs("div",{className:"flex items-center gap-2 px-2.5 pb-2.5",children:[e.jsx(ar,{}),e.jsx("span",{className:"hidden sm:block",children:e.jsx(ir,{})}),e.jsx("div",{className:"flex-1"}),Ge>0&&i.length>0&&e.jsxs("span",{className:`text-[10px] tabular-nums ${vt?"text-accent-red font-medium":"text-dark-muted/60"}`,children:["~",Ge," tokens",vt?` · ${o("chat.nearLimit")}`:""]}),!p&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button"
23 hover:bg-dark-hover hover:text-dark-text disabled:opacity-40`,title:o("stt.langToggle"),"aria-label":o("stt.langToggle"),children:A==="en"?"EN":"中"}),e.jsx("button",{onClick:()=>void de(),disabled:D.state==="transcribing",className:Z("flex h-8 w-8 items-center justify-center rounded-full text-dark-muted transition-colors",D.state==="recording"?"bg-accent-red/15 text-accent-red animate-pulse":"hover:bg-dark-hover hover:text-dark-text","disabled:opacity-40 disabled:cursor-not-allowed"),title:D.state==="recording"?o("stt.stopTitle"):o(
Long lines were clipped for display.