@kafca/agentdock 0.1.50 → 0.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/renderer/assets/{Badge-DphzI84h.js → Badge-H0XWc7vp.js} +1 -1
- package/dist/renderer/assets/{Chat-BkMHNdkV.js → Chat-bR-LSg9D.js} +1 -1
- package/dist/renderer/assets/{ChatMarkdown-nmZelMA9.js → ChatMarkdown-ZnK1NWdh.js} +1 -1
- package/dist/renderer/assets/Config-DdhdELsW.js +21 -0
- package/dist/renderer/assets/{CronList-Ds9TTT0f.js → CronList-gyQuGhGg.js} +1 -1
- package/dist/renderer/assets/{Dashboard-DeWrprYz.js → Dashboard-DaLRkrf-.js} +2 -2
- package/dist/renderer/assets/{EmptyState-JnMCDgRB.js → EmptyState-Ci2bjyET.js} +1 -1
- package/dist/renderer/assets/{KnowledgeDetail-CQ3VlctJ.js → KnowledgeDetail-D5dqZC5f.js} +2 -2
- package/dist/renderer/assets/{KnowledgeHome-DsCVW1re.js → KnowledgeHome-DIhbMvM8.js} +2 -2
- package/dist/renderer/assets/{Logs-4ENSRVB4.js → Logs-DIF8ymaI.js} +1 -1
- package/dist/renderer/assets/{Modal-BIm0iRtp.js → Modal-O77lsvJu.js} +3 -3
- package/dist/renderer/assets/{MonitorList-CCj0KIGD.js → MonitorList-CJBrqytq.js} +1 -1
- package/dist/renderer/assets/{Page-uCVGTzRo.js → Page-CodHoUwH.js} +1 -1
- package/dist/renderer/assets/ProjectDetail-Bt4Dj60f.js +11 -0
- package/dist/renderer/assets/{ProjectList-DglTyk-r.js → ProjectList-CZTkHOyM.js} +1 -1
- package/dist/renderer/assets/{Select-wnvxGX9B.js → Select-DGCo_gYI.js} +1 -1
- package/dist/renderer/assets/{SessionChat-BvrFUqiK.js → SessionChat-CHm7HyvI.js} +1 -1
- package/dist/renderer/assets/{SessionList-DN0k8lCt.js → SessionList-Df2wQinW.js} +1 -1
- package/dist/renderer/assets/{ThreadChat-DqZwWTdK.js → ThreadChat-Iomr0Qx9.js} +1 -1
- package/dist/renderer/assets/{Workspace-VrjbrPbA.js → Workspace-r8lHxaBj.js} +2 -2
- package/dist/renderer/assets/{arrow-left-BflzNl62.js → arrow-left-r950YY17.js} +1 -1
- package/dist/renderer/assets/{book-open-D2ttV2IU.js → book-open-BslYrNTy.js} +1 -1
- package/dist/renderer/assets/{bot-cb9OifGp.js → bot-BVfQh_eb.js} +1 -1
- package/dist/renderer/assets/{check-B47n4xeR.js → check-BSAurnOI.js} +1 -1
- package/dist/renderer/assets/{chevron-down-CGsttXF_.js → chevron-down-B9G43XLT.js} +1 -1
- package/dist/renderer/assets/{circle-BnHI6FDe.js → circle-CBHOs0lN.js} +1 -1
- package/dist/renderer/assets/desktop-CXcNupTW.js +1 -0
- package/dist/renderer/assets/{funnel-DPnOoche.js → funnel-UDX21Ev4.js} +1 -1
- package/dist/renderer/assets/{heart-Bdhq7IqP.js → heart-CzmLZP5g.js} +1 -1
- package/dist/renderer/assets/{index-CrZRrTuv.js → index-C581X81v.js} +9 -9
- package/dist/renderer/assets/{index-BfJ1LHHo.js → index-DeTNhSbD.js} +2 -2
- package/dist/renderer/assets/{pencil-0zLgPSJa.js → pencil-BFLsShcu.js} +1 -1
- package/dist/renderer/assets/{play-fVd6Sq-t.js → play-YFpAnQ9r.js} +1 -1
- package/dist/renderer/assets/{plus-DmNVnnyt.js → plus-D8uIIQB9.js} +1 -1
- package/dist/renderer/assets/projects-D2hAJzY0.js +1 -0
- package/dist/renderer/assets/{save-CSIMXP6Z.js → save-Cgx9qe4w.js} +1 -1
- package/dist/renderer/assets/{search-Ddn9yqyb.js → search-CxscB_CP.js} +1 -1
- package/dist/renderer/assets/{server-BVPINrD2.js → server-KW8nGvbV.js} +1 -1
- package/dist/renderer/assets/{session-utils-BcyJwUyK.js → session-utils-oB-uPAPg.js} +1 -1
- package/dist/renderer/assets/{sessions-BtcQ4TyW.js → sessions-CefxFisH.js} +1 -1
- package/dist/renderer/assets/{shield-check-B2sF2E4F.js → shield-check-Bl-k8F5V.js} +1 -1
- package/dist/renderer/assets/{trash-2-BwMAwl5Q.js → trash-2-DvmnFiu7.js} +1 -1
- package/dist/renderer/assets/{user-BEZW7eDN.js → user-ZZO21GY4.js} +1 -1
- package/dist/renderer/assets/{wifi-off-C1uypxZf.js → wifi-off-1dHHA2Em.js} +1 -1
- package/dist/renderer/index.html +1 -1
- package/dist-electron/packages/core-sdk/src/index.js +6 -10
- package/dist-electron/services/local-ai-core/src/acp/store/local-core-acp-store.js +29 -0
- package/dist-electron/services/local-ai-core/src/acp/store/runtime-config-store.js +164 -0
- package/dist-electron/services/local-ai-core/src/acp/store/schema.js +8 -0
- package/dist-electron/services/local-ai-core/src/agents/shared/launch-utils.js +1 -2
- package/dist-electron/services/local-ai-core/src/cli/lac.js +2 -2
- package/dist-electron/services/local-ai-core/src/kernel/bootstrap.js +2 -2
- package/dist-electron/services/local-ai-core/src/router/workspace-route-config.js +1 -1
- package/dist-electron/services/local-ai-core/src/router/workspace-router.js +8 -7
- package/dist-electron/services/local-ai-core/src/runtime/external-service.js +6 -9
- package/dist-electron/services/local-ai-core/src/runtime/handlers/runtime-handler.js +4 -8
- package/dist-electron/services/local-ai-core/src/runtime/local-core-controller.js +32 -35
- package/dist-electron/services/local-ai-core/src/runtime/local-core-runtime-state.js +0 -89
- package/dist-electron/services/local-ai-core/src/runtime/server-routes.js +4 -7
- package/dist-electron/services/local-ai-core/src/sandbox/sandbox-config.js +4 -4
- package/dist-electron/tests/electron/lac-cli.test.js +36 -0
- package/dist-electron/tests/electron/plugin-kernel.test.js +72 -34
- package/dist-electron/tests/electron/runtime-config-store.test.js +176 -0
- package/dist-electron/tests/electron/sandbox-config.test.js +5 -5
- package/dist-electron/tests/electron/workspace-task-store.test.js +5 -5
- package/package.json +1 -1
- package/dist/renderer/assets/Config-CY2peXi1.js +0 -21
- package/dist/renderer/assets/ProjectDetail-DJ0Z_Ixk.js +0 -11
- package/dist/renderer/assets/desktop-CRlWIOU3.js +0 -1
- package/dist/renderer/assets/projects-Cm9nXtkn.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{J as Le,aZ as Ne,r as c,j as x,a_ as pe,a$ as Ae,aP as te}from"./index-CrZRrTuv.js";var ye=Ne();const De=Le(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:()=>{},Fe=pe[" useId ".trim().toString()]||(()=>{}),Me=0;function tn(e){const[t,n]=c.useState(Fe());return ne(()=>{n(r=>r??String(Me++))},[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?Ae(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 M(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=M(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",Ze="dismissableLayer.pointerDownOutside",Ge="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 T=E.target,L=[...l.branches].some(F=>F.contains(T));!S||L||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())},v),P=tt(E=>{const T=E.target;[...l.branches].some(F=>F.contains(T))||(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=M(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let h=function(){ge(Ze,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=M(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ge(Ge,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=M(o),f=M(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 Z(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 Z(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)||Z(a,null)}),i.forEach(function(a){o.has(a)||Z(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(),G=function(){},K=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:G,onWheelCapture:G,onTouchMoveCapture:G}),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},Tt={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Lt=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)]},Nt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tt;var t=Lt(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])}},At=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{J as Le,aY as Ne,r as c,j as x,aZ as pe,a_ as Ae,aO as te}from"./index-C581X81v.js";var ye=Ne();const De=Le(ye);function Y(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:()=>{},Fe=pe[" useId ".trim().toString()]||(()=>{}),Me=0;function tn(e){const[t,n]=c.useState(Fe());return ne(()=>{n(r=>r??String(Me++))},[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?Ae(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 Ye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=Ye.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 Xe(e,t){e&&ye.flushSync(()=>e.dispatchEvent(t))}function M(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=M(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",Ze="dismissableLayer.pointerDownOutside",Ge="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 T=E.target,L=[...l.branches].some(F=>F.contains(T));!S||L||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())},v),P=tt(E=>{const T=E.target;[...l.branches].some(F=>F.contains(T))||(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:Y(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Y(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=M(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let h=function(){ge(Ze,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=M(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ge(Ge,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?Xe(o,i):o.dispatchEvent(i)}var X="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=M(o),f=M(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(X,ce);a.addEventListener(X,l),a.dispatchEvent(p),p.defaultPrevented||(ot(ut(be(a)),{select:!0}),document.activeElement===u&&O(a))}return()=>{a.removeEventListener(X,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 Z(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 Z(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)||Z(a,null)}),i.forEach(function(a){o.has(a)||Z(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(),G=function(){},K=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:G,onWheelCapture:G,onTouchMoveCapture:G}),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},Tt={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Lt=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)]},Nt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tt;var t=Lt(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])}},At=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,`;
|
|
@@ -38,4 +38,4 @@ import{J as Le,aZ as Ne,r as c,j as x,a_ as pe,a$ as Ae,aP as te}from"./index-Cr
|
|
|
38
38
|
`)},de=function(){var e=parseInt(document.body.getAttribute(k)||"0",10);return isFinite(e)?e:0},kt=function(){c.useEffect(function(){return document.body.setAttribute(k,(de()+1).toString()),function(){var e=de()-1;e<=0?document.body.removeAttribute(k):document.body.setAttribute(k,e.toString())}},[])},Ft=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;kt();var i=c.useMemo(function(){return Nt(o)},[o]);return c.createElement(At,{styles:Dt(i,!t,o,n?"":"!important")})},ee=!1;if(typeof window<"u")try{var W=Object.defineProperty({},"passive",{get:function(){return ee=!0,!0}});window.addEventListener("test",W,W),window.removeEventListener("test",W,W)}catch{ee=!1}var N=ee?{passive:!1}:!1,Mt=function(e){return e.tagName==="TEXTAREA"},Re=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Mt(e)&&n[t]==="visible")},It=function(e){return Re(e,"overflowY")},Wt=function(e){return Re(e,"overflowX")},ve=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=xe(e,r);if(o){var i=Oe(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_t=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xe=function(e,t){return e==="v"?It(t):Wt(t)},Oe=function(e,t){return e==="v"?Bt(t):_t(t)},jt=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ut=function(e,t,n,r,o){var i=jt(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,h=t.contains(a),l=!1,f=s>0,d=0,v=0;do{if(!a)break;var y=Oe(e,a),w=y[0],u=y[1],m=y[2],p=u-m-i*w;(w||p)&&xe(e,a)&&(d+=p,v+=w);var g=a.parentNode;a=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!h&&a!==document.body||h&&(t.contains(a)||t===a));return(f&&Math.abs(d)<1||!f&&Math.abs(v)<1)&&(l=!0),l},B=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},he=function(e){return[e.deltaX,e.deltaY]},me=function(e){return e&&"current"in e?e.current:e},$t=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vt=function(e){return`
|
|
39
39
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},Kt=0,A=[];function
|
|
41
|
+
`)},Kt=0,A=[];function Yt(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Kt++)[0],i=c.useState(Pe)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var u=dt([e.lockRef.current],(e.shards||[]).map(me),!0).filter(Boolean);return u.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),u.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(u,m){if("touches"in u&&u.touches.length===2||u.type==="wheel"&&u.ctrlKey)return!s.current.allowPinchZoom;var p=B(u),g=n.current,b="deltaX"in u?u.deltaX:g[0]-p[0],S="deltaY"in u?u.deltaY:g[1]-p[1],C,P=u.target,E=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in u&&E==="h"&&P.type==="range")return!1;var T=window.getSelection(),L=T&&T.anchorNode,F=L?L===P||L.contains(P):!1;if(F)return!1;var I=ve(E,P);if(!I)return!0;if(I?C=E:(C=E==="v"?"h":"v",I=ve(E,P)),!I)return!1;if(!r.current&&"changedTouches"in u&&(b||S)&&(r.current=C),!C)return!0;var re=r.current||C;return Ut(re,m,u,re==="h"?b:S)},[]),h=c.useCallback(function(u){var m=u;if(!(!A.length||A[A.length-1]!==i)){var p="deltaY"in m?he(m):B(m),g=t.current.filter(function(C){return C.name===m.type&&(C.target===m.target||m.target===C.shadowParent)&&$t(C.delta,p)})[0];if(g&&g.should){m.cancelable&&m.preventDefault();return}if(!g){var b=(s.current.shards||[]).map(me).filter(Boolean).filter(function(C){return C.contains(m.target)}),S=b.length>0?a(m,b[0]):!s.current.noIsolation;S&&m.cancelable&&m.preventDefault()}}},[]),l=c.useCallback(function(u,m,p,g){var b={name:u,delta:m,target:p,should:g,shadowParent:Xt(p)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),f=c.useCallback(function(u){n.current=B(u),r.current=void 0},[]),d=c.useCallback(function(u){l(u.type,he(u),u.target,a(u,e.lockRef.current))},[]),v=c.useCallback(function(u){l(u.type,B(u),u.target,a(u,e.lockRef.current))},[]);c.useEffect(function(){return A.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:v}),document.addEventListener("wheel",h,N),document.addEventListener("touchmove",h,N),document.addEventListener("touchstart",f,N),function(){A=A.filter(function(u){return u!==i}),document.removeEventListener("wheel",h,N),document.removeEventListener("touchmove",h,N),document.removeEventListener("touchstart",f,N)}},[]);var y=e.removeScrollBar,w=e.inert;return c.createElement(c.Fragment,null,w?c.createElement(i,{styles:Vt(o)}):null,y?c.createElement(Ft,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Xt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ht=St(Ce,Yt);var zt=c.forwardRef(function(e,t){return c.createElement(K,R({},e,{ref:t,sideCar:Ht}))});zt.classNames=K.classNames;var Zt=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},D=new WeakMap,_=new WeakMap,j={},Q=0,Te=function(e){return e&&(e.host||Te(e.parentNode))},Gt=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Te(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},qt=function(e,t,n,r){var o=Gt(t,Array.isArray(e)?e:[e]);j[n]||(j[n]=new WeakMap);var i=j[n],s=[],a=new Set,h=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||h.has(d)||Array.prototype.forEach.call(d.children,function(v){if(a.has(v))f(v);else try{var y=v.getAttribute(r),w=y!==null&&y!=="false",u=(D.get(v)||0)+1,m=(i.get(v)||0)+1;D.set(v,u),i.set(v,m),s.push(v),u===1&&w&&_.set(v,!0),m===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",v,p)}})};return f(t),a.clear(),Q++,function(){s.forEach(function(d){var v=D.get(d)-1,y=i.get(d)-1;D.set(d,v),i.set(d,y),v||(_.has(d)||d.removeAttribute(r),_.delete(d)),y||d.removeAttribute(n)}),Q--,Q||(D=new WeakMap,D=new WeakMap,_=new WeakMap,j={})}},on=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Zt(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),qt(r,o,n,"aria-hidden")):function(){return null}};export{qe as D,rt as F,V as P,zt as R,_e as a,M as b,en as c,nn as d,tn as e,Y as f,ft as g,on as h,rn as i,Jt as j,ye as r,ne as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as t}from"./index-C581X81v.js";const e=()=>t.get("/projects"),r=o=>t.get(`/projects/${o}`);export{r as g,e as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as o}from"./index-
|
|
1
|
+
import{D as o}from"./index-C581X81v.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};
|
package/dist/renderer/index.html
CHANGED
|
@@ -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-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-C581X81v.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="./assets/index-CjCuR6DI.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body class="bg-[#f5f5f7] dark:bg-[#151516]">
|
|
@@ -16,9 +16,8 @@ exports.refreshRuntimeDetection = refreshRuntimeDetection;
|
|
|
16
16
|
exports.listDiagnosticErrors = listDiagnosticErrors;
|
|
17
17
|
exports.runDiagnosticsDoctor = runDiagnosticsDoctor;
|
|
18
18
|
exports.runDeploymentDiagnostics = runDeploymentDiagnostics;
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.saveCoreStructuredConfigFile = saveCoreStructuredConfigFile;
|
|
19
|
+
exports.readCoreRuntimeConfig = readCoreRuntimeConfig;
|
|
20
|
+
exports.saveCoreRuntimeConfig = saveCoreRuntimeConfig;
|
|
22
21
|
exports.saveCoreSettings = saveCoreSettings;
|
|
23
22
|
exports.listModelProviders = listModelProviders;
|
|
24
23
|
exports.createModelProvider = createModelProvider;
|
|
@@ -252,14 +251,11 @@ async function runDiagnosticsDoctor() {
|
|
|
252
251
|
async function runDeploymentDiagnostics() {
|
|
253
252
|
return coreRequest('POST', '/diagnostics/deployment');
|
|
254
253
|
}
|
|
255
|
-
async function
|
|
256
|
-
return coreRequest('GET', '/runtime/config');
|
|
254
|
+
async function readCoreRuntimeConfig() {
|
|
255
|
+
return coreRequest('GET', '/runtime/runtime-config');
|
|
257
256
|
}
|
|
258
|
-
async function
|
|
259
|
-
return coreRequest('POST', '/runtime/config
|
|
260
|
-
}
|
|
261
|
-
async function saveCoreStructuredConfigFile(config) {
|
|
262
|
-
return coreRequest('POST', '/runtime/config/structured', { config });
|
|
257
|
+
async function saveCoreRuntimeConfig(config) {
|
|
258
|
+
return coreRequest('POST', '/runtime/runtime-config', { config });
|
|
263
259
|
}
|
|
264
260
|
async function saveCoreSettings(input) {
|
|
265
261
|
return coreRequest('POST', '/runtime/settings', input);
|
|
@@ -15,6 +15,7 @@ const thread_store_js_1 = require("./thread-store.js");
|
|
|
15
15
|
const workspace_registry_store_js_1 = require("./workspace-registry-store.js");
|
|
16
16
|
const model_provider_store_js_1 = require("./model-provider-store.js");
|
|
17
17
|
const external_store_js_1 = require("./external-store.js");
|
|
18
|
+
const runtime_config_store_js_1 = require("./runtime-config-store.js");
|
|
18
19
|
class LocalCoreAcpStore {
|
|
19
20
|
db;
|
|
20
21
|
threads;
|
|
@@ -26,8 +27,10 @@ class LocalCoreAcpStore {
|
|
|
26
27
|
platform;
|
|
27
28
|
modelProviders;
|
|
28
29
|
external;
|
|
30
|
+
runtimeConfig;
|
|
29
31
|
constructor(userDataPath) {
|
|
30
32
|
const dbPath = (0, node_path_1.join)(userDataPath, 'runtime', 'local-core.db');
|
|
33
|
+
const runtimeDir = (0, node_path_1.dirname)(dbPath);
|
|
31
34
|
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(dbPath), { recursive: true });
|
|
32
35
|
this.db = new node_sqlite_1.DatabaseSync(dbPath);
|
|
33
36
|
this.threads = new thread_store_js_1.LocalThreadStore(this.db);
|
|
@@ -44,6 +47,7 @@ class LocalCoreAcpStore {
|
|
|
44
47
|
this.modelProviders = new model_provider_store_js_1.LocalModelProviderStore(this.db);
|
|
45
48
|
this.external = new external_store_js_1.LocalExternalStore(this.db);
|
|
46
49
|
(0, schema_js_1.ensureLocalCoreAcpSchema)(this.db);
|
|
50
|
+
this.runtimeConfig = new runtime_config_store_js_1.LocalRuntimeConfigStore(this.db, dbPath, runtimeDir, resolveLegacyConfigPaths(runtimeDir));
|
|
47
51
|
}
|
|
48
52
|
close() {
|
|
49
53
|
this.db.close();
|
|
@@ -113,6 +117,12 @@ class LocalCoreAcpStore {
|
|
|
113
117
|
deleteModelProvider(providerId) {
|
|
114
118
|
return this.modelProviders.delete(providerId);
|
|
115
119
|
}
|
|
120
|
+
readRuntimeConfig() {
|
|
121
|
+
return this.runtimeConfig.read();
|
|
122
|
+
}
|
|
123
|
+
saveRuntimeConfig(config) {
|
|
124
|
+
return this.runtimeConfig.save(config);
|
|
125
|
+
}
|
|
116
126
|
getExternalProject(userId, externalProjectId) {
|
|
117
127
|
return this.external.getProject(userId, externalProjectId);
|
|
118
128
|
}
|
|
@@ -295,5 +305,24 @@ class LocalCoreAcpStore {
|
|
|
295
305
|
}
|
|
296
306
|
}
|
|
297
307
|
exports.LocalCoreAcpStore = LocalCoreAcpStore;
|
|
308
|
+
function resolveLegacyConfigPaths(runtimeDir) {
|
|
309
|
+
const defaultPath = (0, node_path_1.join)(runtimeDir, 'config.toml');
|
|
310
|
+
const settingsPath = (0, node_path_1.join)(runtimeDir, 'local-core-settings.json');
|
|
311
|
+
const paths = [];
|
|
312
|
+
if ((0, node_fs_1.existsSync)(settingsPath)) {
|
|
313
|
+
try {
|
|
314
|
+
const settings = JSON.parse((0, node_fs_1.readFileSync)(settingsPath, 'utf8'));
|
|
315
|
+
const configuredPath = String(settings.configPath || '').trim();
|
|
316
|
+
if (configuredPath) {
|
|
317
|
+
paths.push((0, node_path_1.isAbsolute)(configuredPath) ? configuredPath : (0, node_path_1.resolve)(runtimeDir, configuredPath));
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
catch {
|
|
321
|
+
// Ignore malformed legacy settings and fall back to the default legacy path.
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
paths.push(defaultPath);
|
|
325
|
+
return [...new Set(paths)];
|
|
326
|
+
}
|
|
298
327
|
var utils_js_1 = require("./utils.js");
|
|
299
328
|
Object.defineProperty(exports, "redactSecrets", { enumerable: true, get: function () { return utils_js_1.redactSecrets; } });
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.LocalRuntimeConfigStore = void 0;
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const TOML = __importStar(require("@iarna/toml"));
|
|
39
|
+
const config_migration_js_1 = require("../../runtime/config-migration.js");
|
|
40
|
+
const utils_js_1 = require("./utils.js");
|
|
41
|
+
const RUNTIME_CONFIG_ID = 'desktop';
|
|
42
|
+
class LocalRuntimeConfigStore {
|
|
43
|
+
db;
|
|
44
|
+
databasePath;
|
|
45
|
+
baseDir;
|
|
46
|
+
legacyConfigPaths;
|
|
47
|
+
constructor(db, databasePath, baseDir, legacyConfigPaths) {
|
|
48
|
+
this.db = db;
|
|
49
|
+
this.databasePath = databasePath;
|
|
50
|
+
this.baseDir = baseDir;
|
|
51
|
+
this.legacyConfigPaths = legacyConfigPaths;
|
|
52
|
+
}
|
|
53
|
+
read() {
|
|
54
|
+
const row = this.getRow();
|
|
55
|
+
if (row) {
|
|
56
|
+
const config = (0, utils_js_1.parseJson)(row.config_json, {});
|
|
57
|
+
const migrated = (0, config_migration_js_1.migrateDesktopConnectConfig)(config);
|
|
58
|
+
if (migrated.changed) {
|
|
59
|
+
return this.save(migrated.config, {
|
|
60
|
+
migratedFromPath: row.migrated_from_path || undefined,
|
|
61
|
+
warnings: migrated.warnings,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return this.toState(row, config, migrated.warnings);
|
|
65
|
+
}
|
|
66
|
+
const legacy = this.readLegacyConfig();
|
|
67
|
+
if (legacy) {
|
|
68
|
+
if ('error' in legacy) {
|
|
69
|
+
return this.errorState(legacy.path, legacy.error);
|
|
70
|
+
}
|
|
71
|
+
return this.save(legacy.config, {
|
|
72
|
+
migratedFromPath: legacy.path,
|
|
73
|
+
warnings: legacy.warnings,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return this.save({ projects: [] });
|
|
77
|
+
}
|
|
78
|
+
save(config, options = {}) {
|
|
79
|
+
const migrated = (0, config_migration_js_1.migrateDesktopConnectConfig)(config);
|
|
80
|
+
const row = this.getRow();
|
|
81
|
+
const now = new Date().toISOString();
|
|
82
|
+
const migratedFromPath = options.migratedFromPath ?? row?.migrated_from_path ?? null;
|
|
83
|
+
if (row) {
|
|
84
|
+
this.db.prepare(`
|
|
85
|
+
UPDATE runtime_config
|
|
86
|
+
SET config_json = ?, base_dir = ?, migrated_from_path = ?, updated_at = ?
|
|
87
|
+
WHERE id = ?
|
|
88
|
+
`).run(JSON.stringify(migrated.config), this.baseDir, migratedFromPath, now, RUNTIME_CONFIG_ID);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
this.db.prepare(`
|
|
92
|
+
INSERT INTO runtime_config (id, config_json, base_dir, migrated_from_path, created_at, updated_at)
|
|
93
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
94
|
+
`).run(RUNTIME_CONFIG_ID, JSON.stringify(migrated.config), this.baseDir, migratedFromPath, now, now);
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
storage: 'sqlite',
|
|
98
|
+
databasePath: this.databasePath,
|
|
99
|
+
baseDir: this.baseDir,
|
|
100
|
+
config: migrated.config,
|
|
101
|
+
...(migratedFromPath ? { migratedFromPath } : {}),
|
|
102
|
+
updatedAt: now,
|
|
103
|
+
warnings: [
|
|
104
|
+
...(options.warnings || []),
|
|
105
|
+
...migrated.warnings,
|
|
106
|
+
].filter(Boolean),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
getRow() {
|
|
110
|
+
return this.db.prepare(`
|
|
111
|
+
SELECT config_json, base_dir, migrated_from_path, updated_at
|
|
112
|
+
FROM runtime_config
|
|
113
|
+
WHERE id = ?
|
|
114
|
+
`).get(RUNTIME_CONFIG_ID);
|
|
115
|
+
}
|
|
116
|
+
toState(row, config, warnings) {
|
|
117
|
+
return {
|
|
118
|
+
storage: 'sqlite',
|
|
119
|
+
databasePath: this.databasePath,
|
|
120
|
+
baseDir: row.base_dir || this.baseDir,
|
|
121
|
+
config,
|
|
122
|
+
...(row.migrated_from_path ? { migratedFromPath: row.migrated_from_path } : {}),
|
|
123
|
+
updatedAt: row.updated_at,
|
|
124
|
+
...(warnings.length > 0 ? { warnings } : {}),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
errorState(path, error) {
|
|
128
|
+
const migrated = (0, config_migration_js_1.migrateDesktopConnectConfig)({ projects: [] });
|
|
129
|
+
return {
|
|
130
|
+
storage: 'sqlite',
|
|
131
|
+
databasePath: this.databasePath,
|
|
132
|
+
baseDir: this.baseDir,
|
|
133
|
+
config: migrated.config,
|
|
134
|
+
migratedFromPath: path,
|
|
135
|
+
error,
|
|
136
|
+
warnings: [`Failed to import legacy runtime config "${path}": ${error}`],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
readLegacyConfig() {
|
|
140
|
+
for (const legacyConfigPath of this.legacyConfigPaths) {
|
|
141
|
+
if (!(0, node_fs_1.existsSync)(legacyConfigPath)) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
const raw = (0, node_fs_1.readFileSync)(legacyConfigPath, 'utf8');
|
|
146
|
+
const parsed = TOML.parse(raw);
|
|
147
|
+
const migrated = (0, config_migration_js_1.migrateDesktopConnectConfig)(parsed);
|
|
148
|
+
return {
|
|
149
|
+
path: legacyConfigPath,
|
|
150
|
+
config: migrated.config,
|
|
151
|
+
warnings: migrated.warnings,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
return {
|
|
156
|
+
path: legacyConfigPath,
|
|
157
|
+
error: error instanceof Error ? error.message : String(error),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.LocalRuntimeConfigStore = LocalRuntimeConfigStore;
|
|
@@ -297,6 +297,14 @@ function ensureLocalCoreAcpSchema(db) {
|
|
|
297
297
|
CREATE INDEX IF NOT EXISTS idx_audit_events_workspace_created ON audit_events (workspace_id, created_at DESC);
|
|
298
298
|
CREATE INDEX IF NOT EXISTS idx_audit_events_task_created ON audit_events (task_id, created_at DESC);
|
|
299
299
|
CREATE INDEX IF NOT EXISTS idx_audit_events_type_created ON audit_events (type, created_at DESC);
|
|
300
|
+
CREATE TABLE IF NOT EXISTS runtime_config (
|
|
301
|
+
id TEXT PRIMARY KEY,
|
|
302
|
+
config_json TEXT NOT NULL,
|
|
303
|
+
base_dir TEXT NOT NULL,
|
|
304
|
+
migrated_from_path TEXT,
|
|
305
|
+
created_at TEXT NOT NULL,
|
|
306
|
+
updated_at TEXT NOT NULL
|
|
307
|
+
);
|
|
300
308
|
`);
|
|
301
309
|
ensureColumn(db, 'messages', 'tool_call_json', 'TEXT');
|
|
302
310
|
ensureColumn(db, 'messages', 'bridge_kind', 'TEXT');
|
|
@@ -72,12 +72,11 @@ function writeJsonFile(path, value, mode = 0o600) {
|
|
|
72
72
|
(0, node_fs_1.chmodSync)(path, mode);
|
|
73
73
|
}
|
|
74
74
|
function projectLocalStateDir(configState, folderName, projectName) {
|
|
75
|
-
const configDir = (0, node_path_1.dirname)(configState.path);
|
|
76
75
|
const safeProjectName = String(projectName || 'workspace')
|
|
77
76
|
.trim()
|
|
78
77
|
.replace(/[^a-zA-Z0-9._-]+/g, '-')
|
|
79
78
|
.replace(/^-+|-+$/g, '') || 'workspace';
|
|
80
|
-
return (0, node_path_1.resolve)(
|
|
79
|
+
return (0, node_path_1.resolve)(configState.baseDir, folderName, safeProjectName);
|
|
81
80
|
}
|
|
82
81
|
function resolveBundledAcpCommand(packageName, binName) {
|
|
83
82
|
const require = (0, node_module_1.createRequire)(__filename);
|
|
@@ -274,10 +274,10 @@ async function handleEdit(jobId, flags, env, io, json) {
|
|
|
274
274
|
if (cronExpr) {
|
|
275
275
|
input.cronExpr = cronExpr;
|
|
276
276
|
}
|
|
277
|
-
if (
|
|
277
|
+
if (promptTemplate) {
|
|
278
278
|
input.promptTemplate = promptTemplate;
|
|
279
279
|
}
|
|
280
|
-
if (
|
|
280
|
+
if (description) {
|
|
281
281
|
input.description = description;
|
|
282
282
|
}
|
|
283
283
|
if (typeof enabled === 'boolean') {
|
|
@@ -175,7 +175,7 @@ function bootstrapLocalCoreRuntime(options) {
|
|
|
175
175
|
let weixinChannelRuntime;
|
|
176
176
|
const channelPlugins = (0, catalog_js_1.createRuntimeChannelPlugins)({
|
|
177
177
|
store,
|
|
178
|
-
readConfig: async () => (await
|
|
178
|
+
readConfig: async () => (await store.readRuntimeConfig()).config,
|
|
179
179
|
getWorkspaceRouter: () => workspaceRouter,
|
|
180
180
|
log: options.log,
|
|
181
181
|
});
|
|
@@ -240,7 +240,7 @@ function bootstrapLocalCoreRuntime(options) {
|
|
|
240
240
|
store,
|
|
241
241
|
cliBinDir: state.cliBinDir,
|
|
242
242
|
localCoreBase: options.localCoreBase,
|
|
243
|
-
|
|
243
|
+
readRuntimeConfig: async () => store.readRuntimeConfig(),
|
|
244
244
|
getCapabilities: () => kernel.getCapabilitySnapshot(),
|
|
245
245
|
getAgentRuntimes: () => agentRuntimes,
|
|
246
246
|
eventBus: kernel.context.bus,
|
|
@@ -32,7 +32,7 @@ function resolveAgentModel(project, providers, definition) {
|
|
|
32
32
|
}
|
|
33
33
|
function toLocalCoreProjectConfig(configState, project) {
|
|
34
34
|
const rawWorkDir = String(project.agent?.options?.work_dir || '.').trim() || '.';
|
|
35
|
-
const configDir =
|
|
35
|
+
const configDir = configState.baseDir;
|
|
36
36
|
const workDir = (0, node_path_1.isAbsolute)(rawWorkDir) ? rawWorkDir : (0, node_path_1.resolve)(configDir, rawWorkDir);
|
|
37
37
|
const rawArgs = project.agent?.options?.args;
|
|
38
38
|
const args = Array.isArray(rawArgs)
|
|
@@ -68,8 +68,9 @@ class WorkspaceRouter {
|
|
|
68
68
|
async listWorkspaces() {
|
|
69
69
|
const localProjects = await this.listLocalCoreProjects();
|
|
70
70
|
const workspaceMap = new Map();
|
|
71
|
+
const configState = await this.options.readRuntimeConfig();
|
|
71
72
|
for (const project of localProjects) {
|
|
72
|
-
const route = this.resolveProjectRoute(
|
|
73
|
+
const route = this.resolveProjectRoute(configState, project);
|
|
73
74
|
if (!route) {
|
|
74
75
|
continue;
|
|
75
76
|
}
|
|
@@ -463,8 +464,8 @@ class WorkspaceRouter {
|
|
|
463
464
|
: route;
|
|
464
465
|
}
|
|
465
466
|
async getWorkspaceRoute(workspaceId, agentTypeOverride = '') {
|
|
466
|
-
const configState = await this.options.
|
|
467
|
-
const projects = Array.isArray(configState.
|
|
467
|
+
const configState = await this.options.readRuntimeConfig();
|
|
468
|
+
const projects = Array.isArray(configState.config?.projects) ? configState.config.projects : [];
|
|
468
469
|
const matched = projects.find((project) => String(project?.name || '').trim() === workspaceId);
|
|
469
470
|
const project = matched && agentTypeOverride ? withAgentTypeOverride(matched, agentTypeOverride) : matched;
|
|
470
471
|
const route = project ? this.resolveProjectRoute(configState, project) : null;
|
|
@@ -474,13 +475,13 @@ class WorkspaceRouter {
|
|
|
474
475
|
return route;
|
|
475
476
|
}
|
|
476
477
|
async listLocalCoreProjects() {
|
|
477
|
-
const configState = await this.options.
|
|
478
|
-
const projects = Array.isArray(configState.
|
|
478
|
+
const configState = await this.options.readRuntimeConfig();
|
|
479
|
+
const projects = Array.isArray(configState.config?.projects) ? configState.config.projects : [];
|
|
479
480
|
return projects.filter((project) => this.resolveProjectRoute(configState, project));
|
|
480
481
|
}
|
|
481
482
|
async syncConfiguredWorkspaces() {
|
|
482
|
-
const config = await this.options.
|
|
483
|
-
const projects = Array.isArray(config.
|
|
483
|
+
const config = await this.options.readRuntimeConfig();
|
|
484
|
+
const projects = Array.isArray(config.config?.projects) ? config.config.projects : [];
|
|
484
485
|
for (const project of projects) {
|
|
485
486
|
const route = this.resolveProjectRoute(config, project);
|
|
486
487
|
if (!route) {
|