@kafca/agentdock 0.1.29 → 0.1.30

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 (55) hide show
  1. package/dist/renderer/assets/{Badge-ngf0eCzI.js → Badge-DlVJI1Ys.js} +1 -1
  2. package/dist/renderer/assets/{Chat-tCGY5odh.js → Chat-oa8OjaHQ.js} +1 -1
  3. package/dist/renderer/assets/{ChatMarkdown-vqDWgVNb.js → ChatMarkdown-C-N8KS5C.js} +1 -1
  4. package/dist/renderer/assets/{Config-YsVDQmIs.js → Config-D9sL_d4D.js} +1 -1
  5. package/dist/renderer/assets/{CronList-DQN0T7Yc.js → CronList-Z5JU3DHk.js} +1 -1
  6. package/dist/renderer/assets/{Dashboard-C2O6Yxq3.js → Dashboard-D3BwbG43.js} +2 -2
  7. package/dist/renderer/assets/{EmptyState-CTkA-fBQ.js → EmptyState-QOj765Ul.js} +1 -1
  8. package/dist/renderer/assets/{KnowledgeDetail-DjLZDItQ.js → KnowledgeDetail-J7n01mPu.js} +1 -1
  9. package/dist/renderer/assets/{KnowledgeHome-2NHeRZxW.js → KnowledgeHome-BFnH0NVk.js} +1 -1
  10. package/dist/renderer/assets/{Logs-CQ6j-Sct.js → Logs-DfSUifXc.js} +1 -1
  11. package/dist/renderer/assets/{Modal-9g1uWJfC.js → Modal-QjEGhyru.js} +1 -1
  12. package/dist/renderer/assets/{Page-B4mPLn6n.js → Page-qdHFSw7x.js} +1 -1
  13. package/dist/renderer/assets/{ProjectDetail-pBXOAeL4.js → ProjectDetail-DS_rfvhh.js} +1 -1
  14. package/dist/renderer/assets/{ProjectList-B9PYfZaS.js → ProjectList-COtyZd7H.js} +1 -1
  15. package/dist/renderer/assets/{Select-BWFQJ2R8.js → Select-BQ8mncVu.js} +1 -1
  16. package/dist/renderer/assets/{SessionChat-fBrzJs3A.js → SessionChat-DjVnjuQy.js} +1 -1
  17. package/dist/renderer/assets/{SessionList-DjHOsk7X.js → SessionList-88dgGZJ8.js} +1 -1
  18. package/dist/renderer/assets/{ThreadChat-MagPeJD0.js → ThreadChat-BCdbTxBo.js} +1 -1
  19. package/dist/renderer/assets/{Workspace-nfTcxlhw.js → Workspace-D_hzSJjX.js} +1 -1
  20. package/dist/renderer/assets/{arrow-left-CIWZ6JEB.js → arrow-left-BMpknulW.js} +1 -1
  21. package/dist/renderer/assets/{book-open-Ck6BgBhN.js → book-open-CiaOeQbU.js} +1 -1
  22. package/dist/renderer/assets/{check-CtB2ZLVE.js → check-CgwYH4GF.js} +1 -1
  23. package/dist/renderer/assets/{chevron-down--8lODnN0.js → chevron-down-BzD2S1OO.js} +1 -1
  24. package/dist/renderer/assets/{circle-CKQOJcbh.js → circle-BDHD7g7l.js} +1 -1
  25. package/dist/renderer/assets/{desktop-Do2I28CT.js → desktop-BiR5LPL5.js} +1 -1
  26. package/dist/renderer/assets/{funnel-CkZuFIwa.js → funnel-Bruf5FYA.js} +1 -1
  27. package/dist/renderer/assets/{heart-CAX_CqFQ.js → heart-D7Mz04B0.js} +1 -1
  28. package/dist/renderer/assets/{index-DvAYflFj.js → index-CL1e8m3U.js} +2 -2
  29. package/dist/renderer/assets/{index--_L0Y77h.js → index-gZIRr4_o.js} +1 -1
  30. package/dist/renderer/assets/{pencil-sIRhtchu.js → pencil-C6gzDMse.js} +1 -1
  31. package/dist/renderer/assets/{play-CJNRbCL5.js → play-DqTXX-Pr.js} +1 -1
  32. package/dist/renderer/assets/{plug-DsFe9GBx.js → plug-ykmbeaO3.js} +1 -1
  33. package/dist/renderer/assets/{plus-KDwEI-Rs.js → plus-DHE60vMX.js} +1 -1
  34. package/dist/renderer/assets/projects-Bx5p10th.js +1 -0
  35. package/dist/renderer/assets/{save-C-p5r3K-.js → save-CGIvrdQI.js} +1 -1
  36. package/dist/renderer/assets/{search-BZxQJb2k.js → search-D7IFAwyE.js} +1 -1
  37. package/dist/renderer/assets/{server-BV-K022I.js → server-aOsirp7I.js} +1 -1
  38. package/dist/renderer/assets/{session-utils-ClQTa8yS.js → session-utils-Dxfp4ohQ.js} +1 -1
  39. package/dist/renderer/assets/{sessions-B0FSCA9O.js → sessions-Db1XPbG2.js} +1 -1
  40. package/dist/renderer/assets/{shield-check-B6AjkXUd.js → shield-check-ChXeQK-d.js} +1 -1
  41. package/dist/renderer/assets/{trash-2-41Pv4qRx.js → trash-2-CfN-c1zw.js} +1 -1
  42. package/dist/renderer/assets/{user-NKKHCKm9.js → user-C7OHaBp4.js} +1 -1
  43. package/dist/renderer/assets/{wifi-off-E1ZNhLG5.js → wifi-off-CpaJigye.js} +1 -1
  44. package/dist/renderer/index.html +1 -1
  45. package/dist-electron/electron/local-core-refactor.test.js +301 -18
  46. package/dist-electron/electron/workspace-task-store.test.js +7 -1
  47. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-backend.js +7 -2
  48. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-progress.js +239 -7
  49. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-session-coordinator.js +10 -6
  50. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-transport.js +1 -0
  51. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-turn-coordinator.js +79 -2
  52. package/dist-electron/services/local-ai-core/src/channel/lark/runtime-state.js +1 -1
  53. package/dist-electron/services/local-ai-core/src/channel/weixin/local-core-weixin-gateway.js +13 -1
  54. package/package.json +1 -1
  55. package/dist/renderer/assets/projects-CJUs2vaq.js +0 -1
@@ -1,4 +1,4 @@
1
- import{G as Te,aK as Ae,r as c,j as x,aL as pe,aM as Ne,aA as te}from"./index-DvAYflFj.js";var ye=Ae();const De=Te(ye);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jt(e,t){const n=c.createContext(t),r=i=>{const{children:s,...a}=i,h=c.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:h,children:s})};r.displayName=e+"Provider";function o(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function en(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),h=n.length;n=[...n,s];const l=d=>{var p;const{scope:v,children:y,...w}=d,u=((p=v==null?void 0:v[e])==null?void 0:p[h])||a,m=c.useMemo(()=>w,Object.values(w));return x.jsx(u.Provider,{value:m,children:y})};l.displayName=i+"Provider";function f(d,v){var u;const y=((u=v==null?void 0:v[e])==null?void 0:u[h])||a,w=c.useContext(y);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const h=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:h}}),[a,h])}};return o.scopeName=e,[r,ke(o,...t)]}function ke(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:h,scopeName:l})=>{const d=h(i)[`__scope${l}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ne=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Me=pe[" useId ".trim().toString()]||(()=>{}),Fe=0;function tn(e){const[t,n]=c.useState(Me());return ne(()=>{n(r=>r??String(Fe++))},[e]),e||(t?`radix-${t}`:"")}var Ie=pe[" useInsertionEffect ".trim().toString()]||ne;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=We({defaultProp:t,onChange:n}),a=e!==void 0,h=a?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const l=c.useCallback(f=>{var d;if(a){const v=Be(f)?f(e):f;v!==e&&((d=s.current)==null||d.call(s,v))}else i(f)},[a,e,i,s]);return[h,l]}function We({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return Ie(()=>{i.current=t},[t]),c.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Be(e){return typeof e=="function"}function _e(e){const t=je(e),n=c.forwardRef((r,o)=>{const{children:i,...s}=r,a=c.Children.toArray(i),h=a.find($e);if(h){const l=h.props.children,f=a.map(d=>d===h?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...s,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return x.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function je(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const s=Ke(o),a=Ve(i,o.props);return o.type!==c.Fragment&&(a.ref=r?Ne(r,s):s),c.cloneElement(o,a)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ue=Symbol("radix.slottable");function $e(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ue}function Ve(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const h=i(...a);return o(...a),h}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ke(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=Xe.reduce((e,t)=>{const n=_e(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:s,...a}=o,h=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(h,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ye(e,t){e&&ye.flushSync(()=>e.dispatchEvent(t))}function F(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function He(e,t=globalThis==null?void 0:globalThis.document){const n=F(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ze="DismissableLayer",J="dismissableLayer.update",Ge="dismissableLayer.pointerDownOutside",Ze="dismissableLayer.focusOutside",oe,Ee=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qe=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...h}=e,l=c.useContext(Ee),[f,d]=c.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=c.useState({}),w=te(t,E=>d(E)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),p=u.indexOf(m),g=f?u.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,S=g>=p,C=et(E=>{const L=E.target,T=[...l.branches].some(M=>M.contains(L));!S||T||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())},v),P=tt(E=>{const L=E.target;[...l.branches].some(M=>M.contains(L))||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())},v);return He(E=>{g===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},v),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(oe=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),ae(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=oe)}},[f,v,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),ae())},[f,l]),c.useEffect(()=>{const E=()=>y({});return document.addEventListener(J,E),()=>document.removeEventListener(J,E)},[]),x.jsx(V.div,{...h,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,P.onFocusCapture),onBlurCapture:X(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,C.onPointerDownCapture)})});qe.displayName=ze;var Qe="DismissableLayerBranch",Je=c.forwardRef((e,t)=>{const n=c.useContext(Ee),r=c.useRef(null),o=te(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(V.div,{...e,ref:o})});Je.displayName=Qe;function et(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let h=function(){ge(Ge,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tt(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ge(Ze,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ae(){const e=new CustomEvent(J);document.dispatchEvent(e)}function ge(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ye(o,i):o.dispatchEvent(i)}var Y="focusScope.autoFocusOnMount",H="focusScope.autoFocusOnUnmount",ce={bubbles:!1,cancelable:!0},nt="FocusScope",rt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,h]=c.useState(null),l=F(o),f=F(i),d=c.useRef(null),v=te(t,u=>h(u)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(y.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:O(d.current,{select:!0})},m=function(b){if(y.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||O(d.current,{select:!0}))},p=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&O(a)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const g=new MutationObserver(p);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),g.disconnect()}}},[r,a,y.paused]),c.useEffect(()=>{if(a){se.add(y);const u=document.activeElement;if(!a.contains(u)){const p=new CustomEvent(Y,ce);a.addEventListener(Y,l),a.dispatchEvent(p),p.defaultPrevented||(ot(ut(be(a)),{select:!0}),document.activeElement===u&&O(a))}return()=>{a.removeEventListener(Y,l),setTimeout(()=>{const p=new CustomEvent(H,ce);a.addEventListener(H,f),a.dispatchEvent(p),p.defaultPrevented||O(u??document.body,{select:!0}),a.removeEventListener(H,f),se.remove(y)},0)}}},[a,l,f,y]);const w=c.useCallback(u=>{if(!n&&!r||y.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,p=document.activeElement;if(m&&p){const g=u.currentTarget,[b,S]=at(g);b&&S?!u.shiftKey&&p===S?(u.preventDefault(),n&&O(b,{select:!0})):u.shiftKey&&p===b&&(u.preventDefault(),n&&O(S,{select:!0})):p===g&&u.preventDefault()}},[n,r,y.paused]);return x.jsx(V.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});rt.displayName=nt;function ot(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function at(e){const t=be(e),n=ie(t,e),r=ie(t.reverse(),e);return[n,r]}function be(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ie(e,t){for(const n of e)if(!ct(n,{upTo:t}))return n}function ct(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function it(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var se=st();function st(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ue(e,t),e.unshift(t)},remove(t){var n;e=ue(e,t),(n=e[0])==null||n.resume()}}}function ue(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var lt="Portal",ft=c.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=c.useState(!1);ne(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?De.createPortal(x.jsx(V.div,{...r,ref:t}),s):null});ft.displayName=lt;var z=0;function rn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??le()),document.body.insertAdjacentElement("beforeend",e[1]??le()),z++,()=>{z===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),z--}},[])}function le(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",vt="with-scroll-bars-hidden",ht="--removed-body-scroll-bar-size";function G(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var pt=typeof window<"u"?c.useLayoutEffect:c.useEffect,fe=new WeakMap;function yt(e,t){var n=mt(null,function(r){return e.forEach(function(o){return G(o,r)})});return pt(function(){var r=fe.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||G(a,null)}),i.forEach(function(a){o.has(a)||G(a,s)})}fe.set(n,e)},[e]),n}function Et(e){return e}function gt(e,t){t===void 0&&(t=Et);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var h=function(){var f=s;s=[],f.forEach(i)},l=function(){return Promise.resolve().then(h)};l(),n={push:function(f){s.push(f),l()},filter:function(f){return s=s.filter(f),n}}}};return o}function bt(e){e===void 0&&(e={});var t=gt(null);return t.options=R({async:!0,ssr:!1},e),t}var we=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};we.isSideCarExport=!0;function St(e,t){return e.useMedium(t),we}var Ce=bt(),Z=function(){},K=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Z,onWheelCapture:Z,onTouchMoveCapture:Z}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,h=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,p=e.as,g=p===void 0?"div":p,b=e.gapMode,S=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,P=yt([n,t]),E=R(R({},S),o);return c.createElement(c.Fragment,null,f&&c.createElement(C,{sideCar:Ce,removeScrollBar:l,shards:d,noRelative:y,noIsolation:w,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(a),R(R({},E),{ref:P})):c.createElement(g,R({},E,{className:h,ref:P}),a))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var wt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ct(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wt();return t&&e.setAttribute("nonce",t),e}function Pt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ct())&&(Pt(t,n),Rt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=xt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pe=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Lt={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Tt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[q(n),q(r),q(o)]},At=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Lt;var t=Tt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nt=Pe(),k="data-scroll-locked",Dt=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
1
+ import{G as Te,aK as Ae,r as c,j as x,aL as pe,aM as Ne,aA as te}from"./index-CL1e8m3U.js";var ye=Ae();const De=Te(ye);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jt(e,t){const n=c.createContext(t),r=i=>{const{children:s,...a}=i,h=c.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:h,children:s})};r.displayName=e+"Provider";function o(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function en(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),h=n.length;n=[...n,s];const l=d=>{var p;const{scope:v,children:y,...w}=d,u=((p=v==null?void 0:v[e])==null?void 0:p[h])||a,m=c.useMemo(()=>w,Object.values(w));return x.jsx(u.Provider,{value:m,children:y})};l.displayName=i+"Provider";function f(d,v){var u;const y=((u=v==null?void 0:v[e])==null?void 0:u[h])||a,w=c.useContext(y);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const h=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:h}}),[a,h])}};return o.scopeName=e,[r,ke(o,...t)]}function ke(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:h,scopeName:l})=>{const d=h(i)[`__scope${l}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ne=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Me=pe[" useId ".trim().toString()]||(()=>{}),Fe=0;function tn(e){const[t,n]=c.useState(Me());return ne(()=>{n(r=>r??String(Fe++))},[e]),e||(t?`radix-${t}`:"")}var Ie=pe[" useInsertionEffect ".trim().toString()]||ne;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=We({defaultProp:t,onChange:n}),a=e!==void 0,h=a?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const l=c.useCallback(f=>{var d;if(a){const v=Be(f)?f(e):f;v!==e&&((d=s.current)==null||d.call(s,v))}else i(f)},[a,e,i,s]);return[h,l]}function We({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return Ie(()=>{i.current=t},[t]),c.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Be(e){return typeof e=="function"}function _e(e){const t=je(e),n=c.forwardRef((r,o)=>{const{children:i,...s}=r,a=c.Children.toArray(i),h=a.find($e);if(h){const l=h.props.children,f=a.map(d=>d===h?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...s,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return x.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function je(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const s=Ke(o),a=Ve(i,o.props);return o.type!==c.Fragment&&(a.ref=r?Ne(r,s):s),c.cloneElement(o,a)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ue=Symbol("radix.slottable");function $e(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ue}function Ve(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const h=i(...a);return o(...a),h}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ke(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=Xe.reduce((e,t)=>{const n=_e(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:s,...a}=o,h=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(h,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ye(e,t){e&&ye.flushSync(()=>e.dispatchEvent(t))}function F(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function He(e,t=globalThis==null?void 0:globalThis.document){const n=F(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ze="DismissableLayer",J="dismissableLayer.update",Ge="dismissableLayer.pointerDownOutside",Ze="dismissableLayer.focusOutside",oe,Ee=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qe=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...h}=e,l=c.useContext(Ee),[f,d]=c.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=c.useState({}),w=te(t,E=>d(E)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),p=u.indexOf(m),g=f?u.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,S=g>=p,C=et(E=>{const L=E.target,T=[...l.branches].some(M=>M.contains(L));!S||T||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())},v),P=tt(E=>{const L=E.target;[...l.branches].some(M=>M.contains(L))||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())},v);return He(E=>{g===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},v),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(oe=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),ae(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=oe)}},[f,v,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),ae())},[f,l]),c.useEffect(()=>{const E=()=>y({});return document.addEventListener(J,E),()=>document.removeEventListener(J,E)},[]),x.jsx(V.div,{...h,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,P.onFocusCapture),onBlurCapture:X(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,C.onPointerDownCapture)})});qe.displayName=ze;var Qe="DismissableLayerBranch",Je=c.forwardRef((e,t)=>{const n=c.useContext(Ee),r=c.useRef(null),o=te(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(V.div,{...e,ref:o})});Je.displayName=Qe;function et(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let h=function(){ge(Ge,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tt(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ge(Ze,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ae(){const e=new CustomEvent(J);document.dispatchEvent(e)}function ge(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ye(o,i):o.dispatchEvent(i)}var Y="focusScope.autoFocusOnMount",H="focusScope.autoFocusOnUnmount",ce={bubbles:!1,cancelable:!0},nt="FocusScope",rt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,h]=c.useState(null),l=F(o),f=F(i),d=c.useRef(null),v=te(t,u=>h(u)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(y.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:O(d.current,{select:!0})},m=function(b){if(y.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||O(d.current,{select:!0}))},p=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&O(a)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const g=new MutationObserver(p);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),g.disconnect()}}},[r,a,y.paused]),c.useEffect(()=>{if(a){se.add(y);const u=document.activeElement;if(!a.contains(u)){const p=new CustomEvent(Y,ce);a.addEventListener(Y,l),a.dispatchEvent(p),p.defaultPrevented||(ot(ut(be(a)),{select:!0}),document.activeElement===u&&O(a))}return()=>{a.removeEventListener(Y,l),setTimeout(()=>{const p=new CustomEvent(H,ce);a.addEventListener(H,f),a.dispatchEvent(p),p.defaultPrevented||O(u??document.body,{select:!0}),a.removeEventListener(H,f),se.remove(y)},0)}}},[a,l,f,y]);const w=c.useCallback(u=>{if(!n&&!r||y.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,p=document.activeElement;if(m&&p){const g=u.currentTarget,[b,S]=at(g);b&&S?!u.shiftKey&&p===S?(u.preventDefault(),n&&O(b,{select:!0})):u.shiftKey&&p===b&&(u.preventDefault(),n&&O(S,{select:!0})):p===g&&u.preventDefault()}},[n,r,y.paused]);return x.jsx(V.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});rt.displayName=nt;function ot(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function at(e){const t=be(e),n=ie(t,e),r=ie(t.reverse(),e);return[n,r]}function be(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ie(e,t){for(const n of e)if(!ct(n,{upTo:t}))return n}function ct(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function it(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var se=st();function st(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ue(e,t),e.unshift(t)},remove(t){var n;e=ue(e,t),(n=e[0])==null||n.resume()}}}function ue(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var lt="Portal",ft=c.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=c.useState(!1);ne(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?De.createPortal(x.jsx(V.div,{...r,ref:t}),s):null});ft.displayName=lt;var z=0;function rn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??le()),document.body.insertAdjacentElement("beforeend",e[1]??le()),z++,()=>{z===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),z--}},[])}function le(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",vt="with-scroll-bars-hidden",ht="--removed-body-scroll-bar-size";function G(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var pt=typeof window<"u"?c.useLayoutEffect:c.useEffect,fe=new WeakMap;function yt(e,t){var n=mt(null,function(r){return e.forEach(function(o){return G(o,r)})});return pt(function(){var r=fe.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||G(a,null)}),i.forEach(function(a){o.has(a)||G(a,s)})}fe.set(n,e)},[e]),n}function Et(e){return e}function gt(e,t){t===void 0&&(t=Et);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var h=function(){var f=s;s=[],f.forEach(i)},l=function(){return Promise.resolve().then(h)};l(),n={push:function(f){s.push(f),l()},filter:function(f){return s=s.filter(f),n}}}};return o}function bt(e){e===void 0&&(e={});var t=gt(null);return t.options=R({async:!0,ssr:!1},e),t}var we=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};we.isSideCarExport=!0;function St(e,t){return e.useMedium(t),we}var Ce=bt(),Z=function(){},K=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Z,onWheelCapture:Z,onTouchMoveCapture:Z}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,h=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,p=e.as,g=p===void 0?"div":p,b=e.gapMode,S=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,P=yt([n,t]),E=R(R({},S),o);return c.createElement(c.Fragment,null,f&&c.createElement(C,{sideCar:Ce,removeScrollBar:l,shards:d,noRelative:y,noIsolation:w,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(a),R(R({},E),{ref:P})):c.createElement(g,R({},E,{className:h,ref:P}),a))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var wt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ct(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wt();return t&&e.setAttribute("nonce",t),e}function Pt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ct())&&(Pt(t,n),Rt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=xt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pe=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Lt={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Tt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[q(n),q(r),q(o)]},At=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Lt;var t=Tt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nt=Pe(),k="data-scroll-locked",Dt=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
2
2
  .`.concat(vt,` {
3
3
  overflow: hidden `).concat(r,`;
4
4
  padding-right: `).concat(a,"px ").concat(r,`;
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-DvAYflFj.js";/**
1
+ import{c as a}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-DvAYflFj.js";/**
1
+ import{c as o}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-DvAYflFj.js";/**
1
+ import{c as o}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-DvAYflFj.js";/**
1
+ import{c as e}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{z as t}from"./index-CL1e8m3U.js";const e=()=>t.get("/projects"),r=o=>t.get(`/projects/${o}`);export{r as g,e as l};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-DvAYflFj.js";/**
1
+ import{c as a}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-DvAYflFj.js";/**
1
+ import{c}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-DvAYflFj.js";/**
1
+ import{c as e}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-DvAYflFj.js";/**
1
+ import{c as o}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{z as o}from"./index-DvAYflFj.js";const i=s=>o.get(`/projects/${s}/sessions`),c=(s,e,t)=>o.get(`/projects/${s}/sessions/${e}`,{history_limit:String(t)}),r=(s,e,t)=>o.patch(`/projects/${s}/sessions/${e}`,t),a=(s,e)=>o.delete(`/projects/${s}/sessions/${e}`),p=(s,e)=>o.post(`/projects/${s}/sessions/switch`,e),$=(s,e)=>o.post(`/projects/${s}/send`,e);export{$ as a,a as d,c as g,i as l,r,p as s};
1
+ import{z as o}from"./index-CL1e8m3U.js";const i=s=>o.get(`/projects/${s}/sessions`),c=(s,e,t)=>o.get(`/projects/${s}/sessions/${e}`,{history_limit:String(t)}),r=(s,e,t)=>o.patch(`/projects/${s}/sessions/${e}`,t),a=(s,e)=>o.delete(`/projects/${s}/sessions/${e}`),p=(s,e)=>o.post(`/projects/${s}/sessions/switch`,e),$=(s,e)=>o.post(`/projects/${s}/send`,e);export{$ as a,a as d,c as g,i as l,r,p as s};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-DvAYflFj.js";/**
1
+ import{c}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-DvAYflFj.js";/**
1
+ import{c as e}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-DvAYflFj.js";/**
1
+ import{c as e}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-DvAYflFj.js";/**
1
+ import{c as a}from"./index-CL1e8m3U.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>AgentDock</title>
8
- <script type="module" crossorigin src="./assets/index-DvAYflFj.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-CL1e8m3U.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="./assets/index-DFiJR0vv.css">
10
10
  </head>
11
11
  <body class="bg-[#f5f5f7] dark:bg-[#151516]">
@@ -458,6 +458,7 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
458
458
  });
459
459
  (0, node_test_1.default)('ACP progress projection applies assistant and thought chunks with bridge metadata', () => {
460
460
  const currentTurn = {
461
+ runId: 'run-1',
461
462
  previewHandle: 'preview-1',
462
463
  thoughtPreviewHandle: 'thought-preview-1',
463
464
  thoughtMessageId: 'run-1-thought',
@@ -492,9 +493,11 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
492
493
  content: '先理解,再修改',
493
494
  bridgeKind: 'thought',
494
495
  });
496
+ strict_1.default.equal(currentTurn.thoughtText, '先理解,再修改');
495
497
  });
496
498
  (0, node_test_1.default)('ACP thought chunks merge provider snapshots without duplicating text', () => {
497
499
  const currentTurn = {
500
+ runId: 'run-1',
498
501
  thoughtPreviewHandle: 'thought-preview-1',
499
502
  thoughtMessageId: 'run-1-thought',
500
503
  thoughtText: '',
@@ -516,6 +519,35 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
516
519
  });
517
520
  strict_1.default.equal(currentTurn.thoughtText, 'The user wants to see their desktop files. Let me show them.');
518
521
  });
522
+ (0, node_test_1.default)('ACP thought segment close starts a new streaming preview for web and app', () => {
523
+ const currentTurn = {
524
+ runId: 'run-1',
525
+ thoughtPreviewHandle: 'thought-preview-1',
526
+ thoughtMessageId: 'run-1-thought-1',
527
+ thoughtText: '',
528
+ thoughtSequence: 1,
529
+ thoughtPreviewStarted: false,
530
+ };
531
+ strict_1.default.deepEqual((0, local_core_acp_progress_js_1.applyThoughtChunk)(currentTurn, 'first thought'), {
532
+ bridgeType: 'preview_start',
533
+ previewHandle: 'thought-preview-1',
534
+ messageId: 'run-1-thought-1',
535
+ content: 'first thought',
536
+ bridgeKind: 'thought',
537
+ });
538
+ (0, local_core_acp_progress_js_1.closeThoughtSegment)(currentTurn);
539
+ strict_1.default.equal(currentTurn.thoughtText, '');
540
+ strict_1.default.equal(currentTurn.thoughtPreviewStarted, false);
541
+ strict_1.default.equal(currentTurn.thoughtMessageId, 'run-1-thought-2');
542
+ strict_1.default.equal(currentTurn.thoughtPreviewHandle, 'run-1-thought-preview-2');
543
+ strict_1.default.deepEqual((0, local_core_acp_progress_js_1.applyThoughtChunk)(currentTurn, 'second thought'), {
544
+ bridgeType: 'preview_start',
545
+ previewHandle: 'run-1-thought-preview-2',
546
+ messageId: 'run-1-thought-2',
547
+ content: 'second thought',
548
+ bridgeKind: 'thought',
549
+ });
550
+ });
519
551
  (0, node_test_1.default)('ACP progress projection registers pending tool calls in order', () => {
520
552
  const currentTurn = {
521
553
  toolCallSequence: 0,
@@ -1025,6 +1057,177 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
1025
1057
  strict_1.default.equal(emitted[0]?.content, '🔧 Terminal');
1026
1058
  strict_1.default.equal(session.currentTurn.assistantText, 'done');
1027
1059
  });
1060
+ (0, node_test_1.default)('ACP tool-scoped assistant chunks stay out of final assistant buffer', () => {
1061
+ const appended = [];
1062
+ const emitted = [];
1063
+ const coordinator = new local_core_acp_turn_coordinator_js_1.LocalCoreAcpTurnCoordinator({
1064
+ appendMessage: (_threadId, _role, content, _kind, _toolCall, bridgeKind) => appended.push({ content, bridgeKind }),
1065
+ emitBridge: (event) => emitted.push(event),
1066
+ updateRunStatus: () => { },
1067
+ sendRaw: () => true,
1068
+ });
1069
+ const session = {
1070
+ threadId: 'thread-1',
1071
+ bridgeSessionKey: 'session:thread-1',
1072
+ currentRunId: 'run-1',
1073
+ currentTurn: {
1074
+ runId: 'run-1',
1075
+ replyCtx: 'run-1',
1076
+ previewHandle: 'preview-1',
1077
+ assistantText: '',
1078
+ typingStarted: true,
1079
+ previewStarted: false,
1080
+ permission: null,
1081
+ },
1082
+ loadReplayMode: false,
1083
+ schedulerJobCreatedByRun: new Map(),
1084
+ };
1085
+ coordinator.handleAgentNotification(session, {
1086
+ method: 'session/update',
1087
+ params: {
1088
+ update: {
1089
+ sessionUpdate: 'agent_message_chunk',
1090
+ _meta: {
1091
+ claudeCode: {
1092
+ parentToolUseId: 'tool-1',
1093
+ },
1094
+ },
1095
+ content: {
1096
+ type: 'text',
1097
+ text: 'tool scoped transcript',
1098
+ },
1099
+ },
1100
+ },
1101
+ });
1102
+ coordinator.handleAgentNotification(session, {
1103
+ method: 'session/update',
1104
+ params: {
1105
+ update: {
1106
+ sessionUpdate: 'agent_message_chunk',
1107
+ content: { type: 'text', text: 'final answer' },
1108
+ },
1109
+ },
1110
+ });
1111
+ strict_1.default.deepEqual(appended, [{ content: 'tool scoped transcript', bridgeKind: 'tool' }]);
1112
+ strict_1.default.equal(emitted[0]?.bridgeKind, 'tool');
1113
+ strict_1.default.equal(emitted[0]?.content, 'tool scoped transcript');
1114
+ strict_1.default.equal(session.currentTurn.assistantText, 'final answer');
1115
+ });
1116
+ (0, node_test_1.default)('ACP raw local command output assistant chunks stay out of final assistant buffer', () => {
1117
+ const appended = [];
1118
+ const coordinator = new local_core_acp_turn_coordinator_js_1.LocalCoreAcpTurnCoordinator({
1119
+ appendMessage: (_threadId, _role, content, _kind, _toolCall, bridgeKind) => appended.push({ content, bridgeKind }),
1120
+ emitBridge: () => { },
1121
+ updateRunStatus: () => { },
1122
+ sendRaw: () => true,
1123
+ });
1124
+ const session = {
1125
+ threadId: 'thread-1',
1126
+ bridgeSessionKey: 'session:thread-1',
1127
+ currentRunId: 'run-1',
1128
+ currentTurn: {
1129
+ runId: 'run-1',
1130
+ replyCtx: 'run-1',
1131
+ previewHandle: 'preview-1',
1132
+ assistantText: '',
1133
+ typingStarted: true,
1134
+ previewStarted: false,
1135
+ permission: null,
1136
+ },
1137
+ loadReplayMode: false,
1138
+ schedulerJobCreatedByRun: new Map(),
1139
+ pendingRawAssistantProgressChunks: [],
1140
+ };
1141
+ coordinator.handleAgentNotification(session, {
1142
+ method: '_claude/sdkMessage',
1143
+ params: {
1144
+ message: {
1145
+ type: 'system',
1146
+ subtype: 'local_command_output',
1147
+ content: 'raw command output',
1148
+ },
1149
+ },
1150
+ });
1151
+ coordinator.handleAgentNotification(session, {
1152
+ method: 'session/update',
1153
+ params: {
1154
+ update: {
1155
+ sessionUpdate: 'agent_message_chunk',
1156
+ content: { type: 'text', text: 'raw command output' },
1157
+ },
1158
+ },
1159
+ });
1160
+ coordinator.handleAgentNotification(session, {
1161
+ method: 'session/update',
1162
+ params: {
1163
+ update: {
1164
+ sessionUpdate: 'agent_message_chunk',
1165
+ content: { type: 'text', text: 'final answer' },
1166
+ },
1167
+ },
1168
+ });
1169
+ strict_1.default.deepEqual(appended, [{ content: 'raw command output', bridgeKind: 'tool' }]);
1170
+ strict_1.default.equal(session.currentTurn.assistantText, 'final answer');
1171
+ });
1172
+ (0, node_test_1.default)('ACP final text strips observed provider tool transcript prefix', () => {
1173
+ const currentTurn = {
1174
+ runId: 'run-1',
1175
+ replyCtx: 'run-1',
1176
+ previewHandle: 'preview-1',
1177
+ assistantText: '',
1178
+ thoughtText: '',
1179
+ typingStarted: true,
1180
+ previewStarted: false,
1181
+ thoughtPreviewStarted: false,
1182
+ permission: null,
1183
+ toolObservations: [],
1184
+ };
1185
+ (0, local_core_acp_progress_js_1.recordToolObservation)(currentTurn, {
1186
+ name: 'webReader',
1187
+ title: 'webReader',
1188
+ input: {
1189
+ url: 'https://github.com/Thysrael/Horizon',
1190
+ return_format: 'markdown',
1191
+ retain_images: false,
1192
+ },
1193
+ status: 'completed',
1194
+ outputText: JSON.stringify([{
1195
+ title: 'GitHub - Thysrael/Horizon: Your own AI-powered news radar',
1196
+ description: 'Your own AI-powered news radar. Generates daily briefings in English & Chinese.',
1197
+ url: 'https://github.com/Thysrael/Horizon',
1198
+ }]),
1199
+ });
1200
+ const polluted = [
1201
+ '**🌐 Z.ai Built-in Tool: webReader**',
1202
+ '',
1203
+ '**Input:**',
1204
+ '```json',
1205
+ '{"url":"https://github.com/Thysrael/Horizon","return_format":"markdown","retain_images":false}',
1206
+ '```',
1207
+ '',
1208
+ '*Executing on server...*',
1209
+ ' **Output:**',
1210
+ '**webReader_result_summary:** [{"text": {"title": "GitHub - Thysrael/Horizon: Your own AI-powered news radar", "description": "Your own AI-powered news radar. Generates daily briefings in English & Chinese.", "url": "https...',
1211
+ ' 已放入 `00-Inbox/Horizon.md`。这个项目和咱们的 AI 早报 skill 功能高度重叠,架构可以作为参考。',
1212
+ ].join('\n');
1213
+ strict_1.default.equal((0, local_core_acp_progress_js_1.stripObservedToolTranscriptsFromAssistantText)(polluted, currentTurn.toolObservations), '已放入 `00-Inbox/Horizon.md`。这个项目和咱们的 AI 早报 skill 功能高度重叠,架构可以作为参考。');
1214
+ strict_1.default.equal((0, local_core_acp_progress_js_1.stripObservedToolTranscriptsFromAssistantText)(polluted, []), polluted.trim());
1215
+ });
1216
+ (0, node_test_1.default)('ACP final text keeps normal answers that mention observed tool evidence', () => {
1217
+ const observations = [{
1218
+ name: 'webReader',
1219
+ input: { url: 'https://github.com/Thysrael/Horizon' },
1220
+ outputText: JSON.stringify([{
1221
+ title: 'GitHub - Thysrael/Horizon: Your own AI-powered news radar',
1222
+ url: 'https://github.com/Thysrael/Horizon',
1223
+ }]),
1224
+ }];
1225
+ const answer = [
1226
+ '我看了 https://github.com/Thysrael/Horizon,它是一个 AI 新闻雷达项目。',
1227
+ '结论:可以作为早报 skill 的参考,但不需要直接照搬。',
1228
+ ].join('\n');
1229
+ strict_1.default.equal((0, local_core_acp_progress_js_1.stripObservedToolTranscriptsFromAssistantText)(answer, observations), answer);
1230
+ });
1028
1231
  (0, node_test_1.default)('ACP plan updates are persisted and emitted as thinking progress', () => {
1029
1232
  const appended = [];
1030
1233
  const emitted = [];
@@ -1073,7 +1276,7 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
1073
1276
  strict_1.default.equal(emitted[0]?.bridgeKind, 'plan');
1074
1277
  strict_1.default.equal(emitted[0]?.content, appended[0]?.content);
1075
1278
  });
1076
- (0, node_test_1.default)('ACP thought chunks are streamed as thinking preview updates', () => {
1279
+ (0, node_test_1.default)('ACP thought chunks stream for web/app and start a fresh segment at tool boundaries', () => {
1077
1280
  const appended = [];
1078
1281
  const upserted = [];
1079
1282
  const emitted = [];
@@ -1093,9 +1296,10 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
1093
1296
  replyCtx: 'run-1',
1094
1297
  previewHandle: 'preview-1',
1095
1298
  thoughtPreviewHandle: 'thought-preview-1',
1096
- thoughtMessageId: 'run-1-thought',
1299
+ thoughtMessageId: 'run-1-thought-1',
1097
1300
  assistantText: '',
1098
1301
  thoughtText: '',
1302
+ thoughtSequence: 1,
1099
1303
  typingStarted: true,
1100
1304
  previewStarted: false,
1101
1305
  thoughtPreviewStarted: false,
@@ -1113,6 +1317,16 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
1113
1317
  },
1114
1318
  },
1115
1319
  });
1320
+ strict_1.default.deepEqual(appended, []);
1321
+ strict_1.default.deepEqual(upserted, [
1322
+ {
1323
+ id: 'run-1-thought-1',
1324
+ content: '先理解问题',
1325
+ kind: 'progress',
1326
+ },
1327
+ ]);
1328
+ strict_1.default.deepEqual(emitted.map((event) => event.type), ['preview_start']);
1329
+ strict_1.default.equal(emitted[0]?.content, '先理解问题');
1116
1330
  coordinator.handleAgentNotification(session, {
1117
1331
  method: 'session/update',
1118
1332
  params: {
@@ -1123,24 +1337,22 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
1123
1337
  },
1124
1338
  });
1125
1339
  strict_1.default.deepEqual(appended, []);
1126
- strict_1.default.deepEqual(upserted, [
1127
- {
1128
- id: 'run-1-thought',
1129
- content: '先理解问题',
1130
- kind: 'progress',
1131
- },
1132
- {
1133
- id: 'run-1-thought',
1134
- content: '先理解问题,再检查代码',
1135
- kind: 'progress',
1136
- },
1137
- ]);
1340
+ strict_1.default.deepEqual(upserted.map((entry) => entry.content), ['先理解问题', '先理解问题,再检查代码']);
1138
1341
  strict_1.default.deepEqual(emitted.map((event) => event.type), ['preview_start', 'update_message']);
1139
- strict_1.default.equal(emitted[0]?.previewHandle, 'thought-preview-1');
1140
- strict_1.default.equal(emitted[0]?.bridgeKind, 'thought');
1141
- strict_1.default.equal(emitted[0]?.content, '先理解问题');
1142
1342
  strict_1.default.equal(emitted[1]?.content, '先理解问题,再检查代码');
1143
- strict_1.default.equal(session.currentTurn.thoughtText, '先理解问题,再检查代码');
1343
+ coordinator.handleAgentNotification(session, {
1344
+ method: 'session/update',
1345
+ params: {
1346
+ update: {
1347
+ sessionUpdate: 'tool_call',
1348
+ title: 'webReader',
1349
+ },
1350
+ },
1351
+ });
1352
+ strict_1.default.deepEqual(appended, []);
1353
+ strict_1.default.equal(session.currentTurn.thoughtText, '');
1354
+ strict_1.default.equal(session.currentTurn.thoughtMessageId, 'run-1-thought-2');
1355
+ strict_1.default.equal(session.currentTurn.thoughtPreviewHandle, 'run-1-thought-preview-2');
1144
1356
  });
1145
1357
  (0, node_test_1.default)('ACP store preserves structured progress metadata', () => {
1146
1358
  const userDataPath = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'agentdock-thought-store-'));
@@ -1355,6 +1567,77 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
1355
1567
  strict_1.default.deepEqual(patchedCards, []);
1356
1568
  strict_1.default.deepEqual(storedMessageIds, ['lark-msg-1']);
1357
1569
  });
1570
+ (0, node_test_1.default)('lark bridge creates final replies without patching prior final cards', async () => {
1571
+ const createdCards = [];
1572
+ const patchedCards = [];
1573
+ const client = {
1574
+ im: {
1575
+ message: {
1576
+ create: async (request) => {
1577
+ const messageId = `lark-msg-${createdCards.length + 1}`;
1578
+ const card = JSON.parse(String(request.data.content || '{}'));
1579
+ createdCards.push({
1580
+ messageId,
1581
+ text: String(card.elements?.[0]?.content || ''),
1582
+ });
1583
+ return { data: { message_id: messageId } };
1584
+ },
1585
+ patch: async (request) => {
1586
+ const card = JSON.parse(String(request.data.content || '{}'));
1587
+ patchedCards.push({
1588
+ messageId: String(request.path.message_id || ''),
1589
+ text: String(card.elements?.[0]?.content || ''),
1590
+ });
1591
+ },
1592
+ },
1593
+ },
1594
+ };
1595
+ const gateway = new local_core_lark_gateway_js_1.LocalCoreLarkGateway({
1596
+ store: {
1597
+ getPlatformThreadBinding: () => ({
1598
+ workspace_id: 'default',
1599
+ platform: 'lark',
1600
+ chat_id: 'chat-1',
1601
+ platform_user_id: 'user-1',
1602
+ thread_id: 'thread-1',
1603
+ last_platform_message_id: null,
1604
+ }),
1605
+ updatePlatformThreadMessageId: () => { },
1606
+ },
1607
+ readConfig: async () => null,
1608
+ getWorkspaceRouter: () => ({}),
1609
+ eventBus: { emit: () => { }, on: () => () => { } },
1610
+ });
1611
+ const internals = gateway;
1612
+ internals.runtime.set('default', {
1613
+ workspaceId: 'default',
1614
+ enabled: true,
1615
+ status: 'running',
1616
+ connected: true,
1617
+ appId: 'app-1',
1618
+ client,
1619
+ });
1620
+ internals.threadRouting.set('session:thread-1', {
1621
+ workspaceId: 'default',
1622
+ platformUserId: 'user-1',
1623
+ chatId: 'chat-1',
1624
+ threadId: 'thread-1',
1625
+ });
1626
+ await gateway.onBridgeEvent({
1627
+ type: 'reply',
1628
+ sessionKey: 'session:thread-1',
1629
+ replyCtx: 'run-1',
1630
+ content: 'first final',
1631
+ });
1632
+ await gateway.onBridgeEvent({
1633
+ type: 'reply',
1634
+ sessionKey: 'session:thread-1',
1635
+ replyCtx: 'run-2',
1636
+ content: 'second final',
1637
+ });
1638
+ strict_1.default.deepEqual(createdCards.map((card) => card.text), ['first final', 'second final']);
1639
+ strict_1.default.deepEqual(patchedCards, []);
1640
+ });
1358
1641
  (0, node_test_1.default)('lark bridge sends tool and final as separate cards without patching tool progress', async () => {
1359
1642
  const createdCards = [];
1360
1643
  const patchedCards = [];
@@ -198,7 +198,13 @@ const local_core_controller_js_1 = require("../services/local-ai-core/src/runtim
198
198
  model: '',
199
199
  });
200
200
  strict_1.default.equal(closeCount, 1);
201
- strict_1.default.equal(capturedSessionNewParams[1]?._meta, undefined);
201
+ strict_1.default.deepEqual(capturedSessionNewParams[1]?._meta, {
202
+ claudeCode: {
203
+ emitRawSDKMessages: [
204
+ { type: 'system', subtype: 'local_command_output' },
205
+ ],
206
+ },
207
+ });
202
208
  }
203
209
  finally {
204
210
  (0, node_fs_1.rmSync)(userDataPath, { recursive: true, force: true });
@@ -10,6 +10,7 @@ const local_core_acp_response_processor_js_1 = require("./local-core-acp-respons
10
10
  const local_core_acp_content_js_1 = require("./local-core-acp-content.js");
11
11
  const command_risk_js_1 = require("../security/command-risk.js");
12
12
  const local_core_slash_commands_js_1 = require("./local-core-slash-commands.js");
13
+ const local_core_acp_progress_js_1 = require("./local-core-acp-progress.js");
13
14
  const ACP_PROMPT_TIMEOUT_MS = 15 * 60 * 1000;
14
15
  class LocalCoreAcpBackend {
15
16
  options;
@@ -306,9 +307,10 @@ class LocalCoreAcpBackend {
306
307
  replyCtx: runId,
307
308
  previewHandle: (0, node_crypto_1.randomUUID)(),
308
309
  thoughtPreviewHandle: (0, node_crypto_1.randomUUID)(),
309
- thoughtMessageId: `${runId}-thought`,
310
+ thoughtMessageId: `${runId}-thought-1`,
310
311
  assistantText: '',
311
312
  thoughtText: '',
313
+ thoughtSequence: 1,
312
314
  typingStarted: true,
313
315
  previewStarted: false,
314
316
  thoughtPreviewStarted: false,
@@ -319,6 +321,7 @@ class LocalCoreAcpBackend {
319
321
  pendingToolCalls: {},
320
322
  pendingToolCallOrder: [],
321
323
  toolCallSequence: 0,
324
+ toolObservations: [],
322
325
  permission: null,
323
326
  };
324
327
  const promptPromise = this.transport.request(session, 'session/prompt', {
@@ -332,9 +335,11 @@ class LocalCoreAcpBackend {
332
335
  if (!currentTurn || currentTurn.runId !== runId) {
333
336
  return;
334
337
  }
338
+ this.turnCoordinator.closePendingThoughtSegment(session);
335
339
  this.turnCoordinator.flushPendingToolCall(session);
336
340
  if (currentTurn.assistantText) {
337
- const processed = await this.responseProcessor.processAssistantResponse(threadId, currentTurn.assistantText);
341
+ const assistantText = (0, local_core_acp_progress_js_1.stripObservedToolTranscriptsFromAssistantText)(currentTurn.assistantText, currentTurn.toolObservations);
342
+ const processed = await this.responseProcessor.processAssistantResponse(threadId, assistantText);
338
343
  if (processed.displayContent) {
339
344
  this.options.store.appendMessage(threadId, 'assistant', processed.displayContent, 'final');
340
345
  this.options.eventBus.emit({