dorkos 0.81.0 → 0.82.0

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 (81) hide show
  1. package/dist/bin/cli.js +973 -467
  2. package/dist/client/assets/{AboutPage-CG2PlGB9.js → AboutPage-WmtNTKyp.js} +1 -1
  3. package/dist/client/assets/{AppearancePage-uc6vrPjQ.js → AppearancePage-D7ZHuThu.js} +1 -1
  4. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-CZ9OxU7F.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-wUJCR3vL.js} +1 -1
  5. package/dist/client/assets/{BlintzCanvas-C0dWt42q.js → BlintzCanvas-BXKUjnNQ.js} +1 -1
  6. package/dist/client/assets/{CanvasCsvContent-DpTj502y.js → CanvasCsvContent-BLAtnhdQ.js} +1 -1
  7. package/dist/client/assets/{CanvasFileContent-BfbMK0ME.js → CanvasFileContent-VogEwZeM.js} +2 -2
  8. package/dist/client/assets/{CanvasModel3dContent-BjkWZBVq.js → CanvasModel3dContent-DCTC7eOc.js} +2 -2
  9. package/dist/client/assets/{CodeMirrorDiff-BtkeZDXX.js → CodeMirrorDiff-Cpi43Atp.js} +1 -1
  10. package/dist/client/assets/{CodeMirrorEditor-C2mjcn0M.js → CodeMirrorEditor-CviERH82.js} +1 -1
  11. package/dist/client/assets/{ConnectionAccessLists-CrvGcp6D.js → ConnectionAccessLists-Be1b30nn.js} +1 -1
  12. package/dist/client/assets/{ConnectionsPage-C2q7w1vY.js → ConnectionsPage-BVN7GiuC.js} +1 -1
  13. package/dist/client/assets/{ConventionPage-CGoZt1nC.js → ConventionPage-Coim_h2z.js} +1 -1
  14. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-Dl7G5M5j.js → FloatingTanStackRouterDevtools-CqogiFob-lqp1rgj8.js} +1 -1
  15. package/dist/client/assets/HandlePage-DnzPN8N_.js +1 -0
  16. package/dist/client/assets/{LexicalField-CCu1Ihg3.js → LexicalField-DPe-aAXb.js} +1 -1
  17. package/dist/client/assets/{ManagesPage-c1KIJkFC.js → ManagesPage-BZS2TdZL.js} +1 -1
  18. package/dist/client/assets/{Model3dViewer-BO0fwX9g.js → Model3dViewer-qs0tZlVU.js} +1 -1
  19. package/dist/client/assets/NamePage-DyWqRDIe.js +1 -0
  20. package/dist/client/assets/{NotificationsPage-BVSSDb9i.js → NotificationsPage-gmiItsT0.js} +1 -1
  21. package/dist/client/assets/{PersonalityPopover-CI9kf81k.js → PersonalityPopover-Dej6dI7y.js} +1 -1
  22. package/dist/client/assets/PhotoPage-GtCoB8dK.js +1 -0
  23. package/dist/client/assets/{RoomsPage-B7s1XM1i.js → RoomsPage-3_HuXajd.js} +1 -1
  24. package/dist/client/assets/{RunsOnPopover-LTrQIz4S.js → RunsOnPopover-DbSoBFaL.js} +1 -1
  25. package/dist/client/assets/{SessionsPage-FLHcXJLg.js → SessionsPage-Dc_lqBom.js} +1 -1
  26. package/dist/client/assets/{SkillsPage-loa1-bcL.js → SkillsPage-C0qMUkgs.js} +1 -1
  27. package/dist/client/assets/{TasksPage-CjTt9J5n.js → TasksPage-DvzTPDnw.js} +1 -1
  28. package/dist/client/assets/{ToolsPage-DMnjLq2L.js → ToolsPage-Cwc96TTa.js} +1 -1
  29. package/dist/client/assets/{TopologyGraph-CRAGEuPI.js → TopologyGraph-C-BTnRXU.js} +2 -2
  30. package/dist/client/assets/{agent-browser-DH-qe6tt.js → agent-browser-DT3ABR4l.js} +1 -1
  31. package/dist/client/assets/{highlighted-body-KPVGNVTW-CKyNuC2a.js → highlighted-body-KPVGNVTW-CVFODbIg.js} +1 -1
  32. package/dist/client/assets/{index-BHz_iLMm.js → index-B3P6TTvD.js} +3 -3
  33. package/dist/client/assets/{index-CCa_zFfO.js → index-B8oHvyN5.js} +1 -1
  34. package/dist/client/assets/{index-DRBI-tjH.js → index-BUxNND2H.js} +1 -1
  35. package/dist/client/assets/{index-CoJiX2o7.js → index-BZaMgVdg.js} +1 -1
  36. package/dist/client/assets/{index-CWuLOWsu.js → index-BrgOWbRQ.js} +2 -2
  37. package/dist/client/assets/{index-Z0979U-2.js → index-BuU7EEtP.js} +1 -1
  38. package/dist/client/assets/{index-9FBdK--F.js → index-ByCzVYkU.js} +1 -1
  39. package/dist/client/assets/index-C08DUVQ4.css +1 -0
  40. package/dist/client/assets/{index-BaITIF12.js → index-CGqPFWQw.js} +1 -1
  41. package/dist/client/assets/{index-Cn5LkLHK.js → index-CN1plkKF.js} +1 -1
  42. package/dist/client/assets/{index-Criu5f4m.js → index-CXWMnEDK.js} +1 -1
  43. package/dist/client/assets/{index-UTvS0wz6.js → index-CaZw0EC7.js} +1 -1
  44. package/dist/client/assets/{index-B0rpOocp.js → index-Cca_q1vW.js} +1 -1
  45. package/dist/client/assets/{index-BGLRcYYE.js → index-CgakJfik.js} +1 -1
  46. package/dist/client/assets/{index-CgTvuqsz.js → index-ClmokM0M.js} +1 -1
  47. package/dist/client/assets/{index-CGYDEGb1.js → index-ClnyhFUL.js} +1 -1
  48. package/dist/client/assets/index-DDXrdlj0.js +1648 -0
  49. package/dist/client/assets/{index-hnccffr-.js → index-DEA1uIWn.js} +1 -1
  50. package/dist/client/assets/{index-D2P8UWWS.js → index-DF5k9E7k.js} +1 -1
  51. package/dist/client/assets/{index-DBsoxmLK.js → index-DGr90Ygi.js} +1 -1
  52. package/dist/client/assets/{index-D-nXANER.js → index-DIkpB_1y.js} +1 -1
  53. package/dist/client/assets/{index-CugRpUpy.js → index-DN8DYUEX.js} +1 -1
  54. package/dist/client/assets/{index-BVkt7309.js → index-D_gnDrw3.js} +1 -1
  55. package/dist/client/assets/{index-O1R1Ir-o.js → index-DbsvSNI-.js} +1 -1
  56. package/dist/client/assets/{index-37p1_k_N.js → index-DgjZhEr3.js} +1 -1
  57. package/dist/client/assets/{index-BmHCO7JA.js → index-Dh-3NGE9.js} +1 -1
  58. package/dist/client/assets/{index-Bq1ocT_z.js → index-DiFG9bwF.js} +1 -1
  59. package/dist/client/assets/{index-_r_3OCOV.js → index-DiFc1nSZ.js} +1 -1
  60. package/dist/client/assets/{index-CPiL-M1V.js → index-DjY4p5H5.js} +1 -1
  61. package/dist/client/assets/{index-0R0NT72V.js → index-Dm6W0lml.js} +1 -1
  62. package/dist/client/assets/{index-CT4uhPjz.js → index-J8BMKg6y.js} +1 -1
  63. package/dist/client/assets/{index-C_H8Na06.js → index-PRwgIfzy.js} +2 -2
  64. package/dist/client/assets/{index-DN2SO8dj.js → index-PrqHZbD1.js} +1 -1
  65. package/dist/client/assets/{index-BPl8DTOI.js → index-W25uMuZA.js} +1 -1
  66. package/dist/client/assets/{index-C6itZC0I.js → index-kzr7_3di.js} +1 -1
  67. package/dist/client/assets/{index-BhMgFrop.js → index-lciid4H8.js} +1 -1
  68. package/dist/client/assets/{index-BL-LFVsO.js → index-nEQI8fB2.js} +1 -1
  69. package/dist/client/assets/{room-files-source-BmK7_zzB.js → room-files-source-CSKgcbkn.js} +1 -1
  70. package/dist/client/assets/{soul-file-0ee-EflV.js → soul-file-BHeAw6R9.js} +1 -1
  71. package/dist/client/assets/{use-mesh-update-D1KVLTOA.js → use-mesh-update-BP_UXq60.js} +1 -1
  72. package/dist/client/assets/{use-personality-commit-KFutjy9j.js → use-personality-commit-DyJAMzzb.js} +1 -1
  73. package/dist/client/index.html +2 -2
  74. package/dist/server/index.js +28630 -24454
  75. package/dist/server/index.js.map +2 -2
  76. package/package.json +3 -3
  77. package/dist/client/assets/HandlePage-DbVA5ABk.js +0 -1
  78. package/dist/client/assets/NamePage-Cvksm2Vr.js +0 -1
  79. package/dist/client/assets/PhotoPage-DOvne6fS.js +0 -1
  80. package/dist/client/assets/index-D9FWq0Sm.css +0 -1
  81. package/dist/client/assets/index-DyAjYNxU.js +0 -1636
@@ -1,4 +1,4 @@
1
- var Hh=Object.defineProperty;var Vh=(n,t,e)=>t in n?Hh(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var k=(n,t,e)=>Vh(n,typeof t!="symbol"?t+"":t,e);import{r as z,j as lt,gn as qh,go as Gh,gp as Yh,gb as Xh,gq as Qh}from"./index-DyAjYNxU.js";function w(n,...t){const e=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of t)r.append("v",o);throw e.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Nu(n,...t){const e=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of t)r.append("v",o);e.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Zh(){return typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0}const ee=Zh();function tg(){return ee&&"documentMode"in document?document.documentMode:null}const eg=tg();function ng(n){return ee&&n.test(navigator.platform)}function ro(n){return ee&&n.test(navigator.userAgent)}const Yn=ng(/Mac|iPod|iPhone|iPad/),Oe=ro(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function rg(){return!(!ee||!("InputEvent"in window)||eg)&&"getTargetRanges"in new window.InputEvent("input")}const Xn=rg();function og(){return ee&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}const $e=og(),Eu=ro(/Android/),oo=ro(/Version\/[\d.]+.*Safari/)&&!Eu,wu=ro(/^(?=.*Chrome).*/i),Wo=ee&&Eu&&wu,io=ro(/AppleWebKit\/[\d.]+/)&&Yn&&!wu,Ou=128;function ig(){return 2047}const sg=ig(),Br=oo||$e||io?" ":"​",cn=`
1
+ var Hh=Object.defineProperty;var Vh=(n,t,e)=>t in n?Hh(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var k=(n,t,e)=>Vh(n,typeof t!="symbol"?t+"":t,e);import{r as z,j as lt,gn as qh,go as Gh,gp as Yh,gb as Xh,gq as Qh}from"./index-DDXrdlj0.js";function w(n,...t){const e=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of t)r.append("v",o);throw e.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Nu(n,...t){const e=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const o of t)r.append("v",o);e.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${e.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Zh(){return typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0}const ee=Zh();function tg(){return ee&&"documentMode"in document?document.documentMode:null}const eg=tg();function ng(n){return ee&&n.test(navigator.platform)}function ro(n){return ee&&n.test(navigator.userAgent)}const Yn=ng(/Mac|iPod|iPhone|iPad/),Oe=ro(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function rg(){return!(!ee||!("InputEvent"in window)||eg)&&"getTargetRanges"in new window.InputEvent("input")}const Xn=rg();function og(){return ee&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}const $e=og(),Eu=ro(/Android/),oo=ro(/Version\/[\d.]+.*Safari/)&&!Eu,wu=ro(/^(?=.*Chrome).*/i),Wo=ee&&Eu&&wu,io=ro(/AppleWebKit\/[\d.]+/)&&Yn&&!wu,Ou=128;function ig(){return 2047}const sg=ig(),Br=oo||$e||io?" ":"​",cn=`
2
2
 
3
3
  `,ol=Oe?" ":Br,Ct={bold:1,capitalize:1024,code:16,highlight:Ou,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},$u={directionless:1,unmergeable:2},Qn={center:2,end:6,justify:4,left:1,right:3,start:5};function Mu(n){const t={};for(const e of Object.keys(n))t[n[e]]=e;return t}const Fu=Mu(Qn),il={normal:0,segmented:2,token:1},Au=Mu(il),sl="$",lg=Symbol.for("@lexical/ctrlOrOtherKey"),Ui="$config";function ji(){return gt()._blockCursorElement}function Ji(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-slot")}const cg=io||$e||oo;function ec(){const n=ot().createElement("img");n.setAttribute("data-lexical-decorator-boundary","true"),n.alt="";for(const[t,e]of[["position","absolute"],["width","0px"],["height","0px"],["border","0px"],["margin","0px"],["padding","0px"]])n.style.setProperty(t,e,"important");return n}function Uo(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-decorator-boundary")}let Du=class $o{constructor(t,e,r){k(this,"element");k(this,"before");k(this,"after");this.element=t,this.before=e||null,this.after=r||null}withBefore(t){return new $o(this.element,t,this.after)}withAfter(t){return new $o(this.element,this.before,t)}withElement(t){return this.element===t?this:new $o(t,this.before,this.after)}insertChild(t){const e=this.getInsertionAnchor();return e!==null&&e.parentElement!==this.element&&w(357),this.element.insertBefore(t,e),this}removeChild(t){return t.parentElement!==this.element&&w(358),this.element.removeChild(t),this}replaceChild(t,e){return e.parentElement!==this.element&&w(359),this.element.replaceChild(t,e),this}getFirstChild(){const t=this.getFirstChildAnchor(),e=t?t.nextSibling:this.element.firstChild;return e===this.getInsertionAnchor()?null:e}getFirstChildAnchor(){return this.after}resolveLeafPosition(t,e,r){if(this.element===t)return e===t&&r===0?"before":"after";const o=nc(t,this.element);if(o===null)return"after";const i=Array.prototype.indexOf.call(t.childNodes,o);if(i<0)return"after";if(e===t)return r<=i?"before":"after";const s=nc(t,e);if(s===null)return"after";const l=Array.prototype.indexOf.call(t.childNodes,s);return l>=0&&l<=i?"before":"after"}getInsertionAnchor(){return this.before}};function nc(n,t){let e=t;for(;e!==null&&e.parentNode!==n;)e=e.parentNode;return e}let Pu=class Mo extends Du{withBefore(t){return new Mo(this.element,t,this.after)}withAfter(t){return new Mo(this.element,this.before,t)}withElement(t){return this.element===t?this:new Mo(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor("trailing")}getFirstChildAnchor(){let t=super.getFirstChildAnchor(),e=t?t.nextSibling:this.element.firstChild;for(;Ji(e);)t=e,e=e.nextSibling;Uo(e)&&(t=e,e=e.nextSibling);const r=t?t.nextSibling:this.element.firstChild;return r!==null&&r===ji()?r:t}getDecoratorBoundaryAnchor(t){let e;if(t==="leading"){const r=super.getFirstChildAnchor();for(e=r?r.nextSibling:this.element.firstChild;Ji(e);)e=e.nextSibling}else e=this.before?this.before.previousSibling:this.element.lastChild,e!==null&&e===ji()&&(e=e.previousSibling);return Uo(e)?e:null}setDecoratorBoundaryAnchor(t,e){const r=this.getDecoratorBoundaryAnchor(t);if(e!==(r!==null))if(r!==null)this.element.removeChild(r);else if(t==="leading"){const o=this.getFirstChildAnchor();this.element.insertBefore(ec(),o?o.nextSibling:this.element.firstChild)}else this.element.insertBefore(ec(),this.before)}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){const e=this.element,r=this.after===null?e.firstChild:this.after.nextSibling,o=t==="empty"&&Ji(r)?null:t;if(e.__lexicalLastChildKind!==o)if(e.__lexicalLastChildKind=o,o===null)this.removeManagedLineBreak();else{const i=o==="decorator"&&cg;this.insertManagedLineBreak(i)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const e=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&e.removeChild(r),e.removeChild(t),e.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const e=this.getManagedLineBreak();if(e){if(t===(e.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before||this.getDecoratorBoundaryAnchor("trailing"),i=ot().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(i,o),t){const s=ot().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){const t=this.getFirstChild(),e=this.getInsertionAnchor();let r=0;for(let o=this.element.firstChild;o!==null&&o!==t&&o!==e;o=o.nextSibling)r++;return r}resolveChildIndex(t,e,r,o){if(r===this.element){const c=this.getFirstChildOffset(),a=ji(),u=this.element.childNodes,f=Math.min(o,u.length);let d=0;for(let h=c;h<f;h++)u[h]!==a&&d++;return[t,Math.min(d,t.getChildrenSize())]}const i=rc(e,r);i.push(o);const s=rc(e,this.element);let l=t.getIndexWithinParent();for(let c=0;c<s.length;c++){const a=i[c],u=s[c];if(a===void 0||a<u)break;if(a>u){l+=1;break}}return[t.getParentOrThrow(),l]}};function rc(n,t){const e=[];let r=t;for(;r!==n&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;e.push(o)}return r!==n&&w(225),e.reverse()}function ag(){let n;try{n="0.51.0+prod.esm"}catch{}return n??'"<unknown>+source"'}const Iu=ag();let vr=class{constructor(){k(this,"_front",new Set);k(this,"_back",new Set);k(this,"_cache")}get size(){return this._front.size+this._back.size}addBack(t){return delete this._cache,this._front.has(t)||this._back.add(t),this}addFront(t){return delete this._cache,this._back.has(t)||this._front.add(t),this}delete(t){return delete this._cache,this._front.delete(t)||this._back.delete(t)}toArray(){const t=Array.from(this._front).reverse();for(const e of this._back)t.push(e);return t}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const en=null;function Lu(n,t=1e3){return n instanceof ps?n.clone():n.size<t?new Map(n):new ps().init(new Map(n),void 0,n.size)}let ps=class Ru{constructor(){k(this,"_mutable",!1);k(this,"_old");k(this,"_nursery");k(this,"_size",0)}clone(){return this._mutable=!1,new Ru().init(this._old,this._nursery,this._size)}init(t,e,r){return this._old=t,this._nursery=e,this._size=r,this}get size(){return this._size}has(t){return this.get(t)!==void 0}getWithTombstone(t){const e=this._nursery&&this._nursery.get(t);return e!==void 0?e:this._old&&this._old.get(t)}get(t){const e=this.getWithTombstone(t);return e===en?void 0:e}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(t=!1){if(this._nursery&&this._nursery.size>0&&(t||this.shouldCompact())){const e=new Map(this._old);for(const[r,o]of this._nursery)o!==en?e.set(r,o):e.delete(r);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(t,e){const r=this.getWithTombstone(t);if(r===e)return this;const o=this.getNursery();return r!==en&&r!==void 0||(this._size++,r===en&&o.delete(t)),o.set(t,e),this}delete(t){const e=this.has(t);return e&&(this.getNursery().set(t,en),this._size--),e}getOrInsert(t,e){const r=this.get(t);return r!==void 0?r:(this.set(t,e),e)}getOrInsertComputed(t,e){const r=this.get(t);if(r!==void 0)return r;const o=e(t);return this.set(t,o),o}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const t of this.entries())yield t[0]}*values(){for(const t of this.entries())yield t[1]}*entries(){const t=this._nursery,e=this._old;if(t){if(e)for(const r of e){const o=r[0],i=t.get(o);i!==en&&(i!==void 0&&(r[1]=i),yield r)}for(const r of t)r[1]===en||e&&e.has(r[0])||(yield r)}else e&&(yield*e)}forEach(t,e){e!==void 0&&(t=t.bind(e));for(const[r,o]of this.entries())t(o,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}},Or=!1;function ug(n,t,...e){const r=Or;let o;try{Or=n,o=t()}finally{Or=r}var i;return(i=o)===null||typeof i!="object"&&typeof i!="function"||typeof i.then!="function"||w(421),o}function fg(){return Or}function zu(n){const t=n.exportJSON(Or),e=n.constructor;return t.type!==e.getType()&&w(130,e.name),b(n)&&!Array.isArray(t.children)&&w(59,e.name),t}function jo(n,t,e,r,o,i){if(b(n)){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===t&&((b(s)||un(s)&&s.__slots!==null)&&jo(s,l,e,r,o,i),e.has(l)||i.delete(l),o.push(l)),s=s.getNextSibling()}}for(const s of un(n)&&n.__slots!==null?n.__slots.values():[]){const l=r.get(s);l!==void 0&&Sn(l)&&l.__slotHost===t&&((b(l)||un(l)&&l.__slots!==null)&&jo(l,s,e,r,o,i),e.has(s)||i.delete(s),o.push(s))}}let _s=!1,ll=0;function dg(n){ll=n.timeStamp}function Hi(n,t,e){const r=n.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(n===o||r&&n.previousSibling===o)||r&&gr(n,e)!==void 0}function hg(n,t,e){const r=Lt(Kt(e)),o=r&&Bt(r,e._rootElement);let i=null,s=null;o!==null&&o.anchorNode===n&&(i=o.anchorOffset,s=o.focusOffset);const l=n.nodeValue;l!==null&&Fl(t,l,i,s,!1)}function gg(n,t,e){if(O(n)){const r=n.anchor.getNode();if(r.is(e)&&n.format!==r.getFormat())return!1}return ve(t)&&e.isAttached()}function pg(n,t,e){for(let r=n;r&&!Td(r);r=$n(r)){const o=gr(r,t);if(o!==void 0){const i=nt(o,e);if(i)return J(i)||!q(r)?void 0:[r,i]}}}function Bu(n,t,e){_s=!0;const r=performance.now()-ll>100;try{te(n,()=>{const o=A()||(function(f){return f.read("latest",()=>{const d=A();return d!==null?d.clone():null})})(n),i=new Map,s=n._editorState,l=n._blockCursorElement;let c=!1,a="";for(let f=0;f<t.length;f++){const d=t[f],h=d.type,g=d.target,_=pg(g,n,s);if(!_)continue;const[m,p]=_;if(h==="characterData")r&&M(p)&&ve(g)&&gg(o,g,p)&&hg(g,p,n);else if(h==="childList"){c=!0;const y=d.addedNodes;for(let S=0;S<y.length;S++){const C=y[S],N=ud(C),T=C.parentNode;if(!(T==null||C===l||N!==null||Hi(C,T,n)||Uo(C)||n._slotsUsed&&q(C)&&C.hasAttribute("data-lexical-slot")||Td(C))){if(Oe){const E=(q(C)?C.innerText:null)||C.nodeValue;E&&(a+=E)}T.removeChild(C)}}const x=d.removedNodes,v=x.length;if(v>0){let S=0;for(let C=0;C<v;C++){const N=x[C];Hi(N,g,n)||l===N?(g.appendChild(N),S++):Uo(N)&&S++}v!==S&&i.set(m,p)}}}if(i.size>0)for(const[f,d]of i)d.reconcileObservedMutation(f,n);const u=e.takeRecords();if(u.length>0){for(let f=0;f<u.length;f++){const d=u[f],h=d.addedNodes,g=d.target;for(let _=0;_<h.length;_++){const m=h[_],p=m.parentNode;p==null||m.nodeName!=="BR"||Hi(m,g,n)||p.removeChild(m)}}e.takeRecords()}o!==null&&(c&&St(o),Oe&&_d(n)&&o.insertRawText(a))})}finally{_s=!1}}function Ku(n){const t=n._observer;t!==null&&Bu(n,t.takeRecords(),t)}function Wu(n){(function(t){ll===0&&Kt(t).addEventListener("textInput",dg,!0)})(n),n._observer=new MutationObserver((t,e)=>{Bu(n,t,e)})}function Uu(n,t,e){const{isEqual:r}=n;return t===e||r!==void 0&&r(t,e)}function cl(n,t){return Uu(n,t,n.defaultValue)}function Je(n){return typeof n=="object"&&n!==null}function ne(n,t){const e=Ni(n,t).getter;return Je(e)&&e.getterTable!==void 0||w(405,t),al(e.getterTable)}function ce(n,t){const e=Ni(n,t).setter;return Je(e)&&e.setterTable!==void 0||w(406,t),al(e.setterTable)}function Zn(n,t,e){let{meta:r}=Ni(n,t);for(let o=0;;){if(r.kind==="aliased")return al(r.aliases);r.kind==="nullable"||r.kind==="optional"?r=r.inner.meta:r.kind==="array"?r=r.item.meta:w(407,t,String(e))}}function ae(n,t){const e=Ni(n,t),{setter:r}=e;Je(r)&&r.setterTable!==void 0||w(408,t);const o=String(e.defaultValue);return Ke(r.setterTable,o)||w(409,t,o),r.setterTable[o]}function al(n){return Object.assign(Object.create(null),n)}function Ni(n,t){const e=n.get(t);return e===void 0&&w(410,t),e}function Nn(n,t,e,r,o){o!==void 0&&_g.add(o);const i=e===void 0,s=i?n(void 0):e;return i&&Ju(s),Object.assign(n,{accepts:o,defaultValue:s,isEqual:r,meta:t})}const _g=new WeakSet,ju=new WeakSet;function mg(n){return n!==null&&typeof n=="object"&&ju.add(n),n}function Ju(n){if(n!==null&&typeof n=="object"&&!Object.isFrozen(n)&&!ju.has(n)){Object.freeze(n);for(const t of Object.values(n))Ju(t)}}function Hu(n){const{isEqual:t}=n;return t===void 0?void 0:(e,r)=>e==null||r==null?e===r:t(e,r)}function Vu(n,t){return e=>t(e)||ul(n,e)}function ul(n,t){const{accepts:e}=n;return e!==void 0?e.call(n,t):(function(r,o){const{accepts:i}=r;if(i!==void 0)return ul(r,o)?{parsed:r(o)}:void 0;const s=r(o);return cl(r,s)&&o!==r.defaultValue?void 0:{parsed:s}})(n,t)!==void 0}function Ke(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function re(n=""){return Nn(t=>typeof t=="string"?t:n,{kind:"string"},void 0,void 0,t=>typeof t=="string")}const yg=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function He(n=0,t={}){const{integer:e,clamp:r}=t,o=e&&t.min!==void 0?Math.ceil(t.min):t.min,i=e&&t.max!==void 0?Math.floor(t.max):t.max,s=a=>typeof a=="string"&&yg.test(a)?Number(a):a,l=a=>typeof a=="number"&&Number.isFinite(a)&&(!e||Number.isInteger(a)),c=a=>l(a)&&(o===void 0||a>=o)&&(i===void 0||a<=i);return Nn(a=>{const u=s(a);return r&&l(u)?o!==void 0&&u<o?o:i!==void 0&&u>i?i:u:c(u)?u:n},{clamp:r,integer:e,kind:"number",max:i,min:o},void 0,void 0,a=>r?l(s(a)):c(s(a)))}function fl(n=!1){return Nn(t=>typeof t=="boolean"?t:n,{kind:"boolean"},void 0,void 0,t=>typeof t=="boolean")}function dn(n,...t){const e=mg(t.length!==0?t[0]:n[0]),r=new Set(n);return Nn(o=>o!==void 0&&r.has(o)?o:e,{kind:"enum",values:n},e,void 0,o=>r.has(o)&&(o!==void 0||e===void 0))}function $r(n,t={}){const{defaultAsNull:e}=t;return Nn(r=>{if(r==null)return null;const o=n(r);return e&&cl(n,o)?null:o},{defaultAsNull:e,inner:n,kind:"nullable"},void 0,Hu(n),Vu(n,r=>r==null))}function Jo(n,t={}){const{omitDefault:e}=t;return Nn(r=>{if(r===void 0)return;const o=n(r);return e&&cl(n,o)?void 0:o},{inner:n,kind:"optional",omitDefault:e},void 0,Hu(n),Vu(n,r=>r===void 0))}function xe(){return n=>(function(t){return{meta:{fields:t,kind:"node"}}})(n)}function ms(n,t){const e=r=>typeof r=="string"&&Ke(t,r);return Nn(r=>e(r)?t[r]:n(r),{aliases:t,inner:n,kind:"aliased"},n.defaultValue,n.isEqual,r=>e(r)||ul(n,r))}function Mt(n,t){return qu("withField",n,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}})}function ie(n,t){return qu("withAccessors",n,t)}function qu(n,t,e){return Object.assign(r=>t(r),{accepts:t.accepts,defaultValue:t.defaultValue,getter:e.getter,isEqual:t.isEqual,meta:t.meta,setter:e.setter})}const oc="latest";class xg{constructor(t,e){k(this,"key");k(this,"parse");k(this,"unparse");k(this,"isEqual");k(this,"defaultValue");k(this,"resetOnCopyNode");k(this,"schema");this.key=t;const r="meta"in(o=e.parse)&&typeof o.meta=="object"&&o.meta!==null&&"kind"in o.meta&&typeof o.meta.kind=="string"&&"defaultValue"in o?e.parse:void 0;var o;this.schema=r,this.parse=e.parse.bind(e),this.unparse=(e.unparse||Cg).bind(e),this.isEqual=e.isEqual?e.isEqual.bind(e):r!==void 0&&r.isEqual!==void 0?(i,s)=>Uu(r,i,s):Object.is,this.defaultValue=r!==void 0?r.defaultValue:this.parse(void 0),this.resetOnCopyNode=e.resetOnCopyNode||!1}}function ur(n,t){return new xg(n,t)}function Kr(n,t,e=oc){const r=(e===oc?n.getLatest():n).__state;return r?r.getValue(t):t.defaultValue}function fr(n,t,e){let r;if(xt(),typeof e=="function"){const i=n.getLatest(),s=Kr(i,t);if(r=e(s),t.isEqual(s,r))return i}else r=e;const o=n.getWritable();return Yu(o).updateFromKnown(t,r),o}function vg(n){const t=new Map,e=new Set;for(const{ownNodeConfig:r}of vn(typeof n=="function"?n:n.replace))if(r&&r.stateConfigs)for(const o of r.stateConfigs){let i;"stateConfig"in o?(i=o.stateConfig,o.flat&&e.add(i.key)):i=o,t.set(i.key,i)}return{flatKeys:e,sharedConfigMap:t}}const ic=new Set(["__proto__","constructor","prototype"]);let Sg=class Gu{constructor(t,e,r=void 0,o=new Map,i=void 0){k(this,"node");k(this,"knownState");k(this,"unknownState");k(this,"sharedNodeState");k(this,"size");this.node=t,this.sharedNodeState=e,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,l=i!==void 0?i:(function(c,a,u){let f=u.size;if(a)for(const d in a){const h=c.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=l}getValue(t){const e=this.knownState.get(t);if(e!==void 0)return e;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},e={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(e[r]=t[r],delete t[r]);return sc(t)&&(e[sl]=t),e}getWritable(t){if(this.node===t)return this;const{sharedNodeState:e,unknownState:r}=this,o=new Map(this.knownState);return new Gu(t,e,(function(i,s,l){let c;if(l)for(const[a,u]of Object.entries(l)){if(ic.has(a))continue;const f=i.get(a);f?s.has(f)||s.set(f,f.parse(u)):(c=c||{},c[a]=u)}return c})(e.sharedConfigMap,o,r),o,this.size)}resetOnCopyNode(){for(const t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,e){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=sc(i)),this.size++),o.set(t,e)}updateFromUnknown(t,e){if(ic.has(t))return;const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(e)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=e)}updateFromJSON(t){const{knownState:e}=this;for(const r of e.keys())e.set(r,r.defaultValue);if(this.size=e.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function Yu(n){const t=n.getWritable(),e=t.__state?t.__state.getWritable(t):new Sg(t,(function(r){return r.__state?r.__state.sharedNodeState:ld(gt(),r.getType()).sharedNodeState})(t));return t.__state=e,e}function Xu(n,t){const e=n.getWritable(),r=t[sl];return(e.__state||r)&&Yu(n).updateFromJSON(r),e}function sc(n){if(n)for(const t in n)return n}function Cg(n){return n}function lc(n,t,e){for(const[r,o]of t.knownState){if(n.has(r.key))continue;n.add(r.key);const i=e?e.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function cc(n,t,e){const{unknownState:r}=t,o=e?e.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!n.has(i)&&(n.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function ac(n,t){const e=n.__state;return e&&e.node===n?e.getWritable(t):e}function uc(n,t){const e=n.__mode,r=n.__format,o=n.__style,i=t.__mode,s=t.__format,l=t.__style,c=n.__state,a=t.__state;return(e===null||e===i)&&(r===null||r===s)&&(o===null||o===l)&&(n.__state===null||c===a||(function(u,f){if(u===f)return!0;const d=new Set;return!(u&&lc(d,u,f)||f&&lc(d,f,u)||u&&cc(d,u,f)||f&&cc(d,f,u))})(c,a))}function fc(n,t){const e=n.mergeWithSibling(t),r=G()._normalizedNodes;return r.add(n.__key),r.add(t.__key),e}function dc(n){let t,e,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&M(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(uc(t,r)){r=fc(t,r);break}break}t.remove()}for(;(e=r.getNextSibling())!==null&&M(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(uc(r,e)){r=fc(r,e);break}break}e.remove()}}else r.remove()}function dl(n){return hc(n.anchor),hc(n.focus),n}function hc(n){for(;n.type==="element";){const t=n.getNode(),e=n.offset;let r,o;if(e===t.getChildrenSize()?(r=t.getChildAtIndex(e-1),o=!0):(r=t.getChildAtIndex(e),o=!1),M(r)){n.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!b(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}const Ho=Symbol.for("@lexical/CachedTextSize");function gc(n,t){return xs.read(()=>{let e=0,r=n;for(let o=0;o<t&&r!==null;o++){const i=oe.get(r);if(i===void 0&&w(345,r),b(i)){const s=st.get(r);if(s!==void 0&&b(s)&&s.__parent!==i.__parent)e+=i.getTextContentSize();else{const l=hn.get(r),c=l&&l.__lexicalTextContent;typeof c!="string"&&w(346,i.getType()),e+=c.length}o<t-1&&!i.isInline()&&(e+=2)}else{const s=i[Ho];s===void 0&&w(347,i.getType(),r),e+=s}r=i.__next}return e},{editor:V})}function Qu(n){b(n)||n[Ho]===void 0&&(n[Ho]=M(n)?n.__text.length:n.getTextContentSize())}const bg=4;let Wr,V,Ur,j="",ht=null,$t=null,wt=null;function he(){return{firstTextKey:wt,format:ht,style:$t}}function Vt(n){n.firstTextKey!==null&&(ht=n.format,$t=n.style,wt=n.firstTextKey)}function ys(n){if(wt!==null)return;const t=n.__lexicalFirstTextKey;if(t===void 0&&w(348),t===null)return;const e=st.get(t);M(e)&&(ht=e.getFormat(),$t=e.getStyle(),wt=t)}let Ei,Mr,Fr,oe,xs,st,hn,vs,jr,gn,ke=!1,Vo=!1;function We(n,t){const e=oe.get(n),r=st.has(n);if(t!==null){const o=ks(n);o.parentNode===t&&t.removeChild(o)}if(!r){if(V._keyToDOMMap.delete(n),b(e)){const o=_i(e,oe);Ss(o,0,o.length-1,null)}if(e!==void 0){for(const o of qt(e).values()){const i=bs(o);We(o,null),i!==null&&i.remove()}Al(jr,Ur,Ei,e,"destroyed")}}}function Ss(n,t,e,r){for(let o=t;o<=e;++o){const i=n[o];i!==void 0&&We(i,r)}}function nn(n,t){n.setProperty("text-align",t)}const Tg="40px";function Zu(n,t){const e=Wr.theme.indent;if(typeof e=="string"){const r=n.classList.contains(e);t>0&&!r?n.classList.add(e):t<1&&r&&n.classList.remove(e)}n.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * var(--lexical-indent-base-value, ${Tg}))`),Xr(n,"class"),Xr(n,"style")}function tf(n,t){const e=n.style;t===0?nn(e,""):t===1?nn(e,"left"):t===2?nn(e,"center"):t===3?nn(e,"right"):t===4?nn(e,"justify"):t===5?nn(e,"start"):t===6&&nn(e,"end"),Xr(n,"style")}function Cs(n,t){const e=(function(r){const o=r.__dir;if(o!==null)return o;if(ut(r))return null;const i=r.getParent();return i===null||Z(i)&&i.__dir===null?"auto":null})(t);e!==null?n.dir=e:n.removeAttribute("dir")}function ef(n){const t=ot().createElement("div");return t.setAttribute("data-lexical-slot",n),t.style.display="none",t}function nf(n,t,e){t||n.contentEditable==="false"?__(e,V):e.removeAttribute("contenteditable")}function pc(n,t,e){const r=j,o=he();j="";let i="";const s=J(n);for(const[l,c]of e){const a=ef(l);nf(t,s,a),t.appendChild(a),j="";const u=he();Ue(c,Ut(n,a,V)),Vt(u),rf(n,l,t,a),i+=j}return Vt(o),j=r,i}function qt(n){return un(n)&&n.__slots!==null?n.__slots:Od}function rf(n,t,e,r){const o=gn.$getSlotTargetElement(n,t,e,V);o!==null&&(r.parentElement!==o&&o.appendChild(r),r.style.display="")}function bs(n){const t=hn.get(n);return t!==void 0?t.parentElement:null}function _c(n,t,e){const r=qt(n),o=qt(t);for(const[u,f]of r)if(!o.has(u)){const d=bs(f);We(f,null),d!==null&&d.remove()}const i=j,s=he();let l="",c=null;const a=J(t);for(const[u,f]of o){const d=r.get(u);let h=d!==void 0?bs(d):null;j="";const g=he();if(h===null){h=ef(u);let _=null;for(const m of e.children)if(!m.hasAttribute("data-lexical-slot")){_=m;break}e.insertBefore(h,_),Ue(f,Ut(t,h,V))}else d===f?Te(f,h):(d!==void 0&&We(d,h),Ue(f,Ut(t,h,V)));if(Vt(g),nf(e,a,h),rf(t,u,e,h),l+=j,h.parentElement===e){const _=c===null?e.firstChild:c.nextSibling;_!==h&&e.insertBefore(h,_),c=h}}return Vt(s),j=i,l}function Ue(n,t){const e=st.get(n);if(e===void 0&&w(60),t!==null){const o=oe.get(n);if(o!==void 0){const i=hn.get(n);if(i!==void 0){const s=Sn(o)?o.__slotHost:null,l=Sn(e)?e.__slotHost:null,c=o.__parent!==e.__parent||s!==l,a=l!==null&&i.parentElement!==t.element;if(c||a)return t.insertChild(i),Te(n,t.element)}}}const r=gn.$createDOM(e,V);if((function(o,i,s){const l=s._keyToDOMMap;fd(i,s,o),l.set(o,i)})(n,r,V),M(e)?r.setAttribute("data-lexical-text","true"):J(e)&&(r.setAttribute("data-lexical-decorator","true"),p_(r,{captureSelection:!0})),b(e)){const o=e.__indent,i=e.__size;Cs(r,e),o!==0&&Zu(r,o);const s=qt(e),l=s.size>0?pc(e,r,s):"";if(i===0)r.__lexicalTextContent=l,r.__lexicalFirstTextKey=null,j+=l,s.size>0&&(r.__lexicalSlotTextLength=l.length);else{const a=j,u=i-1;if(Ts(_i(e,st),e,0,u,Ut(e,r,V)),l!==""){const f=r.__lexicalTextContent||"";r.__lexicalTextContent=l+f,j=a+l+f}s.size>0&&(r.__lexicalSlotTextLength=l.length)}const c=e.__format;c!==0&&tf(r,c),e.isInline()||(sf(null,e,r),of(e,r))}else{const o=e.getTextContent();if(J(e)){const i=e.decorate(V,Wr);i!==null&&lf(n,i),r.contentEditable="false";const s=qt(e);s.size>0&&pc(e,r,s)}j+=o}return t!==null&&t.insertChild(r),gn.$decorateDOM(e,null,r,V),Qu(e),Al(jr,Ur,Ei,e,"created"),r}function Ts(n,t,e,r,o){const i=j,s=he();j="",ht=null,$t=null,wt=null;let l=e;for(;l<=r;++l){const a=he();Ue(n[l],o);const u=st.get(n[l]);u!==null&&M(u)?ht===null&&(ht=u.getFormat(),$t=u.getStyle(),wt=u.__key):b(u)&&l<r&&!u.isInline()&&(j+=cn),Vt(a)}const c=V._keyToDOMMap.get(t.__key);c===void 0&&w(349,t.__key),c.__lexicalTextContent=j,c.__lexicalFirstTextKey=wt,j=i+j,Vt(s)}function mc(n,t){if(!n)return!1;const e=t.get(n);return J(e)&&!e.isInline()}function of(n,t){const e=Ut(n,t,V);e.setDecoratorBoundaryAnchor("leading",mc(n.__first,st)),e.setDecoratorBoundaryAnchor("trailing",mc(n.__last,st))}function sf(n,t,e){const r=Ut(t,e,V),o=(function(i,s){if(i){const l=i.__last;if(l){const c=s.get(l);if(c)return Nt(c)?"line-break":J(c)&&c.isInline()?"decorator":null}return"empty"}return null})(t,st);r.setManagedLineBreak(o)}function kg(n,t,e){var r;ht=null,$t=null,wt=null,(function(o,i,s){const l=j,c=o.__size,a=i.__size;j="";const u=s.element,f=V._keyToDOMMap.get(i.__key);f===void 0&&w(351,i.__key);const d=a-c;if(!ke&&Math.abs(d)<=1&&c>=bg&&o.__first===i.__first&&(d!==0||!V._cloneNotNeeded.has(o.__key))){const h=f.__lexicalTextContent,g=vs.get(o.__key);if(!ke&&typeof h=="string"&&g!==void 0){const _=(function(m,p){const y=p.size;if(y===0||y>=m.__size)return null;let x=m.__last,v=null,S=0;for(;x!==null&&S<y;){if(!p.has(x))return null;v=x;const C=st.get(x);if(C===void 0)return null;x=C.__prev,S++}return S!==y||x!==null&&p.has(x)?null:v})(i,g);if(_!==null){const m=g.size;if(d===0){const p=gc(_,m);let y=_,x=0;for(;y!==null&&x<m;){const T=st.get(y);if(T===void 0)break;const E=he();Te(y,u),M(T)&&ht===null&&(ht=T.getFormat(),$t=T.getStyle(),wt=T.__key),Vt(E),y=T.__next,x++}let v="";for(y=_,x=0;y!==null&&x<m;){const T=st.get(y);if(T===void 0)break;let E;if(b(T)){const $=V._keyToDOMMap.get(y),F=$&&$.__lexicalTextContent;typeof F!="string"&&w(352,T.getType()),E=F}else E=T.getTextContent();v+=E,x<m-1&&b(T)&&!T.isInline()&&(v+=cn),y=T.__next,x++}const S=f.__lexicalSlotTextLength||0,C=S>0?h.slice(S):h,N=C.slice(0,C.length-p)+v;return f.__lexicalTextContent=N,j=l+N,void yc(i,f,g)}if((function(p,y,x,v,S,C,N,T){if(T!==1&&T!==-1||N!==(T===1?2:1))return!1;const $=N-T;let F=p.__last;for(let it=0;it<$-1;it++){if(F===null)return!1;const _t=oe.get(F);if(_t===void 0)return!1;F=_t.__prev}if(F===null)return!1;const D=st.get(C),L=oe.get(F);if(D===void 0||L===void 0||D.__prev!==L.__prev)return!1;const B=[];let U=C;for(let it=0;it<N;it++){if(U===null)return!1;B.push(U);const _t=st.get(U);U=_t?_t.__next:null}const Q=[];U=F;for(let it=0;it<$;it++){if(U===null)return!1;Q.push(U);const _t=oe.get(U);U=_t?_t.__next:null}const H=new Set(Q),Et=new Set(B),et=[];let ft=0,dt=0;for(;ft<$&&dt<N;)if(B[dt]===Q[ft])et.push({key:B[dt],kind:"reconcile"}),ft++,dt++;else if(Et.has(Q[ft])){if(H.has(B[dt]))return!1;et.push({key:B[dt],kind:"create",nextIndex:dt}),dt++}else et.push({key:Q[ft],kind:"destroy"}),ft++;for(;ft<$;)et.push({key:Q[ft++],kind:"destroy"});for(;dt<N;)et.push({key:B[dt],kind:"create",nextIndex:dt}),dt++;const Se=gc(F,$);for(const it of et){const _t=he();if(it.kind==="reconcile")Te(it.key,x.element);else if(it.kind==="destroy")We(it.key,x.element);else{let Ht=null;for(let Fn=it.nextIndex+1;Fn<N;Fn++){const xr=V._keyToDOMMap.get(B[Fn]);if(xr!==void 0){Ht=xr;break}}Ue(it.key,x.withBefore(Ht??x.before))}if(it.kind!=="destroy"){const Ht=st.get(it.key);Ht&&M(Ht)&&ht===null&&(ht=Ht.getFormat(),$t=Ht.getStyle(),wt=Ht.__key)}Vt(_t)}let Jt="";for(let it=0;it<N;it++){const _t=st.get(B[it]);if(_t===void 0)return!1;let Ht;if(b(_t)){const Fn=V._keyToDOMMap.get(B[it]),xr=Fn&&Fn.__lexicalTextContent;typeof xr!="string"&&w(350,_t.getType()),Ht=xr}else Ht=_t.getTextContent();Jt+=Ht,it<N-1&&b(_t)&&!_t.isInline()&&(Jt+=cn)}const Ae=v.__lexicalSlotTextLength||0,yr=Ae>0?S.slice(Ae):S;return v.__lexicalTextContent=yr.slice(0,yr.length-Se)+Jt,!0})(o,0,s,f,h,_,m,d)){const p=f.__lexicalTextContent;return typeof p!="string"&&w(353),j=l+p,void yc(i,f,g)}}}if(d===0){let _=o.__first,m=0;for(;_!==null;){const p=st.get(_);if(p===void 0)break;const y=ke||Fr.has(_)||Mr.has(_),x=he();if(y)Te(_,u);else{let v,S;if(b(p)){S=hn.get(_);const C=S&&S.__lexicalTextContent;typeof C!="string"&&w(354,p.getType()),v=C}else v=p.getTextContent();j+=v,S!==void 0&&ys(S)}M(p)?ht===null&&(ht=p.getFormat(),$t=p.getStyle(),wt=p.__key):b(p)&&m<a-1&&!p.isInline()&&(j+=cn),Vt(x),_=p.__next,m++}return f.__lexicalTextContent=j,f.__lexicalFirstTextKey=wt,void(j=l+j)}}if(c===1&&a===1){const h=o.__first,g=i.__first;if(h===g)Te(h,u);else{const m=ks(h),p=Ue(g,null);try{m.parentNode===u?u.replaceChild(p,m):s.insertChild(p)}catch(y){if(typeof y=="object"&&y!=null){const x=`${y.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${g}}, old child: {tag: ${m.tagName}, key: ${h}}.`;throw new Error(x)}throw y}We(h,null)}const _=st.get(g);M(_)&&ht===null&&(ht=_.getFormat(),$t=_.getStyle(),wt=_.__key)}else{const h=_i(o,oe),g=_i(i,st);if(h.length!==c&&w(227),g.length!==a&&w(228),c===0)a!==0&&Ts(g,i,0,a-1,s);else if(a===0){if(c!==0){const _=s.after==null&&s.before==null&&qt(i).size===0&&s.element.__lexicalLineBreak==null;Ss(h,0,c-1,_?null:u),_&&(u.textContent="")}}else(function(_,m,p,y,x,v){const S=y-1,C=x-1;let N,T,E=v.getFirstChild(),$=0,F=0;for(;$<=S&&F<=C;){const B=m[$],U=p[F],Q=he();if(B===U)E=Vi(Te(U,v.element)),$++,F++;else{if(T===void 0&&(T=xc(p,F)),N===void 0)N=xc(m,$);else if(!N.has(B)){$++,Vt(Q);continue}if(!T.has(B)){E=Vi(ks(B)),We(B,v.element),$++,N.delete(B),Vt(Q);continue}if(N.has(U)){const Et=rr(V,U);Et!==E&&v.withBefore(E??v.before).insertChild(Et),E=Vi(Te(U,v.element)),$++,F++}else Ue(U,v.withBefore(E??v.before)),F++}const H=st.get(U);H!==null&&M(H)?ht===null&&(ht=H.getFormat(),$t=H.getStyle(),wt=H.__key):b(H)&&F<=C&&!H.isInline()&&(j+=cn),Vt(Q)}const D=$>S,L=F>C;if(D&&!L){const B=p[C+1],U=B===void 0?null:V.getElementByKey(B);Ts(p,_,F,C,v.withBefore(U??v.before))}else L&&!D&&Ss(m,$,S,v.element)})(i,h,g,c,a,s)}f.__lexicalTextContent=j,f.__lexicalFirstTextKey=wt,j=l+j})(n,t,Ut(t,e,V)),Z(t)||(r=t,ht==null||ht===r.__textFormat||Vo||r.setTextFormat(ht),(function(o){$t==null||$t===o.__textStyle||Vo||o.setTextStyle($t)})(t))}function yc(n,t,e){const r=t.__lexicalFirstTextKey;if(r!=null){const o=n.__key;let i=r;for(;i!==null;){const s=st.get(i);if(s===void 0){i=null;break}if(s.__parent===o)break;i=s.__parent}if(i!==null&&!e.has(i)){const s=st.get(r);if(M(s))return ht=s.getFormat(),void($t=s.getStyle())}}t.__lexicalFirstTextKey=wt}function Te(n,t){const e=oe.get(n);let r=st.get(n);e!==void 0&&r!==void 0||w(61);const o=ke||Fr.has(n)||Mr.has(n),i=rr(V,n);if(e===r&&!o){let s;if(b(e)){const l=i.__lexicalTextContent;typeof l!="string"&&w(355,e.getType()),s=l,ys(i)}else s=e.getTextContent();return j+=s,i}if(e!==r&&o&&Al(jr,Ur,Ei,r,"updated"),gn.$updateDOM(r,e,i,V)){const s=Ue(n,null);return t===null&&w(62),t.replaceChild(s,i),We(n,null),s}if(b(e)){b(r)||w(334,n);const s=r.__indent;(ke||s!==e.__indent)&&Zu(i,s);const l=r.__format;(ke||l!==e.__format)&&tf(i,l);const c=o&&(qt(r).size>0||qt(e).size>0)?_c(e,r,i):"";if(o){const a=j;if(kg(e,r,i),r.isInline()||(ut(r)||sf(0,r,i),of(r,i)),c!==""){const u=i.__lexicalTextContent||"";i.__lexicalTextContent=c+u,j=a+c+u,i.__lexicalSlotTextLength=c.length}else(qt(r).size>0||qt(e).size>0)&&(i.__lexicalSlotTextLength=0)}else{const a=i.__lexicalTextContent;typeof a!="string"&&w(356,e.getType()),j+=a,ys(i)}if((ke||r.__dir!==e.__dir||r.__parent!==e.__parent)&&(Cs(i,r),ut(r)&&!ke))for(const a of r.getChildren())b(a)&&Cs(rr(V,a.getKey()),a)}else{const s=r.getTextContent();if(J(r)){const l=r.decorate(V,Wr);l!==null&&lf(n,l),o&&(qt(r).size>0||qt(e).size>0)&&_c(e,r,i)}j+=s}if(!Vo&&ut(r)){const s=r.getLatest();if(s.__cachedText!==j){const l=s.getWritable();l.__cachedText=j,r=l}}return gn.$decorateDOM(r,e,i,V),Qu(r),i}function lf(n,t){let e=V._pendingDecorators;const r=V._decorators;if(e===null){if(r[n]===t)return;e=dd(V)}e[n]=t}function Vi(n){let t=n.nextSibling;return t!==null&&t===V._blockCursorElement&&(t=t.nextSibling),t}function xc(n,t){const e=new Set;for(let r=t;r<n.length;r++)e.add(n[r]);return e}function Ng(n,t,e,r,o,i){j="",ht=null,$t=null,wt=null,ke=r===2,V=e,Wr=e._config,gn=e._config.dom||ci,Ur=e._nodes,Ei=V._listeners.mutation,Mr=o,Fr=i,oe=n._nodeMap,xs=n,st=t._nodeMap,Vo=t._readOnly,hn=Lu(e._keyToDOMMap),vs=(function(){const l=new Map,c=a=>{for(const u of a){const f=st.get(u);if(f===void 0)continue;const d=f.__parent;if(d===null)continue;let h=l.get(d);h===void 0&&(h=new Set,l.set(d,h)),h.add(u)}};return c(Mr.keys()),c(Fr),l})();const s=new Map;return jr=s,Te("root",null),V=void 0,Ur=void 0,Mr=void 0,Fr=void 0,oe=void 0,xs=void 0,st=void 0,Wr=void 0,hn=void 0,vs=void 0,jr=void 0,gn=ci,s}function ks(n){const t=hn.get(n);return t===void 0&&w(75,n),t}function P(n){return{type:n}}const cf=P("SELECTION_CHANGE_COMMAND"),Eg=P("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),af=P("CLICK_COMMAND"),uf=P("BEFORE_INPUT_COMMAND"),ff=P("INPUT_COMMAND"),df=P("COMPOSITION_START_COMMAND"),hf=P("COMPOSITION_END_COMMAND"),an=P("DELETE_CHARACTER_COMMAND"),zn=P("INSERT_LINE_BREAK_COMMAND"),Jr=P("INSERT_PARAGRAPH_COMMAND"),Bn=P("CONTROLLED_TEXT_INSERTION_COMMAND"),wi=P("PASTE_COMMAND"),Fo=P("REMOVE_TEXT_COMMAND"),Hr=P("DELETE_WORD_COMMAND"),Kn=P("DELETE_LINE_COMMAND"),Le=P("FORMAT_TEXT_COMMAND"),wg=P("SET_TEXT_FORMAT_COMMAND"),qo=P("UNDO_COMMAND"),Vr=P("REDO_COMMAND"),gf=P("KEYDOWN_COMMAND"),pf=P("KEY_ARROW_RIGHT_COMMAND"),Ns=P("MOVE_TO_END"),_f=P("KEY_ARROW_LEFT_COMMAND"),Es=P("MOVE_TO_START"),hl=P("KEY_ARROW_UP_COMMAND"),gl=P("KEY_ARROW_DOWN_COMMAND"),so=P("KEY_ENTER_COMMAND"),mf=P("KEY_SPACE_COMMAND"),pl=P("KEY_BACKSPACE_COMMAND"),_l=P("KEY_ESCAPE_COMMAND"),yf=P("KEY_DELETE_COMMAND"),ml=P("KEY_TAB_COMMAND"),Og=P("INSERT_TAB_COMMAND"),$g=P("INDENT_CONTENT_COMMAND"),vc=P("OUTDENT_CONTENT_COMMAND"),yl=P("DROP_COMMAND"),Mg=P("FORMAT_ELEMENT_COMMAND"),xf=P("DRAGSTART_COMMAND"),xl=P("DRAGOVER_COMMAND"),Fg=P("DRAGEND_COMMAND"),Oi=P("COPY_COMMAND"),vl=P("CUT_COMMAND"),vf=P("SELECT_ALL_COMMAND"),Ag=P("CLEAR_EDITOR_COMMAND"),Dg=P("CLEAR_HISTORY_COMMAND"),po=P("CAN_REDO_COMMAND"),_o=P("CAN_UNDO_COMMAND"),Pg=P("FOCUS_COMMAND"),Ig=P("BLUR_COMMAND"),Lg=P("KEY_MODIFIER_COMMAND");function Sf(n,t){return{...t,[lg]:n}}const rn=Sf("metaKey",{ctrlKey:!Yn,metaKey:Yn}),Sc=Sf("altKey",{altKey:Yn,ctrlKey:!Yn}),Cc=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function qi(n,t,e){const r=n.get(t);r?r.push(e):n.set(t,[e])}class Rg{constructor(){k(this,"byKey",new Map);k(this,"byCode",new Map)}add(t){const{key:e,modifiers:r={}}=t;e.length>0||w(399);const o=e.toLowerCase();for(const i of(function(s){let l=[0];for(const[c,a]of Cc){const u=s[c]||!1;u==="any"?l=l.concat(l.map(f=>f|a)):u&&(l=l.map(f=>f|a))}return l})(r))qi(this.byKey,`${i}:${o}`,t),e.length===1&&(/[0-9]/.test(e)?qi(this.byCode,`${i}:Digit${e}`,t):/[a-z]/.test(o)&&qi(this.byCode,`${i}:Key${o.toUpperCase()}`,t));return this}matches(t){const e=t.key;if(!e)return[];const r=(function(s){let l=0;for(const[c,a]of Cc)s[c]&&(l|=a);return l})(t),o=this.byKey.get(`${r}:${e.toLowerCase()}`),i=o?o.slice():[];if(this.byCode.size>0&&!(e.length===1&&e.charCodeAt(0)<=127)){const s=this.byCode.get(`${r}:${t.code}`);s&&i.push(...s)}return i}match(t){return this.matches(t)[0]}}function zg(n){const t=new Rg;for(const e of n)t.add(e);return t}function Bg(n){const t=new Map;return{dispose(){for(const e of t.values())e.dispose();t.clear()},register(e,r){let o=t.get(e);o===void 0&&(o={dispose:n(e,r),holders:new Set},t.set(e,o));const i=()=>{const s=t.get(e);s&&s.holders.delete(i)&&s.holders.size===0&&(t.delete(e),s.dispose())};return o.holders.add(i),i}}}function Kg(n,t,e,r){return n.addEventListener(t,e,r),n.removeEventListener.bind(n,t,e,r)}const Ce=Object.freeze({});let Gi;function Wg(){if(Gi!==void 0)return Gi;const n=[["keydown",Zg],["pointerdown",Jg],["compositionstart",Gg],["compositionend",Qg],["input",Vg],["click",jg],["cut",Ce],["copy",Ce],["dragstart",Ce],["dragover",Ce],["dragend",Ce],["paste",Ce],["focus",Ce],["blur",Ce],["drop",Ce]];return Xn&&n.push(["beforeinput",(t,e)=>(function(r,o){const i=r.inputType;i==="deleteCompositionText"||Oe&&_d(o)||i!=="insertCompositionText"&&te(o,()=>{kf(r,o)||R(o,uf,r)},{event:r})})(t,e)]),Gi=n,n}const ws=new WeakMap,Go=new WeakMap,Ug=Bg(n=>(n.addEventListener("selectionchange",Oc),()=>n.removeEventListener("selectionchange",Oc)));function Cf(n,t,e,r,o,i){const s=n.anchor,l=n.focus,c=s.getNode(),a=G();let u;if(i!==void 0)u=i;else{const _=Lt(Kt(a));u=_!==null?Bt(_,a._rootElement):null}const f=u!==null?u.anchorNode:null,d=s.key,h=a.getElementByKey(d),g=e.length;return d!==l.key||!M(c)||(!o&&(!Xn||a._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&g<2||hd(e))&&s.offset!==l.offset&&!c.isComposing()||Yt(c)||c.isDirty()&&g>1||(o||!Xn)&&h!==null&&!c.isComposing()&&f!==je(c,h,a)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==n.format||c.getStyle()!==n.style)||(function(_,m){if(m.isSegmented())return!0;if(!_.isCollapsed())return!1;const p=_.anchor.offset,y=m.getParentOrThrow(),x=ai(m);return p===0?!m.canInsertTextBefore()||!y.canInsertTextBefore()&&!m.isComposing()||x||(function(v){const S=v.getPreviousSibling();return(M(S)||b(S)&&S.isInline())&&!S.canInsertTextAfter()})(m):p===m.getTextContentSize()&&(!m.canInsertTextAfter()||!y.canInsertTextAfter()&&!m.isComposing()||x)})(n,c)}function bc(n,t){return ve(n)&&n.nodeValue!==null&&t!==0&&t!==n.nodeValue.length}function Tc(n,t,e){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=Bt(n,t._rootElement),l=t._inputState,c=l.isSelectionChangeFromDOMUpdate;if(c){l.isSelectionChangeFromDOMUpdate=!1;const a=l.selectionChangeFromDOMUpdatePoints;if(l.selectionChangeFromDOMUpdatePoints=null,bc(r,o)&&bc(i,s)&&!l.postDeleteSelectionToRestore&&(a===null||a.anchorNode===r&&a.anchorOffset===o&&a.focusNode===i&&a.focusOffset===s))return}te(t,()=>{if(!e)return void St(null);if(!uo(t,r,i))return;let a=A();if(l.postDeleteSelectionToRestore&&O(a)&&a.isCollapsed()){const f=a.anchor,d=l.postDeleteSelectionToRestore.anchor;(f.key===d.key&&f.offset===d.offset+1||f.offset===1&&d.getNode().is(f.getNode().getPreviousSibling()))&&(a=l.postDeleteSelectionToRestore.clone(),St(a))}if(l.postDeleteSelectionToRestore=null,O(a)){const f=a.anchor,d=f.getNode();if(a.isCollapsed()){n.type==="Range"&&r===i&&(a.dirty=!0);const h=Kt(t).event,g=h?h.timeStamp:performance.now(),{format:_,style:m,offset:p,key:y,timeStamp:x}=l.collapsedSelectionFormat,v=Y(),S=t.isComposing()===!1&&v.getTextContent()==="";if(g<x+200&&f.offset===p&&f.key===y)Ao(a,_,m);else if(f.type==="text")M(d)||w(141),bf(a,d);else if(f.type==="element"&&!S){b(d)||w(259);const C=f.getNode();C.isEmpty()?(function(N,T){const E=T.getTextFormat(),$=T.getTextStyle();Ao(N,E,$)})(a,C):Ao(a,a.format,"")}}else{const h=f.key,g=a.focus.key,_=a.getNodes(),m=_.length,p=a.isBackward(),y=p?s:o,x=p?o:s,v=p?g:h,S=p?h:g;let C=sg,N=!1;for(let T=0;T<m;T++){const E=_[T],$=E.getTextContentSize();if(M(E)&&$!==0&&!(T===0&&E.__key===v&&y===$||T===m-1&&E.__key===S&&x===0)&&(N=!0,C&=E.getFormat(),C===0))break}a.format=N?C:0}}const u=wn();(c||(a!==null?a.dirty||!O(a)||!a.is(u):u!==null))&&R(t,cf)})}function Ao(n,t,e){n.format===t&&n.style===e||(n.format=t,n.style=e,n.dirty=!0)}function bf(n,t){Ao(n,t.getFormat(),t.getStyle())}function jg(n,t){te(t,()=>{const e=A(),r=Lt(Kt(t)),o=wn();if(r){if(O(e)){const i=e.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&e.isCollapsed()&&!ut(s)&&Y().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&e.is(o)&&(r.removeAllRanges(),e.dirty=!0)}else if(n.pointerType==="touch"||n.pointerType==="pen"){const i=Bt(r,t._rootElement).anchorNode;(q(i)||ve(i))&&St(ei(o,r,t,n))}}if(Oe&&r!==null&&r.rangeCount===0){const i=t._rootElement;if(i!==null&&n.target===i){const s=n.clientY;let l=i.childNodes.length;for(let a=0;a<i.childNodes.length;a++){const u=i.childNodes[a];if(q(u)){const f=u.getBoundingClientRect();if(s<=(f.top+f.bottom)/2){l=a;break}}}r.setBaseAndExtent(i,l,i,l);const c=ei(o,r,t,n);c!==null?St(c):r.removeAllRanges()}}R(t,af,n)})}function Jg(n,t){const e=Sd(n),r=n.pointerType;pr(e)&&r!=="touch"&&r!=="pen"&&n.button===0&&te(t,()=>{gi(e,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}function Tf(n){if(!n.getTargetRanges)return null;const t=n.getTargetRanges();return t.length===0?null:t[0]}function kc(n){const{lastKeyCode:t}=G()._inputState;if(n==null||n.length<=1||t==null)return;const e=t.length===1?t:t==="Enter"?`
4
4
  `:t==="Tab"?" ":null;if(!e)return;const r=A();if(!O(r)||!r.isCollapsed())return;const o=r.anchor.getNode();if(!M(o))return;const{offset:i}=r.anchor;if(o.getTextContentSize()===i){const s=o.getNextSibling();if(e===`
@@ -1 +1 @@
1
- import{j as e,t as o,p as r,b as l,C as d}from"./index-DyAjYNxU.js";function c({member:a,onOpen:i}){const t=o(a),n=r(a);return e.jsxs("button",{type:"button",onClick:i,"data-slot":"profile-managed-row",className:"focus-ring hover:bg-muted/50 flex h-11 w-full items-center gap-2.5 rounded-md px-2 text-left transition-colors",children:[e.jsx(l,{size:"sm",kind:t.kind,color:t.color,emoji:t.emoji,imageUrl:t.imageUrl,fallback:t.fallback,origin:t.origin}),e.jsxs("span",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"truncate text-sm",children:a.displayName}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n.text})]}),e.jsx(d,{"aria-hidden":!0,className:"text-muted-foreground/70 ml-auto size-3.5 shrink-0"})]})}function x({member:a,roster:i,onPush:t}){const n=i.filter(s=>s.kind==="agent"&&s.ownerId===a.id);return n.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.isSelf?"You manage":`${a.displayName} manages`," no agents yet."]}):e.jsx("div",{className:"flex flex-col",children:n.map(s=>e.jsx(c,{member:s,onOpen:()=>t({kind:"profile",memberId:s.id})},s.id))})}export{x as ManagesPage};
1
+ import{j as e,t as o,p as r,b as l,C as d}from"./index-DDXrdlj0.js";function c({member:a,onOpen:i}){const t=o(a),n=r(a);return e.jsxs("button",{type:"button",onClick:i,"data-slot":"profile-managed-row",className:"focus-ring hover:bg-muted/50 flex h-11 w-full items-center gap-2.5 rounded-md px-2 text-left transition-colors",children:[e.jsx(l,{size:"sm",kind:t.kind,color:t.color,emoji:t.emoji,imageUrl:t.imageUrl,fallback:t.fallback,origin:t.origin}),e.jsxs("span",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"truncate text-sm",children:a.displayName}),e.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n.text})]}),e.jsx(d,{"aria-hidden":!0,className:"text-muted-foreground/70 ml-auto size-3.5 shrink-0"})]})}function x({member:a,roster:i,onPush:t}){const n=i.filter(s=>s.kind==="agent"&&s.ownerId===a.id);return n.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.isSelf?"You manage":`${a.displayName} manages`," no agents yet."]}):e.jsx("div",{className:"flex flex-col",children:n.map(s=>e.jsx(c,{member:s,onOpen:()=>t({kind:"profile",memberId:s.id})},s.id))})}export{x as ManagesPage};
@@ -1,4 +1,4 @@
1
- var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-DyAjYNxU.js";/**
1
+ var i_=Object.defineProperty;var s_=(r,e,t)=>e in r?i_(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jt=(r,e,t)=>s_(r,typeof e!="symbol"?e+"":e,t);import{r as Xc,j as Kc}from"./index-DDXrdlj0.js";/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -0,0 +1 @@
1
+ import{j as r,h as o}from"./index-DDXrdlj0.js";function a({member:e}){return r.jsx(o,{member:e})}export{a as NamePage};
@@ -1 +1 @@
1
- import{j as t,l as s}from"./index-DyAjYNxU.js";function o({member:i}){var e;const n=((e=i.agent)==null?void 0:e.manifestId)??null;return n===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are kept per agent, and this profile is not one."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:n},emptyLabel:`${i.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
1
+ import{j as t,l as s}from"./index-DDXrdlj0.js";function o({member:i}){var e;const n=((e=i.agent)==null?void 0:e.manifestId)??null;return n===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are kept per agent, and this profile is not one."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:n},emptyLabel:`${i.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
@@ -1 +1 @@
1
- import{u as o,j as t,a as i,z as u}from"./index-DyAjYNxU.js";import{u as l}from"./use-personality-commit-KFutjy9j.js";import"./soul-file-0ee-EflV.js";function f({member:r}){const{agent:e,isPending:a,update:n}=o(r),s=l(e,n);return a?t.jsx(i,{className:"h-40 w-full"}):e?t.jsx(u,{traits:s.traits,onTraitsChange:s.onTraitsChange,compact:!0,className:"p-1"}):t.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s personality."})}export{f as PersonalityPopover};
1
+ import{u as o,j as t,a as i,z as u}from"./index-DDXrdlj0.js";import{u as l}from"./use-personality-commit-DyJAMzzb.js";import"./soul-file-BHeAw6R9.js";function f({member:r}){const{agent:e,isPending:a,update:n}=o(r),s=l(e,n);return a?t.jsx(i,{className:"h-40 w-full"}):e?t.jsx(u,{traits:s.traits,onTraitsChange:s.onTraitsChange,compact:!0,className:"p-1"}):t.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s personality."})}export{f as PersonalityPopover};
@@ -0,0 +1 @@
1
+ import{j as t,k as r}from"./index-DDXrdlj0.js";function i({member:o}){return t.jsx(r,{member:o})}export{i as PhotoPage};
@@ -1 +1 @@
1
- import{e as d,f as l,j as e,a as m,g as u,C as c,M as x,H as f}from"./index-DyAjYNxU.js";function h({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(x,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function g(s){return s===1?"1 member":`${s} members`}function j({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You are":`${s.displayName} is`," not in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(h,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:g(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({to:"/channels",search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{j as RoomsPage};
1
+ import{e as d,f as l,j as e,a as m,g as u,C as c,M as x,H as f}from"./index-DDXrdlj0.js";function h({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(x,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function g(s){return s===1?"1 member":`${s} members`}function j({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You are":`${s.displayName} is`," not in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(h,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:g(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({to:"/channels",search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{j as RoomsPage};
@@ -1 +1 @@
1
- import{r as C,j as e,aK as ie,cl as de,J as ue,ag as j,cL as Q,cM as Z,cN as q,cO as G,cP as F,cQ as fe,cR as ee,cS as pe,cT as te,cU as me,cV as xe,cW as Y,cX as he,cY as be,cZ as T,c_ as je,c$ as E,d0 as ge,d1 as se,aM as ve,u as Ne,a as Se,d2 as Ee,d3 as Ce,d4 as ke,d5 as ye,d6 as we,d7 as Ae}from"./index-DyAjYNxU.js";import{u as Te}from"./use-mesh-update-D1KVLTOA.js";const Le={duration:.12,ease:"easeOut"},Ie={type:"spring",stiffness:320,damping:28};function ae({isSetHere:n,serverDefault:l,onUseServerDefault:d,warning:r,className:a,"data-testid":i}){const[f,m]=C.useState(!1),o=n?"set here":`server default · ${l??"none"}`,s=n&&!!d,p=e.jsxs("span",{className:j("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?Q.warning:Q.neutral,s&&"hover:bg-accent hover:text-accent-foreground transition-colors",a),"data-testid":i,children:[r&&e.jsx(ie,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(de,{mode:"wait",initial:!1,children:e.jsx(ue.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Ie},exit:{opacity:0},transition:Le,children:o},o)})]});return s?e.jsxs(Z,{open:f,onOpenChange:m,children:[e.jsx(q,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:p})}),e.jsxs(G,{className:"w-64 p-2",align:"start",children:[e.jsx(F,{children:"Where this value comes from"}),r&&e.jsx("p",{className:j("px-2 pt-1 text-xs",fe.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{d(),m(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":i?`${i}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"the runtime picks, nothing is set"})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:p}):p}const ne="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function w({label:n,valueLabel:l,options:d,selected:r,isSetHere:a,serverDefault:i,warning:f,onSelect:m,onInherit:o,testId:s,showHeader:p=!0,className:k,describedBy:h}){const S=ee(),[b,c]=C.useState(!1);return e.jsxs("div",{className:j("space-y-1",k),children:[p&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ne,children:n}),!S&&e.jsx(ae,{isSetHere:a,serverDefault:i,warning:f,onUseServerDefault:o,"data-testid":`${s}-chip`})]}),e.jsxs(Z,{open:b,onOpenChange:c,children:[e.jsx(q,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...h?{"aria-describedby":h}:{},"data-testid":s,children:[e.jsx("span",{className:j("truncate",f?"text-amber-700 dark:text-amber-400":a?"md:text-foreground text-amber-700 dark:text-amber-400":"md:text-foreground text-emerald-700 dark:text-emerald-400"),children:l}),e.jsx(ve,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(G,{className:"w-64 p-1",align:"start",children:[e.jsx(F,{children:n}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:d.map(u=>e.jsxs("button",{type:"button","data-testid":`${s}-option-${u.value}`,onClick:()=>{m(u.value),c(!1)},className:j("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",u.value===r&&"bg-accent"),children:[u.label,u.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:u.hint})]},u.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),c(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${s}-inherit`,children:i?`Using server default: ${i}. Tap to restore`:"Use server default: the runtime picks"})]})]})]})}function Pe({agent:n,onUpdate:l,className:d}){var V,z,W,B,X,J;const r=ee(),{data:a}=pe(),{data:i,isPending:f}=te(),m=((V=a==null?void 0:a.executionDefaults)==null?void 0:V.runtime)??"claude-code",o=n.runtime??m,s=(z=a==null?void 0:a.executionDefaults)==null?void 0:z.perRuntime.find(t=>t.runtime===o),{data:p}=me({runtime:o}),k=n.model!=null,h=n.effort!=null,S=(s==null?void 0:s.model)??null,b=n.model??S,c=b?(p??[]).find(t=>t.value===b):void 0,u=(s==null?void 0:s.supportsEffort)??((W=xe(i,o))==null?void 0:W.supportsEffort),L=u===void 0&&f,I=u!==!1,P=c?c.supportsEffort??!1:void 0,g=(B=a==null?void 0:a.claudeCode)==null?void 0:B.accounts,x=g==null?void 0:g.flatMap(t=>t.id===null?[]:[{id:t.id,label:Y(t.path,g),path:t.path}]),v=n.account??null,$=v!==null,O=a!=null&&a.claudeCode?Y(a.claudeCode.resolvedAccount,g??[]):null,U=Te({errorLabel:"Couldn’t change this agent’s account"}),H=C.useCallback(t=>{U.mutate({id:n.id,updates:{account:t}})},[n.id,U]),le=he({agent:{runtime:n.runtime,model:n.model,effort:n.effort,account:n.account},defaultRuntime:m,serverDefaultModel:S,knownModels:be(p),knownAccounts:x,accountsUnavailable:(X=a==null?void 0:a.claudeCode)==null?void 0:X.accountsUnavailable,modelSupportsEffort:P,runtimeSupportsEffort:u,runtimeLabel:t=>T(t).label}),N=t=>{var K;return((K=le.breakages.find(ce=>t.includes(ce.kind)))==null?void 0:K.message)??null},y=!L&&I&&P!==!1,M=n.effort??(s==null?void 0:s.effort)??null,_=T(o).label,oe=o==="claude-code"&&x!==void 0&&(x.length>1||$),re=N(["account-unregistered"]),D=(p??[]).some(t=>t.unverified),R=C.useId();return e.jsxs("div",{className:j("grid grid-cols-2 gap-3",d),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{label:"Model",valueLabel:(c==null?void 0:c.displayName)??b??"Automatic",options:[...(p??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:b,isSetHere:k,serverDefault:(s==null?void 0:s.model)??null,warning:N(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:D?R:void 0}),D&&e.jsx(je,{id:R})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ne,children:"Effort"}),(!r||!y)&&(h||y)&&e.jsx(ae,{isSetHere:h,serverDefault:s!=null&&s.effort?E(s.effort):null,warning:N(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),L?e.jsx(A,{testId:"agent-effort-pending",text:`Checking what ${_} supports`,warning:null}):I?y?e.jsx(w,{label:"Effort",valueLabel:E(M),options:ge.filter(t=>!(c!=null&&c.supportedEffortLevels)||c.supportedEffortLevels.includes(t)).map(t=>({value:t,label:E(t)})),selected:M,isSetHere:h,serverDefault:s!=null&&s.effort?E(s.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(A,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:N(["effort-unsupported-model"])}):e.jsx(A,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${_}`,warning:N(["effort-unsupported-runtime"])})]}),oe&&e.jsx(w,{label:"Account",valueLabel:v!==null?((J=x==null?void 0:x.find(t=>t.id===v))==null?void 0:J.label)??v:O??"Default account",options:(x??[]).map(t=>({value:t.id,label:t.label,hint:se(t.path)})),selected:v,isSetHere:$,serverDefault:O,warning:re,onSelect:t=>H(t),onInherit:()=>H(null),testId:"agent-account-row",className:"col-span-full"})]})}function A({text:n,warning:l,testId:d}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":d,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:n}),l&&e.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-400",children:l})]})}const $e="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function He({member:n}){const{agent:l,projectPath:d,isPending:r,update:a}=Ne(n),{data:i}=te();if(r)return e.jsx(Se,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const f=i?Object.keys(i.capabilities):[l.runtime],m=f.includes(l.runtime)?f:[l.runtime,...f];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:$e,children:"Runtime"}),e.jsxs(Ee,{value:l.runtime??"claude-code",onValueChange:o=>a({runtime:o}),children:[e.jsx(Ce,{className:"h-8 text-sm",responsive:!1,children:e.jsx(ke,{})}),e.jsx(ye,{children:m.map(o=>e.jsx(we,{value:o,responsive:!1,children:T(o).label},o))})]})]}),e.jsx(Pe,{agent:l,onUpdate:a,className:"grid-cols-1"}),d&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Ae,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:se(d)})]})]})}export{He as RunsOnPopover};
1
+ import{r as C,j as e,aK as ie,cl as de,J as ue,ag as j,cL as Q,cM as Z,cN as q,cO as G,cP as F,cQ as fe,cR as ee,cS as pe,cT as te,cU as me,cV as xe,cW as Y,cX as he,cY as be,cZ as T,c_ as je,c$ as E,d0 as ge,d1 as se,aM as ve,u as Ne,a as Se,d2 as Ee,d3 as Ce,d4 as ke,d5 as ye,d6 as we,d7 as Ae}from"./index-DDXrdlj0.js";import{u as Te}from"./use-mesh-update-BP_UXq60.js";const Le={duration:.12,ease:"easeOut"},Ie={type:"spring",stiffness:320,damping:28};function ae({isSetHere:n,serverDefault:l,onUseServerDefault:d,warning:r,className:a,"data-testid":i}){const[f,m]=C.useState(!1),o=n?"set here":`server default · ${l??"none"}`,s=n&&!!d,p=e.jsxs("span",{className:j("text-3xs inline-flex h-5 items-center gap-1 rounded-full px-2 leading-none whitespace-nowrap",r?Q.warning:Q.neutral,s&&"hover:bg-accent hover:text-accent-foreground transition-colors",a),"data-testid":i,children:[r&&e.jsx(ie,{className:"size-2.5 shrink-0","aria-hidden":!0}),e.jsx(de,{mode:"wait",initial:!1,children:e.jsx(ue.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0,transition:Ie},exit:{opacity:0},transition:Le,children:o},o)})]});return s?e.jsxs(Z,{open:f,onOpenChange:m,children:[e.jsx(q,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":`Set here${r?`: ${r}`:""}`,children:p})}),e.jsxs(G,{className:"w-64 p-2",align:"start",children:[e.jsx(F,{children:"Where this value comes from"}),r&&e.jsx("p",{className:j("px-2 pt-1 text-xs",fe.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{d(),m(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":i?`${i}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"the runtime picks, nothing is set"})]})]})]}):r?e.jsx("span",{title:r,"aria-label":`${o}: ${r}`,children:p}):p}const ne="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function w({label:n,valueLabel:l,options:d,selected:r,isSetHere:a,serverDefault:i,warning:f,onSelect:m,onInherit:o,testId:s,showHeader:p=!0,className:k,describedBy:h}){const S=ee(),[b,c]=C.useState(!1);return e.jsxs("div",{className:j("space-y-1",k),children:[p&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ne,children:n}),!S&&e.jsx(ae,{isSetHere:a,serverDefault:i,warning:f,onUseServerDefault:o,"data-testid":`${s}-chip`})]}),e.jsxs(Z,{open:b,onOpenChange:c,children:[e.jsx(q,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...h?{"aria-describedby":h}:{},"data-testid":s,children:[e.jsx("span",{className:j("truncate",f?"text-amber-700 dark:text-amber-400":a?"md:text-foreground text-amber-700 dark:text-amber-400":"md:text-foreground text-emerald-700 dark:text-emerald-400"),children:l}),e.jsx(ve,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(G,{className:"w-64 p-1",align:"start",children:[e.jsx(F,{children:n}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:d.map(u=>e.jsxs("button",{type:"button","data-testid":`${s}-option-${u.value}`,onClick:()=>{m(u.value),c(!1)},className:j("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",u.value===r&&"bg-accent"),children:[u.label,u.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:u.hint})]},u.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),c(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${s}-inherit`,children:i?`Using server default: ${i}. Tap to restore`:"Use server default: the runtime picks"})]})]})]})}function Pe({agent:n,onUpdate:l,className:d}){var V,z,W,B,X,J;const r=ee(),{data:a}=pe(),{data:i,isPending:f}=te(),m=((V=a==null?void 0:a.executionDefaults)==null?void 0:V.runtime)??"claude-code",o=n.runtime??m,s=(z=a==null?void 0:a.executionDefaults)==null?void 0:z.perRuntime.find(t=>t.runtime===o),{data:p}=me({runtime:o}),k=n.model!=null,h=n.effort!=null,S=(s==null?void 0:s.model)??null,b=n.model??S,c=b?(p??[]).find(t=>t.value===b):void 0,u=(s==null?void 0:s.supportsEffort)??((W=xe(i,o))==null?void 0:W.supportsEffort),L=u===void 0&&f,I=u!==!1,P=c?c.supportsEffort??!1:void 0,g=(B=a==null?void 0:a.claudeCode)==null?void 0:B.accounts,x=g==null?void 0:g.flatMap(t=>t.id===null?[]:[{id:t.id,label:Y(t.path,g),path:t.path}]),v=n.account??null,$=v!==null,O=a!=null&&a.claudeCode?Y(a.claudeCode.resolvedAccount,g??[]):null,U=Te({errorLabel:"Couldn’t change this agent’s account"}),H=C.useCallback(t=>{U.mutate({id:n.id,updates:{account:t}})},[n.id,U]),le=he({agent:{runtime:n.runtime,model:n.model,effort:n.effort,account:n.account},defaultRuntime:m,serverDefaultModel:S,knownModels:be(p),knownAccounts:x,accountsUnavailable:(X=a==null?void 0:a.claudeCode)==null?void 0:X.accountsUnavailable,modelSupportsEffort:P,runtimeSupportsEffort:u,runtimeLabel:t=>T(t).label}),N=t=>{var K;return((K=le.breakages.find(ce=>t.includes(ce.kind)))==null?void 0:K.message)??null},y=!L&&I&&P!==!1,M=n.effort??(s==null?void 0:s.effort)??null,_=T(o).label,oe=o==="claude-code"&&x!==void 0&&(x.length>1||$),re=N(["account-unregistered"]),D=(p??[]).some(t=>t.unverified),R=C.useId();return e.jsxs("div",{className:j("grid grid-cols-2 gap-3",d),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(w,{label:"Model",valueLabel:(c==null?void 0:c.displayName)??b??"Automatic",options:[...(p??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:b,isSetHere:k,serverDefault:(s==null?void 0:s.model)??null,warning:N(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:D?R:void 0}),D&&e.jsx(je,{id:R})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:ne,children:"Effort"}),(!r||!y)&&(h||y)&&e.jsx(ae,{isSetHere:h,serverDefault:s!=null&&s.effort?E(s.effort):null,warning:N(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),L?e.jsx(A,{testId:"agent-effort-pending",text:`Checking what ${_} supports`,warning:null}):I?y?e.jsx(w,{label:"Effort",valueLabel:E(M),options:ge.filter(t=>!(c!=null&&c.supportedEffortLevels)||c.supportedEffortLevels.includes(t)).map(t=>({value:t,label:E(t)})),selected:M,isSetHere:h,serverDefault:s!=null&&s.effort?E(s.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(A,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:N(["effort-unsupported-model"])}):e.jsx(A,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${_}`,warning:N(["effort-unsupported-runtime"])})]}),oe&&e.jsx(w,{label:"Account",valueLabel:v!==null?((J=x==null?void 0:x.find(t=>t.id===v))==null?void 0:J.label)??v:O??"Default account",options:(x??[]).map(t=>({value:t.id,label:t.label,hint:se(t.path)})),selected:v,isSetHere:$,serverDefault:O,warning:re,onSelect:t=>H(t),onInherit:()=>H(null),testId:"agent-account-row",className:"col-span-full"})]})}function A({text:n,warning:l,testId:d}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":d,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:n}),l&&e.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-400",children:l})]})}const $e="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function He({member:n}){const{agent:l,projectPath:d,isPending:r,update:a}=Ne(n),{data:i}=te();if(r)return e.jsx(Se,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const f=i?Object.keys(i.capabilities):[l.runtime],m=f.includes(l.runtime)?f:[l.runtime,...f];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:$e,children:"Runtime"}),e.jsxs(Ee,{value:l.runtime??"claude-code",onValueChange:o=>a({runtime:o}),children:[e.jsx(Ce,{className:"h-8 text-sm",responsive:!1,children:e.jsx(ke,{})}),e.jsx(ye,{children:m.map(o=>e.jsx(we,{value:o,responsive:!1,children:T(o).label},o))})]})]}),e.jsx(Pe,{agent:l,onUpdate:a,className:"grid-cols-1"}),d&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Ae,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:se(d)})]})]})}export{He as RunsOnPopover};
@@ -1,4 +1,4 @@
1
- import{e0 as ie,er as re,es as oe,w as D,r as d,et as le,eu as ce,ev as ue,ew as de,bd as P,ex as me,ey as xe,ez as pe,eA as fe,j as e,eB as ge,eC as he,eD as je,eE as z,aj as F,eF as ve,eG as T,cl as be,J as w,eH as ye,eI as Ne,bB as N,cZ as O,eJ as Ce,ag as S,eK as V,eL as we,cm as R,cn as M,co as A,eM as $,aB as K,eN as B,eO as Se,eP as _,aM as ke,eQ as G,eR as W,eS as L,eT as Re,eU as Me,eV as Ae,b1 as Pe,au as Le,eW as Te,av as Ie,aw as ze,ax as Ee,ay as De,eX as Fe,e as Oe,x as Ve,eY as $e,eZ as Ke,a as Be,e_ as _e,I as Ge,e$ as We,f0 as Qe,aV as qe}from"./index-DyAjYNxU.js";/**
1
+ import{e0 as ie,er as re,es as oe,w as D,r as d,et as le,eu as ce,ev as ue,ew as de,bd as P,ex as me,ey as xe,ez as pe,eA as fe,j as e,eB as ge,eC as he,eD as je,eE as z,aj as F,eF as ve,eG as T,cl as be,J as w,eH as ye,eI as Ne,bB as N,cZ as O,eJ as Ce,ag as S,eK as V,eL as we,cm as R,cn as M,co as A,eM as $,aB as K,eN as B,eO as Se,eP as _,aM as ke,eQ as G,eR as W,eS as L,eT as Re,eU as Me,eV as Ae,b1 as Pe,au as Le,eW as Te,av as Ie,aw as ze,ax as Ee,ay as De,eX as Fe,e as Oe,x as Ve,eY as $e,eZ as Ke,a as Be,e_ as _e,I as Ge,e$ as We,f0 as Qe,aV as qe}from"./index-DDXrdlj0.js";/**
2
2
  * @license lucide-react v1.44.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{w as b,ae as B,ei as p,ej as g,x as w,y as A,aV as z,ek as M,j as e,el as O,r as d,aM as E,ag as N,B as j,aK as I,cL as y,em as C,dC as q,dD as K,dE as W,dF as Q,dG as U,dH as G,dI as J,dJ as Y,e as H,en as L,eo as V,aO as X,a as $,ep as Z,eq as R,aa as P}from"./index-DyAjYNxU.js";function D(s){const t=b();return B({queryKey:p.status(s),queryFn:()=>t.getHarnessStatus(s),staleTime:3e4,refetchOnMount:"always"})}const ee={native:"reads it",projected:"shared",drifted:"out of date",dropped:"can’t see it",warned:"may not work",conflict:"blocked","pending-approval":"needs your OK"},se={native:"neutral",projected:"neutral",drifted:"info",dropped:"muted",warned:"warning",conflict:"warning","pending-approval":"warning"},k="\0",te=new Set(["native","projected"]);function _(s){return`${s.scope??"project"}${k}${s.artifact}${k}${s.source??""}${k}${s.name}`}function ne(s,t){return`${g[s]} ${ee[t]}`}function ae(s){return s.reason??s.target}function F(s,t){return t.flatMap(n=>{const a=s.cells[n];return a===void 0?[]:[{harness:n,cell:a}]})}function re(s,t){if(t.length===0)return!1;const n=F(s,t);return n.length===t.length&&n.every(({cell:a})=>{var r;return te.has(a.state)&&!((r=a.warnings)!=null&&r.length)})}function S(s){return`${s} ${s===1?"file":"files"}`}function le(s){return s===1?"One package is waiting for your approval.":`${s} packages are waiting for your approval.`}function ie(s){return`Shared with all ${s}`}function oe(s){return s===1?"1 agent file":`${s} agent files`}function ce(s){return`Every agent file ${s} cannot see — skills, rules, commands and more.`}function de(s){return s===1?"1 entry":`${s} entries`}function ue(s,t){return t.flatMap(n=>{const a=s.flatMap(r=>{const l=r.cells[n];return l===void 0||l.state!=="dropped"?[]:[{key:_(r),artifact:r.artifact,name:r.name,...l.reason===void 0?{}:{reason:l.reason}}]});return a.length===0?[]:[{harness:n,label:g[n],entries:a}]})}const xe={drop:"Not shared",warning:"Could not read",write:"Will be written",notice:"Notice"};function fe(s){return`${xe[s.kind]} · ${s.artifact} ${s.name}`}function me(s){const t=b(),n=w();return A({mutationFn:()=>t.syncHarness(s),meta:{errorLabel:"Couldn’t share your agent files"},onSuccess:a=>{n.setQueryData(p.status(s),a.status),z.success("Agent files updated.")}})}function he(s){const t=w();M("approval_resolved",()=>{t.invalidateQueries({queryKey:p.status(s)})})}function pe({result:s,onDismiss:t}){const{applied:n,removals:a,askedAbout:r}=s;return e.jsx(O,{variant:"neutral",onDismiss:t,dismissLabel:"Dismiss what changed","data-slot":"harness-sync-summary",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Agent files updated."}),n>0&&e.jsxs(e.Fragment,{children:[" ",S(n)," written."]})]}),a.length>0&&e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("p",{className:"font-medium",children:["Removed ",S(a.length)," DorkOS put here:"]}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:a.map(({path:l,reason:c})=>e.jsxs("li",{className:"text-3xs flex flex-col",children:[e.jsx("code",{className:"font-mono",children:l}),e.jsx("span",{className:"opacity-80",children:c})]},l))})]}),r.length>0&&e.jsx("p",{children:le(r.length)})]})})}function ge(s){const{counts:t,sweepPreview:n}=s;return t.drifted>0||n.length>0?{message:"Some agent files are out of date.",variant:n.length>0?"warning":"info",actionable:!0}:t.conflicts>0?{message:"DorkOS can’t update some files. Something else is in the way.",variant:"warning",actionable:!1}:t.adoptable>0?{message:"Some skills live where only a few of your agents look.",variant:"info",actionable:!1}:null}function je({projectPath:s}){return he(s),null}function ve({projectPath:s}){const{data:t}=D(s),n=me(s),[a,r]=d.useState(!1),[l,c]=d.useState(!1);if(t===void 0||t.state!=="ready")return null;const u=e.jsx(je,{projectPath:s});if(n.data!==void 0&&!l)return e.jsxs(e.Fragment,{children:[u,e.jsx(pe,{result:n.data,onDismiss:()=>c(!0)})]});const o=ge(t);if(o===null)return u;const{removals:x,sweepPreview:m}=t,i=m.length;return e.jsxs(e.Fragment,{children:[u,e.jsx(O,{variant:o.variant,"data-slot":"harness-drift-banner",detailsOpen:a,details:i===0?void 0:e.jsx("ul",{className:"flex flex-col gap-0.5",children:x.map(({path:f,reason:v})=>e.jsxs("li",{className:"text-3xs flex flex-col",children:[e.jsx("code",{className:"font-mono",children:f}),e.jsx("span",{className:"opacity-80",children:v})]},f))}),actions:o.actionable?e.jsx(j,{size:"sm",variant:"outline",className:"h-6 text-xs",disabled:n.isPending,onClick:()=>{c(!1),n.mutate()},children:n.isPending?"Syncing…":"Sync now"}):void 0,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("p",{children:o.message}),i>0&&e.jsxs("button",{type:"button","aria-expanded":a,onClick:()=>r(f=>!f),className:"text-3xs flex w-fit items-center gap-1 underline underline-offset-2 opacity-90 hover:opacity-100",children:["Syncing also removes ",S(i)," DorkOS put here",e.jsx(E,{"aria-hidden":!0,className:N("size-3 transition-transform",a&&"rotate-180")})]})]})})]})}function Ne(s){const t=b(),n=w();return A({mutationFn:a=>t.adoptHarness(s,a),meta:{errorLabel:"Couldn’t move that skill"},onSuccess:a=>{n.setQueryData(p.status(s),a.status),n.setQueriesData({queryKey:p.all,predicate:r=>{var l;return((l=r.state.data)==null?void 0:l.projectPath)===a.status.projectPath}},a.status)}})}const ye={neutral:y.neutral,info:y.info,warning:y.warning,muted:"border border-dashed border-border text-muted-foreground"};function ke({harness:s,cell:t}){var l;const n=ne(s,t.state),a=ae(t),r=(l=t.warnings)!=null&&l.length?t.warnings.join(" · "):void 0;return e.jsxs("li",{"aria-label":n,...a===void 0?{}:{title:a},className:N("text-3xs inline-flex items-center gap-1 rounded-full px-2 py-0.5 leading-tight",ye[se[t.state]]),children:[n,r!==void 0&&e.jsx("span",{role:"img","aria-label":"May not work",title:r,className:"inline-flex",children:e.jsx(I,{"aria-hidden":!0,className:"text-status-warning-fg size-2.5"})})]})}function Se(s){const t=s===void 0?-1:s.lastIndexOf("/"),n=t>0?s==null?void 0:s.slice(0,t):void 0;return n===void 0?"Lives where only some of your agents look. Move it to .agents/skills so every agent can read it.":`Lives in ${n}. Move it to .agents/skills so every agent can read it.`}function be(s,t){return`dorkos harness adopt ${s} --project ${t}`}const we="Share with every agent";function Ce(s,t,n){const a=`It moves from ${t} to .agents/skills/${s}`;return n?`${a}, and DorkOS leaves a link behind so Claude Code still finds it.`:`${a}, where every agent reads it.`}const De="for all your projects";function $e({row:s,enabled:t,projectPath:n,showEveryHarness:a}){var v;const[r,l]=d.useState(!1),[c,u]=d.useState(!1),o=Ne(n),x=F(s,t),m=re(s,t)&&!a,i=m&&!r,f=(v=o.data)==null?void 0:v.refusals[0];return e.jsxs("div",{role:"group","aria-label":s.name,className:"flex flex-col gap-1 py-1.5",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"min-w-0 shrink truncate text-xs font-medium",children:s.name}),s.scope==="global"&&e.jsx("span",{className:"text-muted-foreground text-3xs shrink-0",children:De}),s.source!==void 0&&e.jsx("span",{dir:"rtl",title:s.source,className:"text-muted-foreground text-3xs ml-auto min-w-0 truncate text-left font-mono",children:e.jsx("bdi",{dir:"ltr",children:s.source})})]}),e.jsxs("ul",{"aria-label":"Agent tools",className:"flex flex-wrap items-center gap-1",children:[m&&e.jsx("li",{children:e.jsxs("button",{type:"button","aria-expanded":!i,title:x.map(({harness:h})=>g[h]).join(" · "),onClick:()=>l(h=>!h),className:"bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground text-3xs focus-visible:ring-ring inline-flex items-center gap-1 rounded-full px-2 py-0.5 leading-tight transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[ie(x.length),e.jsx(E,{"aria-hidden":!0,className:N("size-2.5 transition-transform",i&&"-rotate-90")})]})}),!i&&x.map(({harness:h,cell:T})=>e.jsx(ke,{harness:h,cell:T},h))]}),s.adoptable&&e.jsxs(e.Fragment,{children:[e.jsx("p",{role:"status","aria-live":"polite",className:"text-muted-foreground text-3xs",children:(f==null?void 0:f.reason)||Se(s.source)}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run: ",e.jsx(C,{children:be(s.name,n)})]}),e.jsx("div",{children:e.jsx(j,{size:"sm",variant:"outline",className:"h-6 text-xs",disabled:o.isPending,onClick:()=>u(!0),children:we})}),e.jsx(q,{open:c,onOpenChange:u,children:e.jsxs(K,{children:[e.jsxs(W,{children:[e.jsxs(Q,{children:["Move ",s.name," so every agent can read it?"]}),e.jsx(U,{children:Ce(s.name,s.source??"",t.includes("claude-code"))})]}),e.jsxs(G,{children:[e.jsx(J,{children:"Cancel"}),e.jsx(Y,{onClick:()=>o.mutate(s.name),children:"Move it"})]})]})})]})]})}const Ae="https://dorkos.ai/docs/guides/cli-usage#agent-files";function Oe(){return e.jsxs(e.Fragment,{children:[e.jsx("span",{role:"status",className:"sr-only",children:"Loading skills…"}),e.jsx("div",{"aria-hidden":!0,className:"flex flex-col gap-3 py-1",children:[0,1,2].map(s=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx($,{className:"h-3 w-32"}),e.jsx($,{className:"h-3 w-48"})]},s))})]})}function Ee({projectPath:s,showBrowseLink:t=!0}){const{data:n,isPending:a,error:r,refetch:l}=D(s),[c,u]=d.useState(!1),o=d.useId(),x=H();if(a)return e.jsx(Oe,{});if(r)return e.jsxs("div",{className:"flex items-center gap-2 py-2",children:[e.jsx("p",{className:"text-destructive text-xs",children:"Couldn’t load skills."}),e.jsx(j,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>void l(),children:"Retry"})]});if(n.state!=="ready")return e.jsx(He,{status:n});const m=n.rows.filter(i=>i.artifact==="skill");return m.length===0?e.jsxs("div",{className:"flex flex-col items-start gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"No skills here yet."}),t&&x&&e.jsxs(j,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground h-6 px-1 text-xs",onClick:()=>void x({to:"/marketplace",search:{type:"skill-pack"}}),children:[e.jsx(L,{"aria-hidden":!0,className:"mr-1.5 size-3.5"}),"Browse skill-packs"]})]}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 pb-1",children:[e.jsx(V,{htmlFor:o,className:"text-muted-foreground text-3xs",children:"Show every agent tool"}),e.jsx(X,{id:o,size:"sm",checked:c,onCheckedChange:u})]}),e.jsx("div",{className:"divide-border divide-y",children:m.map(i=>e.jsx($e,{row:i,enabled:n.enabled,projectPath:n.projectPath,showEveryHarness:c},_(i)))})]})}function He({status:s}){return s.state==="not-set-up"?e.jsxs("div",{className:"flex flex-col gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"DorkOS isn’t sharing agent files for this folder yet."}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run ",e.jsx(C,{children:"dorkos harness sync --fix"})," in this folder to set it up."]}),e.jsx(Z,{href:Ae,className:"text-3xs text-muted-foreground hover:text-foreground underline underline-offset-2",children:"How agent file sharing works"})]}):s.state==="unreadable"?e.jsxs("div",{className:"flex flex-col gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"DorkOS can’t read this folder’s agent file settings."}),s.detail!==void 0&&e.jsx("p",{className:"text-muted-foreground text-3xs",children:s.detail})]}):e.jsx("p",{className:"text-muted-foreground py-2 text-xs",children:"Agent file sharing runs in the DorkOS app."})}function Le({group:s}){const[t,n]=d.useState(!1);return e.jsxs(R,{open:t,onOpenChange:n,trigger:e.jsxs("span",{className:"text-xs",children:["Not shared with ",s.label]}),badge:e.jsx(P,{variant:"secondary",size:"xs",className:"whitespace-nowrap",children:oe(s.entries.length)}),children:[e.jsx("p",{className:"text-muted-foreground text-3xs px-4 pt-3",children:ce(s.label)}),e.jsx("ul",{className:"space-y-2 px-4 pt-2 pb-3",children:s.entries.map(a=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"text-3xs font-medium",children:[a.artifact," ",a.name]}),a.reason!==void 0&&e.jsx("span",{className:"text-muted-foreground text-3xs",children:a.reason})]},a.key))})]})}function Re({rows:s,enabled:t}){const n=ue(s,t);return n.length===0?null:e.jsx("div",{className:"flex flex-col gap-1.5",children:n.map(a=>e.jsx(Le,{group:a},a.harness))})}function Pe({entries:s}){const[t,n]=d.useState(!1);return s.length===0?null:e.jsx(R,{open:t,onOpenChange:n,trigger:e.jsx("span",{className:"text-xs",children:"Project-level notices"}),badge:e.jsx(P,{variant:"secondary",size:"xs",className:"whitespace-nowrap",children:de(s.length)}),children:e.jsx("ul",{className:"space-y-2 px-4 pb-3",children:s.map(a=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:N("text-3xs font-medium",a.kind==="notice"&&"text-muted-foreground font-normal"),children:fe(a)}),e.jsx("span",{className:"text-muted-foreground text-3xs",children:a.reason})]},`${a.kind} ${a.artifact} ${a.source??""} ${a.name}`))})})}function _e({command:s}){return e.jsx(C,{className:"break-normal",children:s.split(" ").map((t,n)=>e.jsxs(d.Fragment,{children:[n>0&&" ",e.jsx("span",{className:"whitespace-nowrap",children:t})]},`${n}-${t}`))})}function Fe({notEnabled:s}){return s.length===0?null:e.jsx("div",{className:"flex flex-col gap-1.5 py-1",children:s.map(({harness:t,why:n,signal:a})=>e.jsxs("div",{title:a,className:"flex flex-col gap-0.5",children:[e.jsx("p",{className:"text-xs font-medium",children:n==="dorkos-runtime"?`DorkOS runs ${g[t]} here, but this folder isn’t sharing to it.`:`${g[t]} files are in this folder, but DorkOS isn’t sharing to it.`}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run ",e.jsx(_e,{command:`dorkos harness sync --fix --enable ${t}`})," in this folder to turn it on."]})]},t))})}function Te({projectPath:s}){const t=H(),{data:n}=D(s),a=(n==null?void 0:n.state)==="ready"?n:null;return e.jsxs("div",{className:"flex flex-col gap-2","data-slot":"profile-skills",children:[e.jsx(ve,{projectPath:s}),a&&e.jsx(Fe,{notEnabled:a.notEnabled}),e.jsx(Ee,{projectPath:s,showBrowseLink:!1}),a&&e.jsx(Re,{rows:a.rows,enabled:a.enabled}),a&&e.jsx(Pe,{entries:a.projectLevel}),t&&e.jsxs(j,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground w-full",onClick:()=>void t({to:"/marketplace",search:{type:"skill-pack"}}),children:[e.jsx(L,{"aria-hidden":!0,className:"mr-1.5 size-3.5"}),"Browse skill-packs"]})]})}function ze({member:s}){var n;const t=((n=s.agent)==null?void 0:n.projectPath)??null;return t===null?e.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent’s folder isn’t known here."}):e.jsx(Te,{projectPath:t})}export{ze as SkillsPage};
1
+ import{w as b,ae as B,ei as p,ej as g,x as w,y as A,aV as z,ek as M,j as e,el as O,r as d,aM as E,ag as N,B as j,aK as I,cL as y,em as C,dC as q,dD as K,dE as W,dF as Q,dG as U,dH as G,dI as J,dJ as Y,e as H,en as L,eo as V,aO as X,a as $,ep as Z,eq as R,aa as P}from"./index-DDXrdlj0.js";function D(s){const t=b();return B({queryKey:p.status(s),queryFn:()=>t.getHarnessStatus(s),staleTime:3e4,refetchOnMount:"always"})}const ee={native:"reads it",projected:"shared",drifted:"out of date",dropped:"can’t see it",warned:"may not work",conflict:"blocked","pending-approval":"needs your OK"},se={native:"neutral",projected:"neutral",drifted:"info",dropped:"muted",warned:"warning",conflict:"warning","pending-approval":"warning"},k="\0",te=new Set(["native","projected"]);function _(s){return`${s.scope??"project"}${k}${s.artifact}${k}${s.source??""}${k}${s.name}`}function ne(s,t){return`${g[s]} ${ee[t]}`}function ae(s){return s.reason??s.target}function F(s,t){return t.flatMap(n=>{const a=s.cells[n];return a===void 0?[]:[{harness:n,cell:a}]})}function re(s,t){if(t.length===0)return!1;const n=F(s,t);return n.length===t.length&&n.every(({cell:a})=>{var r;return te.has(a.state)&&!((r=a.warnings)!=null&&r.length)})}function S(s){return`${s} ${s===1?"file":"files"}`}function le(s){return s===1?"One package is waiting for your approval.":`${s} packages are waiting for your approval.`}function ie(s){return`Shared with all ${s}`}function oe(s){return s===1?"1 agent file":`${s} agent files`}function ce(s){return`Every agent file ${s} cannot see — skills, rules, commands and more.`}function de(s){return s===1?"1 entry":`${s} entries`}function ue(s,t){return t.flatMap(n=>{const a=s.flatMap(r=>{const l=r.cells[n];return l===void 0||l.state!=="dropped"?[]:[{key:_(r),artifact:r.artifact,name:r.name,...l.reason===void 0?{}:{reason:l.reason}}]});return a.length===0?[]:[{harness:n,label:g[n],entries:a}]})}const xe={drop:"Not shared",warning:"Could not read",write:"Will be written",notice:"Notice"};function fe(s){return`${xe[s.kind]} · ${s.artifact} ${s.name}`}function me(s){const t=b(),n=w();return A({mutationFn:()=>t.syncHarness(s),meta:{errorLabel:"Couldn’t share your agent files"},onSuccess:a=>{n.setQueryData(p.status(s),a.status),z.success("Agent files updated.")}})}function he(s){const t=w();M("approval_resolved",()=>{t.invalidateQueries({queryKey:p.status(s)})})}function pe({result:s,onDismiss:t}){const{applied:n,removals:a,askedAbout:r}=s;return e.jsx(O,{variant:"neutral",onDismiss:t,dismissLabel:"Dismiss what changed","data-slot":"harness-sync-summary",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Agent files updated."}),n>0&&e.jsxs(e.Fragment,{children:[" ",S(n)," written."]})]}),a.length>0&&e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("p",{className:"font-medium",children:["Removed ",S(a.length)," DorkOS put here:"]}),e.jsx("ul",{className:"flex flex-col gap-0.5",children:a.map(({path:l,reason:c})=>e.jsxs("li",{className:"text-3xs flex flex-col",children:[e.jsx("code",{className:"font-mono",children:l}),e.jsx("span",{className:"opacity-80",children:c})]},l))})]}),r.length>0&&e.jsx("p",{children:le(r.length)})]})})}function ge(s){const{counts:t,sweepPreview:n}=s;return t.drifted>0||n.length>0?{message:"Some agent files are out of date.",variant:n.length>0?"warning":"info",actionable:!0}:t.conflicts>0?{message:"DorkOS can’t update some files. Something else is in the way.",variant:"warning",actionable:!1}:t.adoptable>0?{message:"Some skills live where only a few of your agents look.",variant:"info",actionable:!1}:null}function je({projectPath:s}){return he(s),null}function ve({projectPath:s}){const{data:t}=D(s),n=me(s),[a,r]=d.useState(!1),[l,c]=d.useState(!1);if(t===void 0||t.state!=="ready")return null;const u=e.jsx(je,{projectPath:s});if(n.data!==void 0&&!l)return e.jsxs(e.Fragment,{children:[u,e.jsx(pe,{result:n.data,onDismiss:()=>c(!0)})]});const o=ge(t);if(o===null)return u;const{removals:x,sweepPreview:m}=t,i=m.length;return e.jsxs(e.Fragment,{children:[u,e.jsx(O,{variant:o.variant,"data-slot":"harness-drift-banner",detailsOpen:a,details:i===0?void 0:e.jsx("ul",{className:"flex flex-col gap-0.5",children:x.map(({path:f,reason:v})=>e.jsxs("li",{className:"text-3xs flex flex-col",children:[e.jsx("code",{className:"font-mono",children:f}),e.jsx("span",{className:"opacity-80",children:v})]},f))}),actions:o.actionable?e.jsx(j,{size:"sm",variant:"outline",className:"h-6 text-xs",disabled:n.isPending,onClick:()=>{c(!1),n.mutate()},children:n.isPending?"Syncing…":"Sync now"}):void 0,children:e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("p",{children:o.message}),i>0&&e.jsxs("button",{type:"button","aria-expanded":a,onClick:()=>r(f=>!f),className:"text-3xs flex w-fit items-center gap-1 underline underline-offset-2 opacity-90 hover:opacity-100",children:["Syncing also removes ",S(i)," DorkOS put here",e.jsx(E,{"aria-hidden":!0,className:N("size-3 transition-transform",a&&"rotate-180")})]})]})})]})}function Ne(s){const t=b(),n=w();return A({mutationFn:a=>t.adoptHarness(s,a),meta:{errorLabel:"Couldn’t move that skill"},onSuccess:a=>{n.setQueryData(p.status(s),a.status),n.setQueriesData({queryKey:p.all,predicate:r=>{var l;return((l=r.state.data)==null?void 0:l.projectPath)===a.status.projectPath}},a.status)}})}const ye={neutral:y.neutral,info:y.info,warning:y.warning,muted:"border border-dashed border-border text-muted-foreground"};function ke({harness:s,cell:t}){var l;const n=ne(s,t.state),a=ae(t),r=(l=t.warnings)!=null&&l.length?t.warnings.join(" · "):void 0;return e.jsxs("li",{"aria-label":n,...a===void 0?{}:{title:a},className:N("text-3xs inline-flex items-center gap-1 rounded-full px-2 py-0.5 leading-tight",ye[se[t.state]]),children:[n,r!==void 0&&e.jsx("span",{role:"img","aria-label":"May not work",title:r,className:"inline-flex",children:e.jsx(I,{"aria-hidden":!0,className:"text-status-warning-fg size-2.5"})})]})}function Se(s){const t=s===void 0?-1:s.lastIndexOf("/"),n=t>0?s==null?void 0:s.slice(0,t):void 0;return n===void 0?"Lives where only some of your agents look. Move it to .agents/skills so every agent can read it.":`Lives in ${n}. Move it to .agents/skills so every agent can read it.`}function be(s,t){return`dorkos harness adopt ${s} --project ${t}`}const we="Share with every agent";function Ce(s,t,n){const a=`It moves from ${t} to .agents/skills/${s}`;return n?`${a}, and DorkOS leaves a link behind so Claude Code still finds it.`:`${a}, where every agent reads it.`}const De="for all your projects";function $e({row:s,enabled:t,projectPath:n,showEveryHarness:a}){var v;const[r,l]=d.useState(!1),[c,u]=d.useState(!1),o=Ne(n),x=F(s,t),m=re(s,t)&&!a,i=m&&!r,f=(v=o.data)==null?void 0:v.refusals[0];return e.jsxs("div",{role:"group","aria-label":s.name,className:"flex flex-col gap-1 py-1.5",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"min-w-0 shrink truncate text-xs font-medium",children:s.name}),s.scope==="global"&&e.jsx("span",{className:"text-muted-foreground text-3xs shrink-0",children:De}),s.source!==void 0&&e.jsx("span",{dir:"rtl",title:s.source,className:"text-muted-foreground text-3xs ml-auto min-w-0 truncate text-left font-mono",children:e.jsx("bdi",{dir:"ltr",children:s.source})})]}),e.jsxs("ul",{"aria-label":"Agent tools",className:"flex flex-wrap items-center gap-1",children:[m&&e.jsx("li",{children:e.jsxs("button",{type:"button","aria-expanded":!i,title:x.map(({harness:h})=>g[h]).join(" · "),onClick:()=>l(h=>!h),className:"bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground text-3xs focus-visible:ring-ring inline-flex items-center gap-1 rounded-full px-2 py-0.5 leading-tight transition-colors focus-visible:ring-2 focus-visible:outline-none",children:[ie(x.length),e.jsx(E,{"aria-hidden":!0,className:N("size-2.5 transition-transform",i&&"-rotate-90")})]})}),!i&&x.map(({harness:h,cell:T})=>e.jsx(ke,{harness:h,cell:T},h))]}),s.adoptable&&e.jsxs(e.Fragment,{children:[e.jsx("p",{role:"status","aria-live":"polite",className:"text-muted-foreground text-3xs",children:(f==null?void 0:f.reason)||Se(s.source)}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run: ",e.jsx(C,{children:be(s.name,n)})]}),e.jsx("div",{children:e.jsx(j,{size:"sm",variant:"outline",className:"h-6 text-xs",disabled:o.isPending,onClick:()=>u(!0),children:we})}),e.jsx(q,{open:c,onOpenChange:u,children:e.jsxs(K,{children:[e.jsxs(W,{children:[e.jsxs(Q,{children:["Move ",s.name," so every agent can read it?"]}),e.jsx(U,{children:Ce(s.name,s.source??"",t.includes("claude-code"))})]}),e.jsxs(G,{children:[e.jsx(J,{children:"Cancel"}),e.jsx(Y,{onClick:()=>o.mutate(s.name),children:"Move it"})]})]})})]})]})}const Ae="https://dorkos.ai/docs/guides/cli-usage#agent-files";function Oe(){return e.jsxs(e.Fragment,{children:[e.jsx("span",{role:"status",className:"sr-only",children:"Loading skills…"}),e.jsx("div",{"aria-hidden":!0,className:"flex flex-col gap-3 py-1",children:[0,1,2].map(s=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx($,{className:"h-3 w-32"}),e.jsx($,{className:"h-3 w-48"})]},s))})]})}function Ee({projectPath:s,showBrowseLink:t=!0}){const{data:n,isPending:a,error:r,refetch:l}=D(s),[c,u]=d.useState(!1),o=d.useId(),x=H();if(a)return e.jsx(Oe,{});if(r)return e.jsxs("div",{className:"flex items-center gap-2 py-2",children:[e.jsx("p",{className:"text-destructive text-xs",children:"Couldn’t load skills."}),e.jsx(j,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>void l(),children:"Retry"})]});if(n.state!=="ready")return e.jsx(He,{status:n});const m=n.rows.filter(i=>i.artifact==="skill");return m.length===0?e.jsxs("div",{className:"flex flex-col items-start gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"No skills here yet."}),t&&x&&e.jsxs(j,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground h-6 px-1 text-xs",onClick:()=>void x({to:"/marketplace",search:{type:"skill-pack"}}),children:[e.jsx(L,{"aria-hidden":!0,className:"mr-1.5 size-3.5"}),"Browse skill-packs"]})]}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 pb-1",children:[e.jsx(V,{htmlFor:o,className:"text-muted-foreground text-3xs",children:"Show every agent tool"}),e.jsx(X,{id:o,size:"sm",checked:c,onCheckedChange:u})]}),e.jsx("div",{className:"divide-border divide-y",children:m.map(i=>e.jsx($e,{row:i,enabled:n.enabled,projectPath:n.projectPath,showEveryHarness:c},_(i)))})]})}function He({status:s}){return s.state==="not-set-up"?e.jsxs("div",{className:"flex flex-col gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"DorkOS isn’t sharing agent files for this folder yet."}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run ",e.jsx(C,{children:"dorkos harness sync --fix"})," in this folder to set it up."]}),e.jsx(Z,{href:Ae,className:"text-3xs text-muted-foreground hover:text-foreground underline underline-offset-2",children:"How agent file sharing works"})]}):s.state==="unreadable"?e.jsxs("div",{className:"flex flex-col gap-1 py-2",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"DorkOS can’t read this folder’s agent file settings."}),s.detail!==void 0&&e.jsx("p",{className:"text-muted-foreground text-3xs",children:s.detail})]}):e.jsx("p",{className:"text-muted-foreground py-2 text-xs",children:"Agent file sharing runs in the DorkOS app."})}function Le({group:s}){const[t,n]=d.useState(!1);return e.jsxs(R,{open:t,onOpenChange:n,trigger:e.jsxs("span",{className:"text-xs",children:["Not shared with ",s.label]}),badge:e.jsx(P,{variant:"secondary",size:"xs",className:"whitespace-nowrap",children:oe(s.entries.length)}),children:[e.jsx("p",{className:"text-muted-foreground text-3xs px-4 pt-3",children:ce(s.label)}),e.jsx("ul",{className:"space-y-2 px-4 pt-2 pb-3",children:s.entries.map(a=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"text-3xs font-medium",children:[a.artifact," ",a.name]}),a.reason!==void 0&&e.jsx("span",{className:"text-muted-foreground text-3xs",children:a.reason})]},a.key))})]})}function Re({rows:s,enabled:t}){const n=ue(s,t);return n.length===0?null:e.jsx("div",{className:"flex flex-col gap-1.5",children:n.map(a=>e.jsx(Le,{group:a},a.harness))})}function Pe({entries:s}){const[t,n]=d.useState(!1);return s.length===0?null:e.jsx(R,{open:t,onOpenChange:n,trigger:e.jsx("span",{className:"text-xs",children:"Project-level notices"}),badge:e.jsx(P,{variant:"secondary",size:"xs",className:"whitespace-nowrap",children:de(s.length)}),children:e.jsx("ul",{className:"space-y-2 px-4 pb-3",children:s.map(a=>e.jsxs("li",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:N("text-3xs font-medium",a.kind==="notice"&&"text-muted-foreground font-normal"),children:fe(a)}),e.jsx("span",{className:"text-muted-foreground text-3xs",children:a.reason})]},`${a.kind} ${a.artifact} ${a.source??""} ${a.name}`))})})}function _e({command:s}){return e.jsx(C,{className:"break-normal",children:s.split(" ").map((t,n)=>e.jsxs(d.Fragment,{children:[n>0&&" ",e.jsx("span",{className:"whitespace-nowrap",children:t})]},`${n}-${t}`))})}function Fe({notEnabled:s}){return s.length===0?null:e.jsx("div",{className:"flex flex-col gap-1.5 py-1",children:s.map(({harness:t,why:n,signal:a})=>e.jsxs("div",{title:a,className:"flex flex-col gap-0.5",children:[e.jsx("p",{className:"text-xs font-medium",children:n==="dorkos-runtime"?`DorkOS runs ${g[t]} here, but this folder isn’t sharing to it.`:`${g[t]} files are in this folder, but DorkOS isn’t sharing to it.`}),e.jsxs("p",{className:"text-muted-foreground text-3xs",children:["Run ",e.jsx(_e,{command:`dorkos harness sync --fix --enable ${t}`})," in this folder to turn it on."]})]},t))})}function Te({projectPath:s}){const t=H(),{data:n}=D(s),a=(n==null?void 0:n.state)==="ready"?n:null;return e.jsxs("div",{className:"flex flex-col gap-2","data-slot":"profile-skills",children:[e.jsx(ve,{projectPath:s}),a&&e.jsx(Fe,{notEnabled:a.notEnabled}),e.jsx(Ee,{projectPath:s,showBrowseLink:!1}),a&&e.jsx(Re,{rows:a.rows,enabled:a.enabled}),a&&e.jsx(Pe,{entries:a.projectLevel}),t&&e.jsxs(j,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground w-full",onClick:()=>void t({to:"/marketplace",search:{type:"skill-pack"}}),children:[e.jsx(L,{"aria-hidden":!0,className:"mr-1.5 size-3.5"}),"Browse skill-packs"]})]})}function ze({member:s}){var n;const t=((n=s.agent)==null?void 0:n.projectPath)??null;return t===null?e.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent’s folder isn’t known here."}):e.jsx(Te,{projectPath:t})}export{ze as SkillsPage};
@@ -1 +1 @@
1
- import{an as F,ac as y,ao as U,ap as D,aq as L,ar as P,as as B,r as u,j as e,at as G,au as O,av as f,aw as j,ax as g,ay as k,az as N,aA as w,aB as R,aC as $,aD as X,aE as _,aF as q,aG as H,aH as V,aI as W}from"./index-DyAjYNxU.js";const J=5;function K({status:t}){switch(t){case"running":return e.jsx(w,{size:"xs",className:"text-status-info shrink-0"});case"completed":return e.jsx(V,{className:"size-3 shrink-0 text-green-500","aria-hidden":!0});case"failed":return e.jsx(H,{className:"text-destructive size-3 shrink-0","aria-hidden":!0});case"cancelled":return e.jsx(q,{className:"text-muted-foreground size-3 shrink-0","aria-hidden":!0});case"skipped":return e.jsx(_,{className:"text-muted-foreground size-3 shrink-0","aria-hidden":!0});case"blocked":return e.jsx(X,{className:"text-status-warning-dot size-3 shrink-0","aria-hidden":!0});default:return null}}function Q(t){if(t===null)return"";if(t<1e3)return"< 1s";const n=Math.floor(t/1e3);if(n<60)return`${n}s`;const a=Math.floor(n/60),c=n%60;return`${a}m ${c}s`}function Y({run:t,scheduleName:n}){return e.jsx(k,{children:e.jsxs(N,{className:"text-sm",children:[e.jsx(w,{size:"xs",className:"text-status-info shrink-0"}),e.jsx("span",{className:"truncate",children:n}),t.startedAt&&e.jsx("span",{className:"text-muted-foreground/50 ml-auto shrink-0 text-xs",children:R(t.startedAt)})]})})}function Z({schedule:t,onEdit:n}){return e.jsx(k,{children:e.jsxs(N,{onClick:()=>n(t.id),className:"text-sm",children:[e.jsx($,{className:"text-muted-foreground/50 size-3 shrink-0","aria-hidden":!0}),e.jsx("span",{className:"truncate",children:t.name}),t.nextRun&&e.jsx("span",{className:"text-muted-foreground/50 ml-auto shrink-0 text-xs",children:R(t.nextRun)})]})})}function ee({run:t,scheduleName:n}){const a=t.status==="running"&&t.finishedAt?t.error?"failed":"completed":t.status;return e.jsx(k,{children:e.jsxs(N,{className:"text-sm",children:[e.jsx(K,{status:a}),e.jsx("span",{className:"truncate",children:n}),e.jsxs("span",{className:"text-muted-foreground/50 ml-auto flex shrink-0 items-center gap-1.5 text-xs",children:[t.durationMs!==null&&e.jsx("span",{children:Q(t.durationMs)}),t.finishedAt&&e.jsx("span",{children:R(t.finishedAt)})]})]})})}function se({toolStatus:t,agentId:n}){const a=F(),c=y(s=>s.setTasksAgentFilter),l=y(s=>s.setTasksEditScheduleId),o=t!=="disabled-by-server",{data:h=[]}=U(o),{data:I=0}=D(o),{data:S=[]}=L(void 0,o),{data:v=[]}=P(),{openWithTemplate:z}=B(),T=[v[0],v[2]].filter(Boolean),d=u.useMemo(()=>n?h.filter(s=>s.agentId===n):h,[n,h]),x=u.useMemo(()=>{const s=new Map;for(const r of d)s.set(r.id,r.name);return s},[d]),A=u.useMemo(()=>S.filter(s=>x.has(s.scheduleId)),[S,x]),{runningRuns:b,recentRuns:C}=u.useMemo(()=>{const s=[],r=[];for(const i of A)i.finishedAt!=null||i.status!=="running"?r.push(i):s.push(i);return r.sort((i,p)=>(p.finishedAt??p.createdAt).localeCompare(i.finishedAt??i.createdAt)),{runningRuns:s,recentRuns:r.slice(0,J)}},[A]),M=u.useMemo(()=>d.filter(s=>s.enabled&&s.status==="active"&&s.nextRun).sort((s,r)=>(s.nextRun??"").localeCompare(r.nextRun??"")),[d]),m=()=>{n&&(c(n),l(null)),a.open()},E=s=>{l(s),c(null),a.open()};return t==="disabled-by-agent"?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 px-4 py-8",children:[e.jsx("p",{className:"text-muted-foreground/60 text-sm",children:"Scheduled tasks are off for this agent"}),e.jsx("button",{onClick:m,className:"text-muted-foreground hover:text-foreground text-xs transition-colors",children:"Open Schedules →"})]}):d.length===0?e.jsxs("div",{className:"flex flex-col gap-3 px-3 py-4",children:[e.jsx("p",{className:"text-muted-foreground/70 text-xs",children:"No schedules yet."}),T.length>0&&e.jsx("div",{className:"space-y-2",children:T.map(s=>e.jsxs("div",{className:"rounded-lg border p-3 text-sm",children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsx("p",{className:"text-muted-foreground text-xs",children:G(s.cron)}),e.jsx("button",{type:"button",onClick:()=>{z(s),m()},className:"text-primary mt-2 text-xs hover:underline",children:"+ Use preset"})]},s.id))}),e.jsx("button",{onClick:m,className:"text-muted-foreground hover:text-foreground text-xs transition-colors",children:"Open Schedules →"})]}):e.jsx(O,{type:"scroll",className:"h-full",children:e.jsxs("div",{className:"pr-1",children:[b.length>0&&e.jsxs(f,{children:[e.jsxs(j,{className:"text-2xs text-muted-foreground/70 font-medium tracking-wider uppercase",children:["Running",e.jsx("span",{className:"text-muted-foreground/50 ml-auto text-xs font-normal normal-case",children:I})]}),e.jsx(g,{children:b.map(s=>e.jsx(Y,{run:s,scheduleName:x.get(s.scheduleId)??"Unknown"},s.id))})]}),M.length>0&&e.jsxs(f,{children:[e.jsx(j,{className:"text-2xs text-muted-foreground/70 font-medium tracking-wider uppercase",children:"Upcoming"}),e.jsx(g,{children:M.map(s=>e.jsx(Z,{schedule:s,onEdit:E},s.id))})]}),C.length>0&&e.jsxs(f,{children:[e.jsx(j,{className:"text-2xs text-muted-foreground/70 font-medium tracking-wider uppercase",children:"Recent Runs"}),e.jsx(g,{children:C.map(s=>e.jsx(ee,{run:s,scheduleName:x.get(s.scheduleId)??"Unknown"},s.id))})]}),e.jsx("div",{className:"px-3 py-2",children:e.jsx("button",{onClick:m,className:"text-muted-foreground hover:text-foreground text-xs transition-colors",children:"Open Schedules →"})})]})})}function ne({member:t}){var l,o;const n=((l=t.agent)==null?void 0:l.projectPath)??null,a=W(n),c=((o=t.agent)==null?void 0:o.manifestId)??null;return e.jsx("div",{className:"min-h-0 flex-1","data-slot":"profile-tasks",children:e.jsx(se,{toolStatus:a.tasks,agentId:c})})}export{ne as TasksPage};
1
+ import{an as F,ac as y,ao as U,ap as D,aq as L,ar as P,as as B,r as u,j as e,at as G,au as O,av as f,aw as j,ax as g,ay as k,az as N,aA as w,aB as R,aC as $,aD as X,aE as _,aF as q,aG as H,aH as V,aI as W}from"./index-DDXrdlj0.js";const J=5;function K({status:t}){switch(t){case"running":return e.jsx(w,{size:"xs",className:"text-status-info shrink-0"});case"completed":return e.jsx(V,{className:"size-3 shrink-0 text-green-500","aria-hidden":!0});case"failed":return e.jsx(H,{className:"text-destructive size-3 shrink-0","aria-hidden":!0});case"cancelled":return e.jsx(q,{className:"text-muted-foreground size-3 shrink-0","aria-hidden":!0});case"skipped":return e.jsx(_,{className:"text-muted-foreground size-3 shrink-0","aria-hidden":!0});case"blocked":return e.jsx(X,{className:"text-status-warning-dot size-3 shrink-0","aria-hidden":!0});default:return null}}function Q(t){if(t===null)return"";if(t<1e3)return"< 1s";const n=Math.floor(t/1e3);if(n<60)return`${n}s`;const a=Math.floor(n/60),c=n%60;return`${a}m ${c}s`}function Y({run:t,scheduleName:n}){return e.jsx(k,{children:e.jsxs(N,{className:"text-sm",children:[e.jsx(w,{size:"xs",className:"text-status-info shrink-0"}),e.jsx("span",{className:"truncate",children:n}),t.startedAt&&e.jsx("span",{className:"text-muted-foreground/50 ml-auto shrink-0 text-xs",children:R(t.startedAt)})]})})}function Z({schedule:t,onEdit:n}){return e.jsx(k,{children:e.jsxs(N,{onClick:()=>n(t.id),className:"text-sm",children:[e.jsx($,{className:"text-muted-foreground/50 size-3 shrink-0","aria-hidden":!0}),e.jsx("span",{className:"truncate",children:t.name}),t.nextRun&&e.jsx("span",{className:"text-muted-foreground/50 ml-auto shrink-0 text-xs",children:R(t.nextRun)})]})})}function ee({run:t,scheduleName:n}){const a=t.status==="running"&&t.finishedAt?t.error?"failed":"completed":t.status;return e.jsx(k,{children:e.jsxs(N,{className:"text-sm",children:[e.jsx(K,{status:a}),e.jsx("span",{className:"truncate",children:n}),e.jsxs("span",{className:"text-muted-foreground/50 ml-auto flex shrink-0 items-center gap-1.5 text-xs",children:[t.durationMs!==null&&e.jsx("span",{children:Q(t.durationMs)}),t.finishedAt&&e.jsx("span",{children:R(t.finishedAt)})]})]})})}function se({toolStatus:t,agentId:n}){const a=F(),c=y(s=>s.setTasksAgentFilter),l=y(s=>s.setTasksEditScheduleId),o=t!=="disabled-by-server",{data:h=[]}=U(o),{data:I=0}=D(o),{data:S=[]}=L(void 0,o),{data:v=[]}=P(),{openWithTemplate:z}=B(),T=[v[0],v[2]].filter(Boolean),d=u.useMemo(()=>n?h.filter(s=>s.agentId===n):h,[n,h]),x=u.useMemo(()=>{const s=new Map;for(const r of d)s.set(r.id,r.name);return s},[d]),A=u.useMemo(()=>S.filter(s=>x.has(s.scheduleId)),[S,x]),{runningRuns:b,recentRuns:C}=u.useMemo(()=>{const s=[],r=[];for(const i of A)i.finishedAt!=null||i.status!=="running"?r.push(i):s.push(i);return r.sort((i,p)=>(p.finishedAt??p.createdAt).localeCompare(i.finishedAt??i.createdAt)),{runningRuns:s,recentRuns:r.slice(0,J)}},[A]),M=u.useMemo(()=>d.filter(s=>s.enabled&&s.status==="active"&&s.nextRun).sort((s,r)=>(s.nextRun??"").localeCompare(r.nextRun??"")),[d]),m=()=>{n&&(c(n),l(null)),a.open()},E=s=>{l(s),c(null),a.open()};return t==="disabled-by-agent"?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 px-4 py-8",children:[e.jsx("p",{className:"text-muted-foreground/60 text-sm",children:"Scheduled tasks are off for this agent"}),e.jsx("button",{onClick:m,className:"text-muted-foreground hover:text-foreground text-xs transition-colors",children:"Open Schedules →"})]}):d.length===0?e.jsxs("div",{className:"flex flex-col gap-3 px-3 py-4",children:[e.jsx("p",{className:"text-muted-foreground/70 text-xs",children:"No schedules yet."}),T.length>0&&e.jsx("div",{className:"space-y-2",children:T.map(s=>e.jsxs("div",{className:"rounded-lg border p-3 text-sm",children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsx("p",{className:"text-muted-foreground text-xs",children:G(s.cron)}),e.jsx("button",{type:"button",onClick:()=>{z(s),m()},className:"text-primary mt-2 text-xs hover:underline",children:"+ Use preset"})]},s.id))}),e.jsx("button",{onClick:m,className:"text-muted-foreground hover:text-foreground text-xs transition-colors",children:"Open Schedules →"})]}):e.jsx(O,{type:"scroll",className:"h-full",children:e.jsxs("div",{className:"pr-1",children:[b.length>0&&e.jsxs(f,{children:[e.jsxs(j,{className:"text-2xs text-muted-foreground/70 font-medium tracking-wider uppercase",children:["Running",e.jsx("span",{className:"text-muted-foreground/50 ml-auto text-xs font-normal normal-case",children:I})]}),e.jsx(g,{children:b.map(s=>e.jsx(Y,{run:s,scheduleName:x.get(s.scheduleId)??"Unknown"},s.id))})]}),M.length>0&&e.jsxs(f,{children:[e.jsx(j,{className:"text-2xs text-muted-foreground/70 font-medium tracking-wider uppercase",children:"Upcoming"}),e.jsx(g,{children:M.map(s=>e.jsx(Z,{schedule:s,onEdit:E},s.id))})]}),C.length>0&&e.jsxs(f,{children:[e.jsx(j,{className:"text-2xs text-muted-foreground/70 font-medium tracking-wider uppercase",children:"Recent Runs"}),e.jsx(g,{children:C.map(s=>e.jsx(ee,{run:s,scheduleName:x.get(s.scheduleId)??"Unknown"},s.id))})]}),e.jsx("div",{className:"px-3 py-2",children:e.jsx("button",{onClick:m,className:"text-muted-foreground hover:text-foreground text-xs transition-colors",children:"Open Schedules →"})})]})})}function ne({member:t}){var l,o;const n=((l=t.agent)==null?void 0:l.projectPath)??null,a=W(n),c=((o=t.agent)==null?void 0:o.manifestId)??null;return e.jsx("div",{className:"min-h-0 flex-1","data-slot":"profile-tasks",children:e.jsx(se,{toolStatus:a.tasks,agentId:c})})}export{ne as TasksPage};
@@ -1,2 +1,2 @@
1
- import{w as ae,ae as We,y as me,x as V,fD as re,fE as Te,r as l,j as e,cr as T,cs as A,fF as Ae,B as f,P as Me,fG as he,eo as _,I as Z,d2 as Oe,d3 as Ee,d4 as Re,d5 as De,d6 as ee,fH as be,by as Je,fI as Ze,C as le,ag as Ne,fJ as ge,cm as B,cn as G,aa as ne,co as q,bB as K,aN as Xe,fK as ye,aA as ce,dt as es,du as ss,dv as ns,dw as ts,dx as oe,ah as as,dz as rs,aO as te,fL as is,f5 as os,fM as ls,fN as cs,ey as Pe,a as de,fO as ds,dP as us,fP as ms,fQ as hs,fR as pe,fS as X,fT as Se,fU as gs,fV as ps,fW as xs,u as fs}from"./index-DyAjYNxU.js";import{u as xe}from"./use-mesh-update-D1KVLTOA.js";import{a as vs}from"./agent-browser-DH-qe6tt.js";function js(s,n){const t=ae();return We({queryKey:["mcp-config",s,n??null],queryFn:()=>t.getMcpConfig(s,{runtime:n??void 0}),enabled:!!s,staleTime:3e4})}function ze(s,n){s.invalidateQueries({queryKey:re.mcpServers(n)}),s.invalidateQueries({queryKey:["mcp-config"]})}function Ie(s){const n=ae(),t=V();return me({mutationFn:async({input:i,approval:a})=>a?(await n.grantApproval(a.approvalId),s(n,i,a.approvalToken)):s(n,i),onSuccess:(i,{input:a})=>{i.status==="ok"&&ze(t,a.agentId)}})}function Fe(){return Ie((s,n,t)=>s.addAgentMcpServer(n,t?{approvalToken:t}:void 0))}function bs(){return Ie((s,n,t)=>s.importAgentMcpServer(n,t?{approvalToken:t}:void 0))}function fe(s){const n=ae(),t=V();return me({mutationFn:({agentId:i,name:a})=>s(n,i,a),onSuccess:(i,{agentId:a})=>ze(t,a)})}function Ns(){return fe((s,n,t)=>s.removeAgentMcpServer(n,t))}function ys(){return fe((s,n,t)=>s.enableAgentMcpServer(n,t))}function Ss(){return fe((s,n,t)=>s.disableAgentMcpServer(n,t))}function Cs(){const s=ae();return me({mutationFn:({agentId:n,name:t})=>s.testAgentMcpServer(n,t)})}function ws({agentId:s,serverName:n,onDone:t}){const i=Te(s,n),{start:a}=i,r=l.useRef(!1);return l.useEffect(()=>{r.current||(r.current=!0,a())},[a]),e.jsx(T,{children:e.jsxs(A,{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Sign in to ",n]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"This server needs you to sign in before your agent can use it."}),e.jsx(Ae,{flow:i,serverName:n,failedActions:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>i.start(),className:"focus-visible:ring-2",children:"Try again"}),e.jsx(f,{variant:"ghost",size:"sm",onClick:t,className:"focus-visible:ring-2",children:"Later"})]}),connectedActions:e.jsx(f,{variant:"ghost",size:"sm",onClick:t,className:"focus-visible:ring-2",children:"Done"})}),i.state.step!=="failed"&&i.state.step!=="connected"&&e.jsx(f,{variant:"ghost",size:"sm",onClick:t,className:"focus-visible:ring-2",children:"Later"})]})})}const ks=["stdio","http","sse"],Ts=/^[a-zA-Z0-9_-]+$/;function Ce(s){const n={};for(const t of s.split(`
1
+ import{w as ae,ae as We,y as me,x as V,fD as re,fE as Te,r as l,j as e,cr as T,cs as A,fF as Ae,B as f,P as Me,fG as he,eo as _,I as Z,d2 as Oe,d3 as Ee,d4 as Re,d5 as De,d6 as ee,fH as be,by as Je,fI as Ze,C as le,ag as Ne,fJ as ge,cm as B,cn as G,aa as ne,co as q,bB as K,aN as Xe,fK as ye,aA as ce,dt as es,du as ss,dv as ns,dw as ts,dx as oe,ah as as,dz as rs,aO as te,fL as is,f5 as os,fM as ls,fN as cs,ey as Pe,a as de,fO as ds,dP as us,fP as ms,fQ as hs,fR as pe,fS as X,fT as Se,fU as gs,fV as ps,fW as xs,u as fs}from"./index-DDXrdlj0.js";import{u as xe}from"./use-mesh-update-BP_UXq60.js";import{a as vs}from"./agent-browser-DT3ABR4l.js";function js(s,n){const t=ae();return We({queryKey:["mcp-config",s,n??null],queryFn:()=>t.getMcpConfig(s,{runtime:n??void 0}),enabled:!!s,staleTime:3e4})}function ze(s,n){s.invalidateQueries({queryKey:re.mcpServers(n)}),s.invalidateQueries({queryKey:["mcp-config"]})}function Ie(s){const n=ae(),t=V();return me({mutationFn:async({input:i,approval:a})=>a?(await n.grantApproval(a.approvalId),s(n,i,a.approvalToken)):s(n,i),onSuccess:(i,{input:a})=>{i.status==="ok"&&ze(t,a.agentId)}})}function Fe(){return Ie((s,n,t)=>s.addAgentMcpServer(n,t?{approvalToken:t}:void 0))}function bs(){return Ie((s,n,t)=>s.importAgentMcpServer(n,t?{approvalToken:t}:void 0))}function fe(s){const n=ae(),t=V();return me({mutationFn:({agentId:i,name:a})=>s(n,i,a),onSuccess:(i,{agentId:a})=>ze(t,a)})}function Ns(){return fe((s,n,t)=>s.removeAgentMcpServer(n,t))}function ys(){return fe((s,n,t)=>s.enableAgentMcpServer(n,t))}function Ss(){return fe((s,n,t)=>s.disableAgentMcpServer(n,t))}function Cs(){const s=ae();return me({mutationFn:({agentId:n,name:t})=>s.testAgentMcpServer(n,t)})}function ws({agentId:s,serverName:n,onDone:t}){const i=Te(s,n),{start:a}=i,r=l.useRef(!1);return l.useEffect(()=>{r.current||(r.current=!0,a())},[a]),e.jsx(T,{children:e.jsxs(A,{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Sign in to ",n]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"This server needs you to sign in before your agent can use it."}),e.jsx(Ae,{flow:i,serverName:n,failedActions:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>i.start(),className:"focus-visible:ring-2",children:"Try again"}),e.jsx(f,{variant:"ghost",size:"sm",onClick:t,className:"focus-visible:ring-2",children:"Later"})]}),connectedActions:e.jsx(f,{variant:"ghost",size:"sm",onClick:t,className:"focus-visible:ring-2",children:"Done"})}),i.state.step!=="failed"&&i.state.step!=="connected"&&e.jsx(f,{variant:"ghost",size:"sm",onClick:t,className:"focus-visible:ring-2",children:"Later"})]})})}const ks=["stdio","http","sse"],Ts=/^[a-zA-Z0-9_-]+$/;function Ce(s){const n={};for(const t of s.split(`
2
2
  `)){const i=t.trim();if(!i)continue;const a=i.indexOf("=");if(a===-1)continue;const r=i.slice(0,a).trim();r&&(n[r]=i.slice(a+1).trim())}return n}function we(s){return s.trim().length?s.trim().split(/\s+/):[]}function As(s,n){if(s.status!=="ok")return!1;const t=s.servers.find(a=>a.name===n),i=t==null?void 0:t.connection;return i!==void 0&&"authKind"in i&&i.authKind==="oauth2"}function Ms({agentId:s,agentLabel:n,supportedTransports:t,onAdded:i,oauthDetectedFor:a=null}){const r=Fe(),[o,d]=l.useState(!1),[u,x]=l.useState(""),[p,m]=l.useState(t[0]??"stdio"),c=t.includes(p)?p:t[0]??"stdio",[j,v]=l.useState(""),[b,k]=l.useState(""),[N,P]=l.useState(""),[C,E]=l.useState(""),[z,M]=l.useState(""),[R,I]=l.useState(null),[O,F]=l.useState(null),[ie,Q]=l.useState(null),[$,H]=l.useState(null),U=Ts.test(u)&&u.length<=64,Y=c==="stdio"?j.trim().length>0:C.trim().length>0,h=U&&Y&&!r.isPending,y=l.useCallback(()=>c==="stdio"?{transport:"stdio",command:j.trim(),args:we(b),env:Ce(N)}:{transport:c,url:C.trim(),headers:Ce(z)},[c,j,b,N,C,z]),w=l.useCallback(()=>({agentId:s,name:u.trim(),connection:y()}),[s,u,y]),D=l.useCallback(()=>{d(!1),I(null),F(null),x(""),m(t[0]??"stdio"),v(""),k(""),P(""),E(""),M("")},[t]),je=l.useCallback(g=>{i({name:g.name,transport:g.connection.transport}),D()},[i,D]),W=l.useCallback((g,S)=>{const Ye=As(g,S.name);je(S),Ye&&Q(S.name)},[je]),qe=l.useCallback(async()=>{F(null);const g=w();try{const S=await r.mutateAsync({input:g});S.status==="approval_required"?I(S.approval):W(S,g)}catch(S){F(S instanceof Error?S.message:"Couldn’t add the server.")}},[r,w,W]),Ve=l.useCallback(async()=>{if(!R)return;F(null);const g=w();try{const S=await r.mutateAsync({input:g,approval:R});S.status==="ok"?W(S,g):F("The server still needs approval. Try again.")}catch(S){F(S instanceof Error?S.message:"Couldn’t add the server.")}},[r,w,R,W]),J=ie??(a&&a!==$?a:null),Qe=l.useCallback(()=>{H(J),Q(null)},[J]),He=l.useMemo(()=>[j.trim(),...we(b)].filter(Boolean).join(" "),[j,b]);return J?e.jsx(ws,{agentId:s,serverName:J,onDone:Qe}):o?R?e.jsx(T,{children:e.jsxs(A,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(he,{className:"mt-0.5 size-4 shrink-0 text-amber-500"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Confirm this server for ",n]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:c==="stdio"?"This command runs on your machine whenever the agent starts a session.":"The agent connects to this URL whenever it starts a session."})]})]}),e.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded-md px-3 py-2 font-mono text-xs",children:c==="stdio"?He:C.trim()}),O&&e.jsx("p",{className:"text-destructive text-xs",children:O}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>I(null),disabled:r.isPending,className:"focus-visible:ring-2",children:"Back"}),e.jsx(f,{size:"sm",onClick:Ve,disabled:r.isPending,className:"focus-visible:ring-2",children:r.isPending?"Adding…":"Confirm & add"})]})]})}):e.jsx(T,{children:e.jsxs(A,{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(_,{htmlFor:"mcp-name",children:"Name"}),e.jsx(Z,{id:"mcp-name",value:u,onChange:g=>x(g.target.value),placeholder:"my-server","aria-invalid":u.length>0&&!U}),u.length>0&&!U&&e.jsx("p",{className:"text-destructive text-xs",children:"Letters, numbers, dashes, underscores only."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(_,{htmlFor:"mcp-transport",children:"Transport"}),e.jsxs(Oe,{value:c,onValueChange:g=>m(g),children:[e.jsx(Ee,{id:"mcp-transport",className:"w-full",children:e.jsx(Re,{})}),e.jsx(De,{children:t.map(g=>e.jsx(ee,{value:g,children:g},g))})]})]}),c==="stdio"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(_,{htmlFor:"mcp-command",children:"Command"}),e.jsx(Z,{id:"mcp-command",value:j,onChange:g=>v(g.target.value),placeholder:"npx",className:"font-mono"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(_,{htmlFor:"mcp-args",children:"Arguments"}),e.jsx(Z,{id:"mcp-args",value:b,onChange:g=>k(g.target.value),placeholder:"-y @modelcontextprotocol/server-filesystem",className:"font-mono"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(_,{htmlFor:"mcp-env",children:"Environment (KEY=VALUE per line)"}),e.jsx(be,{id:"mcp-env",value:N,onChange:g=>P(g.target.value),placeholder:"API_KEY=…",rows:2,className:"font-mono text-xs"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(_,{htmlFor:"mcp-url",children:"URL"}),e.jsx(Z,{id:"mcp-url",value:C,onChange:g=>E(g.target.value),placeholder:"https://example.com/mcp",className:"font-mono"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(_,{htmlFor:"mcp-headers",children:"Headers (KEY=VALUE per line)"}),e.jsx(be,{id:"mcp-headers",value:z,onChange:g=>M(g.target.value),placeholder:"Authorization=Bearer …",rows:2,className:"font-mono text-xs"})]})]}),O&&e.jsx("p",{className:"text-destructive text-xs",children:O}),e.jsx(Je,{}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(f,{variant:"ghost",size:"sm",onClick:D,className:"focus-visible:ring-2",children:"Cancel"}),e.jsx(f,{size:"sm",onClick:qe,disabled:!h,className:"focus-visible:ring-2",children:"Continue"})]})]})}):e.jsxs(f,{variant:"outline",size:"sm",onClick:()=>d(!0),className:"focus-visible:ring-2",children:[e.jsx(Me,{className:"size-4"}),"Add server"]})}const Os={connected:"connected","needs-auth":"needs-sign-in",pending:"connecting",disabled:"off"},Es=["validation","invalid config","invalid configuration","missing required","command not found","enoent"];function ve(s){if(!s)return"cant-reach";const n=s.toLowerCase();return Es.some(t=>n.includes(t))?"setup-problem":"cant-reach"}function _e(s){return s.transport==="stdio"||s.authKind==="oauth2"?!1:Object.keys(s.headers).some(n=>n.toLowerCase()==="authorization")}function Rs(s){const{connection:n,authStatus:t}=s;return n.transport!=="stdio"&&n.authKind==="oauth2"?!0:t!==void 0}function Ke(s){const{enabled:n,testedOk:t,signedInNow:i,runtimeStatus:a,runtimeError:r,authStatus:o,ownKey:d}=s;return n?t?"connected":i?"signed-in":a==="failed"?ve(r):o==="connected"&&a==="needs-auth"?"signed-in":o==="needs-auth"&&(a==="connected"||a==="pending")?"needs-sign-in":a?Os[a]:o==="connected"?"signed-in":o==="needs-auth"?"needs-sign-in":d?"uses-your-key":"not-checked":"off"}function Ds(s){const{statusKey:n,testResult:t,signedInNow:i}=s;return n==="off"||i?!1:(t==null?void 0:t.needsAuth)===!0?!0:n==="needs-sign-in"}function Ps(s){const{stamped:n,signedInNow:t,authStatus:i,rosterUpdatedAt:a}=s;if(!n)return;const{result:r}=n;if(!(t&&r.needsAuth===!0)&&!(n.at<=a&&(i==="needs-auth"&&r.ok||i==="connected"&&r.needsAuth===!0)))return r}function zs(s){const{status:n,probe:t}=s;return n==="off"||!t||t.ok?n:t.needsAuth===!0?"needs-sign-in":ve(t.error)}const se={attention:0,working:1,elsewhere:2,off:3};function Is(s){return s==="off"?se.off:s==="needs-sign-in"||s==="cant-reach"||s==="setup-problem"?se.attention:se.working}function Fs(s){const{managed:n,live:t,discovered:i}=s;return[...n.map(r=>{var o,d;return{name:r.name,band:Is(Ke({enabled:r.enabled,testedOk:!1,signedInNow:!1,runtimeStatus:(o=t.get(r.name))==null?void 0:o.status,runtimeError:(d=t.get(r.name))==null?void 0:d.error,authStatus:r.authStatus,ownKey:_e(r.connection)}))}}),...i.map(r=>({name:r.name,band:se.elsewhere}))].map((r,o)=>({entry:r,index:o})).sort((r,o)=>r.entry.band-o.entry.band||r.index-o.index).map(({entry:r})=>r.name)}function _s(s){const{frozen:n,present:t}=s,i=new Set(t),a=new Set(n);return{ordered:n.filter(r=>i.has(r)),added:t.filter(r=>!a.has(r))}}function Ks(){const s=Ze(null);return({bothSettled:n,managed:t,live:i,discovered:a,present:r})=>{s.read()===null&&n&&r.length>0&&s.write(Fs({managed:t,live:i,discovered:a}));const{ordered:o,added:d}=_s({frozen:s.read()??[],present:r});return d.length>0&&s.read()!==null&&s.write([...o,...d]),[...o,...d]}}const Le={"needs-sign-in":{label:"Needs sign-in",tooltip:"Sign in to let this agent use the server.",tone:"attention"},"signing-in":{label:"Signing in…",tooltip:"A sign-in is in progress. Finish it in the tab that opened.",tone:"attention"},connected:{label:"Connected",tooltip:"This server answered, and its tools are available to the agent.",tone:"calm"},"signed-in":{label:"Signed in",tooltip:"DorkOS has a sign-in for this server. Use Test to check it responds.",tone:"calm"},"uses-your-key":{label:"Uses your key",tooltip:"This server is authenticated with a key you supplied, not one DorkOS holds.",tone:"calm"},"cant-reach":{label:"Can’t reach",tooltip:"The server did not answer. Open Details for what it said.",tone:"error"},"setup-problem":{label:"Setup problem",tooltip:"This server’s setup is wrong, so it could not start. Open Details for the reason.",tone:"error"},connecting:{label:"Connecting…",tooltip:"The agent is connecting to this server.",tone:"calm"},"not-checked":{label:"Not checked yet",tooltip:"Nothing has contacted this server yet, so there is nothing to report.",tone:"calm"},off:{label:"Off",tooltip:"Turned off. Its tools are not given to the agent.",tone:"calm"}},Ls={"needs-sign-in":"sign-in","signing-in":"none",connected:"none","signed-in":"test","uses-your-key":"test","cant-reach":"try-again","setup-problem":"try-again",connecting:"none","not-checked":"test",off:"none"};function $s(s){return Ls[s]}function Us({toolCount:s,justSignedIn:n}){const t=n?"Signed in just now. ":"";return s===null?`${t||"This server answered. "}Its tools are available.`:`${t}${s} tool${s===1?"":"s"} available.`}function Bs(s,n){switch(s){case"needs-sign-in":return`Sign in to ${n.displayName} so this agent can use its tools.`;case"signing-in":return null;case"connected":return Us(n);case"signed-in":return n.justSignedIn?"Signed in just now. Test to check the server responds.":"DorkOS has a sign-in for this server. Test to check it responds.";case"uses-your-key":return"You added an access key when setting this up.";case"cant-reach":return"This server didn’t answer. It may be down.";case"setup-problem":return"This server’s setup has a problem.";case"connecting":return"Connecting to this server.";case"not-checked":return"Nothing has checked this server yet.";case"off":return"Turned off. The agent doesn’t see this server."}}function Gs(s){const{connection:n,authStatus:t,clientOrigin:i}=s;return n.transport==="stdio"?"None. This server doesn’t need one.":n.authKind==="oauth2"?i==="manual"?`OAuth: using your own app credentials, ${t==="connected"?"signed in, and it renews automatically":"not signed in yet"}. DorkOS holds the key; the agent never sees it.`:t==="connected"?"OAuth: signed in, and it renews automatically. DorkOS holds the key; the agent never sees it.":"OAuth: DorkOS will hold the key for you; the agent never sees it.":Object.keys(n.headers).some(r=>r.toLowerCase()==="authorization")?"Access key: you added a key when setting this up.":t===void 0?"Nothing has checked this yet.":"None. This server doesn’t need one."}function qs(s){if(s.transport==="stdio")return`Runs \`${s.command}\` on this computer`;const n=Vs(s.url);return n?`${n} (web service)`:`${s.url} (web service)`}function Vs(s){try{return new URL(s).host}catch{return null}}const Qs={agent:"Added to this agent through DorkOS",project:"From this project, declared in its config files",plugin:"Comes with a plugin",computer:"From your computer-wide config"},Hs={agent:"Added to this agent through DorkOS.",project:"From this project’s config. Add it to manage it here.",plugin:"Comes with a plugin. Add it to manage it here.",computer:"From your computer-wide config. Add it to manage it here."},Ys=[{runtime:"claude-code",pattern:/^plugin:([^:]+):(.+)$/,read:s=>({pluginName:s[1],displayName:s[2]})},{runtime:"claude-code",pattern:/^plugin:(.+)$/,read:s=>({pluginName:s[1],displayName:s[1]})}];function $e(s){for(const n of Ys){const t=s.match(n.pattern);if(!t)continue;const{displayName:i,pluginName:a}=n.read(t);if(!(!i||!a))return{displayName:i,pluginName:a,rawName:s}}return{displayName:s,pluginName:null,rawName:s}}function Ws(s,n){return n.pluginName?"plugin":s.scope==="project"||s.scope==="local"?"project":s.scope==="user"?"computer":null}const Js="This agent’s runtime loads this server. Add it to manage it here.";function Ue(s,n){return s==="plugin"&&n?`Comes with the ${n} plugin`:Qs[s]}function Zs(s,n){return s===null?Js:s==="plugin"&&n?`Comes with the ${n} plugin. Add it to manage it here.`:Hs[s]}const Xs=ge("border-border/60 relative overflow-hidden rounded-md border px-3 py-2.5 transition-colors",{variants:{managed:{true:"bg-card",false:"bg-muted/30"},dimmed:{true:"opacity-65",false:""}},defaultVariants:{managed:!0,dimmed:!1}}),en=ge("pointer-events-none absolute inset-y-0 left-0 w-0.5",{variants:{tone:{calm:"hidden",attention:"bg-status-warning",error:"bg-status-error"}},defaultVariants:{tone:"calm"}}),sn=ge("shrink-0 rounded-full px-2 py-0.5 text-2xs leading-4 font-medium whitespace-nowrap",{variants:{chip:{success:"bg-status-success-bg text-status-success-fg",info:"bg-status-info-bg text-status-info-fg",warning:"bg-status-warning-bg text-status-warning-fg",error:"bg-status-error-bg text-status-error-fg",neutral:"bg-muted text-muted-foreground"}},defaultVariants:{chip:"neutral"}}),nn={connected:"success","signed-in":"info","needs-sign-in":"warning","signing-in":"warning","cant-reach":"error","setup-problem":"error","uses-your-key":"neutral",connecting:"neutral","not-checked":"neutral",off:"neutral"};function tn({status:s}){const n=Le[s];return e.jsxs(B,{children:[e.jsx(G,{asChild:!0,children:e.jsx("span",{className:sn({chip:nn[s]}),children:n.label})}),e.jsx(q,{children:n.tooltip})]})}function an({scope:s,pluginName:n}){return e.jsxs(B,{children:[e.jsx(G,{asChild:!0,children:e.jsx(ne,{size:"xs",tone:"neutral",variant:"secondary",className:"shrink-0 font-normal",children:s})}),e.jsx(q,{children:Ue(s,n)})]})}function Be({displayName:s,rawName:n,scope:t,pluginName:i,status:a,sentence:r,managed:o,toggle:d,actions:u,children:x,details:p,defaultDetailsOpen:m=!1}){const[c,j]=l.useState(m),v=l.useId(),b=Le[a].tone;return e.jsxs("div",{"data-mcp-server":n,className:Ne(Xs({managed:o,dimmed:a==="off"}),"mb-2 last:mb-0"),children:[e.jsx("span",{className:en({tone:b}),"aria-hidden":!0}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:s}),t&&e.jsx(an,{scope:t,pluginName:i}),e.jsx(tn,{status:a}),d]}),r&&e.jsx("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:r}),x,u&&e.jsx("div",{className:"mt-2 flex items-center gap-1",children:u}),p&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>j(k=>!k),"aria-expanded":c,"aria-controls":v,className:"text-muted-foreground hover:text-foreground mt-2 flex items-center gap-1 text-xs focus-visible:ring-2",children:[e.jsx(le,{className:Ne("size-3 transition-transform",c&&"rotate-90"),"aria-hidden":!0}),"Details"]}),c&&e.jsxs("div",{id:v,children:[p,e.jsxs("button",{type:"button",onClick:()=>j(!1),className:"text-muted-foreground hover:text-foreground mt-2 flex items-center gap-1 text-xs focus-visible:ring-2",children:[e.jsx(le,{className:"size-3 -rotate-90","aria-hidden":!0}),"Collapse details"]})]})]})]})}const rn=3,L="text-muted-foreground/70";function on({tools:s}){const[n,t]=l.useState(!1),i=n?s:s.slice(0,rn),a=s.length-i.length;return e.jsxs("div",{className:"mt-1.5",children:[i.map(r=>e.jsxs("div",{className:"border-border/40 flex items-baseline gap-2 border-b py-1 last:border-b-0",children:[e.jsx("code",{className:"text-foreground text-2xs shrink-0 font-mono",children:r.name}),r.description&&e.jsx("span",{className:"text-muted-foreground text-2xs truncate",children:r.description})]},r.name)),a>0&&e.jsxs("button",{type:"button",onClick:()=>t(!0),className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs focus-visible:ring-2",children:[e.jsx(le,{className:"size-3","aria-hidden":!0}),"Show ",a," more"]})]})}function ln(s){const{scope:n,pluginName:t,connection:i}=s;return n==="plugin"&&t?`Comes with the ${t} plugin`:i?qs(i):n?Ue(n,t):null}function Ge({connection:s,authStatus:n,authClientOrigin:t,scope:i,pluginName:a,rawName:r,displayName:o,toolCount:d,tools:u,serverInfo:x,alsoUsedBy:p,error:m}){const c=ln({scope:i,pluginName:a,connection:s});return e.jsxs("div",{className:"border-border/60 text-muted-foreground mt-2 space-y-1 border-t pt-2 text-xs leading-relaxed",children:[s&&e.jsx(K,{label:"Sign-in",align:"start",wrap:!0,labelClassName:L,children:e.jsxs("span",{className:"inline-flex items-start gap-1.5",children:[e.jsx(Xe,{className:"mt-0.5 size-3 shrink-0","aria-hidden":!0}),Gs({connection:s,authStatus:n,clientOrigin:t})]})}),c&&e.jsx(K,{label:"Source",align:"start",wrap:!0,labelClassName:L,children:c}),r!==o&&e.jsx(K,{label:"Raw id",align:"start",wrap:!0,labelClassName:L,children:e.jsx("code",{className:"text-2xs font-mono",children:r})}),x&&e.jsx(K,{label:"Server",align:"start",wrap:!0,labelClassName:L,children:x}),p&&e.jsx(K,{label:"Also used by",align:"start",wrap:!0,labelClassName:L,children:p}),typeof d=="number"&&e.jsx(K,{label:"Tools",align:"start",labelClassName:L,children:d}),u&&u.length>0&&e.jsx(on,{tools:u}),m&&e.jsx(K,{label:"Error",align:"start",wrap:!0,labelClassName:L,children:e.jsx("code",{className:"text-2xs font-mono break-all",children:m})})]})}function cn({flow:s,serverName:n}){return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{flow:s,serverName:n,failedActions:e.jsxs(e.Fragment,{children:[e.jsx(f,{variant:"secondary",size:"sm",onClick:()=>s.start(),className:"focus-visible:ring-2",children:"Try again"}),e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>s.reset(),className:"focus-visible:ring-2",children:"Dismiss"})]}),connectedActions:e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>s.reset(),className:"focus-visible:ring-2",children:"Dismiss"})}),(s.state.step==="disclosure"||s.state.step==="waiting")&&e.jsx("div",{className:"mt-2",children:e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>s.reset(),"aria-label":`Cancel signing in to ${n}`,className:"focus-visible:ring-2",children:"Cancel"})})]})}function dn({server:s,agentId:n,live:t,testResult:i,rosterUpdatedAt:a,testing:r,busy:o,onToggle:d,onTest:u,onRemove:x}){const p=Te(n,s.name),m=p.state.step==="connected",c=Ps({stamped:i,signedInNow:m,authStatus:s.authStatus,rosterUpdatedAt:a}),j=_e(s.connection),v=Ke({enabled:s.enabled,testedOk:(c==null?void 0:c.ok)===!0,signedInNow:m,runtimeStatus:t==null?void 0:t.status,runtimeError:t==null?void 0:t.error,authStatus:s.authStatus,ownKey:j}),b=p.state.step==="starting",k=p.state.step==="disclosure"||p.state.step==="waiting"||b,N=k?"signing-in":v,P=Ds({statusKey:v,testResult:c,signedInNow:m})&&(p.state.step==="idle"||b),C=$e(s.name),E=c!=null&&c.ok?c.toolCount??null:p.state.toolCount,z=k?N:zs({status:N,probe:c}),M=Bs(z,{displayName:C.displayName,toolCount:E,justSignedIn:m}),R=k?"none":$s(z),I=Rs({connection:s.connection,authStatus:s.authStatus});return e.jsx(Be,{displayName:C.displayName,rawName:s.name,scope:"agent",pluginName:C.pluginName,status:N,sentence:M,managed:!0,toggle:e.jsx(te,{checked:s.enabled,onCheckedChange:O=>d(s.name,O),disabled:o,"aria-label":`Enable ${s.name}`}),actions:e.jsxs(e.Fragment,{children:[P&&e.jsxs(f,{variant:"default",size:"sm",onClick:()=>p.start(),disabled:o||b,"aria-label":`Sign in to ${s.name}`,className:"gap-1.5 focus-visible:ring-2",children:[e.jsx(ye,{className:"size-3.5","aria-hidden":!0}),"Sign in"]}),!P&&R==="try-again"&&e.jsxs(f,{variant:"outline",size:"sm",onClick:()=>u(s.name),disabled:r||o,"aria-label":`Try ${s.name} again`,className:"gap-1.5 focus-visible:ring-2",children:[r?e.jsx(ce,{size:"xs"}):null,"Try again"]}),!P&&R==="test"&&e.jsx(f,{variant:"outline",size:"sm",onClick:()=>u(s.name),disabled:r||o,className:"focus-visible:ring-2",children:r?e.jsx(ce,{size:"xs"}):"Test"}),e.jsxs(es,{children:[e.jsx(ss,{asChild:!0,children:e.jsx(f,{variant:"ghost",size:"sm","aria-label":`More actions for ${s.name}`,className:"ml-auto focus-visible:ring-2",children:e.jsx(ns,{className:"size-4","aria-hidden":!0})})}),e.jsxs(ts,{align:"end",children:[e.jsxs(oe,{onSelect:()=>u(s.name),disabled:r||o,children:[e.jsx(as,{className:"size-3.5","aria-hidden":!0}),"Test"]}),I&&e.jsxs(oe,{onSelect:()=>p.start(),disabled:o,children:[e.jsx(ye,{className:"size-3.5","aria-hidden":!0}),"Sign in again"]}),e.jsx(rs,{}),e.jsx(oe,{variant:"destructive",onSelect:()=>x(s.name),disabled:o,children:"Remove"})]})]})]}),details:e.jsx(Ge,{connection:s.connection,authStatus:s.authStatus,authClientOrigin:s.authClientOrigin,scope:"agent",pluginName:C.pluginName,rawName:C.rawName,displayName:C.displayName,toolCount:E,error:(c==null?void 0:c.ok)===!1?c.error:t==null?void 0:t.error}),children:e.jsx(cn,{flow:p,serverName:C.displayName})})}function un(s){switch(s.status){case"connected":return"connected";case"failed":return ve(s.error);case"needs-auth":return"needs-sign-in";case"pending":return"connecting";case"disabled":return"off";default:return"not-checked"}}function mn(s){const{displayName:n,scope:t,pluginName:i}=s,a=hn(t,i);return`${n} ${a}. Manage it here to enable, disable, or sign in from DorkOS.`}function hn(s,n){return s==="plugin"&&n?`comes with the ${n} plugin`:s==="project"?"comes from this project’s own config":s==="computer"?"comes from your computer-wide config":"is loaded by this agent’s runtime"}function gn({entry:s,agentId:n,agentLabel:t,canImport:i}){const a=bs(),[r,o]=l.useState(null),[d,u]=l.useState(null),x=l.useCallback(async()=>{u(null);try{const N=await a.mutateAsync({input:{agentId:n,name:s.name}});N.status==="approval_required"&&o(N.approval)}catch(N){u(N instanceof Error?N.message:"Couldn’t add the server.")}},[a,n,s.name]),p=l.useCallback(async()=>{if(r){u(null);try{(await a.mutateAsync({input:{agentId:n,name:s.name},approval:r})).status!=="ok"&&u("Adding it still needs approval. Try again.")}catch(N){u(N instanceof Error?N.message:"Couldn’t add the server.")}}},[a,n,s.name,r]),m=$e(s.name),c=Ws(s,m),j=c!==null,v=m.rawName!==m.displayName,b=s.error!==void 0,k=j||v||b;return r?e.jsxs("div",{className:"border-border/60 mb-2 space-y-3 rounded-md border p-3 last:mb-0",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(he,{className:"text-status-warning mt-0.5 size-4 shrink-0","aria-hidden":!0}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Add “",m.displayName,"” to ",t,"?"]}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:mn({displayName:m.displayName,scope:c,pluginName:m.pluginName})})]})]}),d&&e.jsx("p",{className:"text-destructive text-xs",children:d}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>o(null),disabled:a.isPending,className:"focus-visible:ring-2",children:"Cancel"}),e.jsx(f,{size:"sm",onClick:p,disabled:a.isPending,className:"focus-visible:ring-2",children:a.isPending?"Adding…":"Add to agent"})]})]}):e.jsx(Be,{displayName:m.displayName,rawName:s.name,scope:c,pluginName:m.pluginName,status:un(s),sentence:Zs(c,m.pluginName),managed:!1,actions:i?e.jsxs(e.Fragment,{children:[e.jsxs(f,{variant:"outline",size:"sm",onClick:x,disabled:a.isPending,"aria-label":`Add ${s.name} to agent`,className:"gap-1.5 focus-visible:ring-2",children:[a.isPending?e.jsx(ce,{size:"xs"}):e.jsx(Me,{className:"size-(--size-icon-xs)","aria-hidden":!0}),"Add to agent"]}),d&&e.jsx("p",{className:"text-destructive text-xs",children:d})]}):void 0,details:k?e.jsx(Ge,{scope:c,pluginName:m.pluginName,rawName:m.rawName,displayName:m.displayName,error:s.error}):void 0})}function pn(s,n){return{agentId:s,name:n.server.name,connection:n.server.connection}}function xn(s){const n=s.sites.filter(t=>!t.expired).map(t=>t.site);return n.length<=3?n.join(", "):`${n.slice(0,3).join(", ")} and ${n.length-3} more`}function fn({agentId:s,agentLabel:n}){const t=is(),i=Fe(),[a,r]=l.useState(null),[o,d]=l.useState(null),u=l.useCallback(async c=>{if(t.data){d(null);try{const j=await i.mutateAsync({input:pn(s,t.data),...c?{approval:c}:{}});j.status!=="approval_required"?r(null):c?d("The browser still needs approval. Try again."):r(j.approval)}catch(j){d(j instanceof Error?j.message:"Couldn’t add the browser.")}}},[i,s,t.data]);if(!t.data)return null;const x=t.data,p=xn(x),m=`${x.loginCommand} <site>`;return e.jsx(T,{children:e.jsxs(A,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[a?e.jsx(he,{className:"mt-0.5 size-4 shrink-0 text-amber-500"}):e.jsx(os,{className:"text-muted-foreground mt-0.5 size-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:a?`Confirm the signed-in browser for ${n}`:"Signed-in browser"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:a?"This command runs on your machine whenever the agent starts a session. Each session gets its own browser, so agents working at the same time never share one.":"A web browser that starts signed in to the sites you saved. The agent never sees your passwords."}),x.saved?e.jsxs("p",{className:"text-xs",children:["Signed in to ",p,"."]}):e.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-500",children:["No sign-ins saved yet, so it starts signed out. Run"," ",e.jsx("code",{className:"font-mono",children:m}),e.jsx(ls,{value:m,label:"Copy the sign-in command",size:"xs",className:"mx-0.5 inline-flex align-middle"})," ","in a terminal first."]})]})]}),a&&e.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded-md px-3 py-2 font-mono text-xs",children:[x.server.connection.command,...x.server.connection.args].join(" ")}),o&&e.jsx("p",{className:"text-destructive text-xs",children:o}),e.jsxs("div",{className:"flex justify-end gap-2",children:[a&&e.jsx(f,{variant:"ghost",size:"sm",onClick:()=>r(null),disabled:i.isPending,className:"focus-visible:ring-2",children:"Back"}),e.jsx(f,{variant:a?"default":"outline",size:"sm",onClick:()=>void u(a??void 0),disabled:i.isPending,className:"focus-visible:ring-2",children:i.isPending?"Adding…":a?"Confirm & add":"Give it the browser"})]})]})})}const vn={codex:["stdio","http"],opencode:["stdio","http"]};function ke(s){return vn[s]??ks}function jn(){const{open:s}=ds();return e.jsxs("p",{className:"text-muted-foreground text-xs leading-relaxed",children:["Want other apps to use DorkOS as an MCP server instead? That is the other direction."," ",e.jsx(f,{variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>s("tools","external-mcp"),children:"See Settings → Tools"})]})}function bn({agent:s,projectPath:n}){var Y;const t=cs(s.id),i=js(n,s.runtime),a=i.data,r=Pe(s.runtime),o=(r==null?void 0:r.supportsManagedMcpServers)??!0,d=ys(),u=Ss(),x=Ns(),p=Cs(),[m,c]=l.useState({}),[j,v]=l.useState(null),[b,k]=l.useState(null),N=Ks(),P=l.useCallback((h,y)=>{(y?d:u).mutate({agentId:s.id,name:h})},[s.id,d,u]),C=l.useCallback(h=>{x.mutate({agentId:s.id,name:h}),c(y=>{const w={...y};return delete w[h],w})},[s.id,x]),E=l.useCallback(async h=>{v(h);try{const y=await p.mutateAsync({agentId:s.id,name:h});c(w=>({...w,[h]:{result:y,at:Date.now()}}))}finally{v(null)}},[s.id,p]),z=l.useCallback(({name:h,transport:y})=>{k(h),y!=="stdio"&&E(h).catch(()=>{})},[E]),M=t.data??[],R=new Set(M.map(h=>h.name)),I=new Map(((a==null?void 0:a.servers)??[]).map(h=>[h.name,h])),O=((a==null?void 0:a.servers)??[]).filter(h=>!R.has(h.name)),F=d.isPending||u.isPending||x.isPending,ie=M.some(h=>vs(h.connection)!==void 0),Q=o&&!t.isPending&&!ie&&ke(s.runtime).includes("stdio"),$=new Map;M.forEach((h,y)=>$.set(h.name,{kind:"managed",index:y})),O.forEach((h,y)=>$.set(h.name,{kind:"discovered",index:y}));const H=N({bothSettled:!t.isPending&&!i.isPending,managed:M,live:I,discovered:O,present:[...M.map(h=>h.name),...O.map(h=>h.name)]});function U(h){const y=$.get(h);if(!y)return null;if(y.kind==="managed"){const D=M[y.index];return e.jsx(dn,{server:D,agentId:s.id,live:I.get(D.name),testResult:m[D.name],rosterUpdatedAt:t.dataUpdatedAt,testing:j===D.name,busy:F,onToggle:P,onTest:E,onRemove:C},D.name)}const w=O[y.index];return e.jsx(gn,{entry:w,agentId:s.id,agentLabel:s.displayName??s.name,canImport:o},w.name)}return e.jsxs("section",{className:"space-y-3","aria-label":"MCP servers",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"MCP Servers"}),o&&e.jsx(Ms,{agentId:s.id,agentLabel:s.displayName??s.name,supportedTransports:ke(s.runtime),onAdded:z,oauthDetectedFor:b&&((Y=m[b])==null?void 0:Y.result.needsAuth)===!0?b:null})]}),e.jsx(jn,{}),Q&&e.jsx(fn,{agentId:s.id,agentLabel:s.displayName??s.name}),!o&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"This agent’s runtime can’t run DorkOS-managed MCP servers yet. Any servers below show read-only status."}),t.isLoading?e.jsx(T,{children:e.jsxs(A,{className:"space-y-2",children:[e.jsx(de,{className:"h-5 w-full"}),e.jsx(de,{className:"h-5 w-3/4"})]})}):t.isError?e.jsx(T,{children:e.jsxs(A,{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-destructive text-sm",children:"Couldn’t load managed servers."}),e.jsx(f,{variant:"outline",size:"sm",onClick:()=>t.refetch(),className:"focus-visible:ring-2",children:"Retry"})]})}):H.length===0?e.jsx(T,{children:e.jsx(A,{children:e.jsxs("p",{className:"text-muted-foreground text-sm",children:["No MCP servers yet."," ",o?"Add one to give this agent tools from an external server.":"This runtime can’t run managed servers."]})})}):e.jsx(T,{children:e.jsx(A,{children:H.map(U)})})]})}function ue({tools:s}){return e.jsxs(B,{children:[e.jsx(G,{asChild:!0,children:e.jsx(ne,{tone:"neutral",variant:"outline",className:"shrink-0 cursor-default font-normal",children:s.length})}),e.jsx(q,{side:"top",className:"max-w-xs",children:e.jsx("p",{className:"font-mono text-xs",children:s.join(", ")})})]})}function Nn({domain:s,agentOverride:n,globalDefault:t,onToggle:i,onReset:a}){const r=n!==void 0,o=n??t;return s.serverDisabled?e.jsx(Se,{label:s.label,description:s.description,className:"py-1",children:e.jsxs(B,{children:[e.jsx(G,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{variant:"secondary",children:"Disabled"}),e.jsx(ue,{tools:s.tools}),e.jsx(te,{checked:!1,disabled:!0,"aria-label":`Toggle ${s.label} tools`})]})}),e.jsx(q,{side:"left",children:s.serverDisabledReason??"Disabled globally by server configuration."})]})}):e.jsx(Se,{label:s.label,description:s.description,className:"py-1",children:e.jsxs("div",{className:"flex items-center gap-2",children:[!r&&e.jsx(ne,{tone:"neutral",variant:"outline",className:"font-normal",children:"default"}),r&&e.jsxs(B,{children:[e.jsx(G,{asChild:!0,children:e.jsx(f,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>a(s.key),"aria-label":`Reset ${s.label} to default`,children:e.jsx(gs,{className:"size-3"})})}),e.jsx(q,{side:"top",children:"Reset to global default"})]}),e.jsx(ue,{tools:s.tools}),e.jsx(te,{checked:o,onCheckedChange:d=>i(s.key,d),"aria-label":`Toggle ${s.label} tools`})]})})}function yn({agent:s,supportsDorkTools:n}){var d;const t=xs("roomsManage"),i=xe(),a=V(),r=((d=s.enabledToolGroups)==null?void 0:d.roomsManage)===!0,o=l.useCallback(u=>{i.mutate({id:s.id,updates:{enabledToolGroups:{...s.enabledToolGroups??{},roomsManage:u}}},{onSettled:()=>{a.invalidateQueries({queryKey:re.all}),a.invalidateQueries({queryKey:pe})}})},[s.id,s.enabledToolGroups,a,i]);return e.jsx(T,{children:e.jsxs(A,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Manage rooms"}),t.length>0?e.jsx(ue,{tools:t}):null]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Let this agent create channels and direct messages, add and remove members, rename a channel, and leave a channel."})]}),e.jsx(te,{checked:r,onCheckedChange:o,disabled:i.isPending,"aria-label":"Manage rooms"})]}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:[e.jsx("span",{className:"text-foreground font-medium",children:"This switch is a lock, not a hint."})," ","Unlike the groups above, turning it off blocks the calls: the agent is refused, and told to ask you. It is off until you turn it on, and only you can change it. The agent cannot turn it on for itself."]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"It can never remove you from a room, and any room holding two agents holds you too."}),n?null:e.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent’s runtime reaches these over the external MCP server rather than in-session, and the switch applies there just the same."})]})})}function Sn({agent:s}){const n=xe(),t=V(),i=s.tierCeiling??ps,a=l.useCallback(r=>{n.mutate({id:s.id,updates:{tierCeiling:r}},{onSettled:()=>{t.invalidateQueries({queryKey:re.all}),t.invalidateQueries({queryKey:pe})}})},[s.id,t,n]);return e.jsx(T,{children:e.jsxs(A,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-sm font-medium",children:"The most this agent can ever do"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Anything past this line is refused, and no approval can unlock it. Use it when you want an agent that reads your work but can never take anything away."})]}),e.jsxs(Oe,{value:i,onValueChange:a,disabled:n.isPending,children:[e.jsx(Ee,{className:"w-56","aria-label":"The most this agent can ever do",children:e.jsx(Re,{})}),e.jsxs(De,{children:[e.jsx(ee,{value:"observe",children:"Read only"}),e.jsx(ee,{value:"act",children:"Change things, never delete"}),e.jsx(ee,{value:"destructive",children:"No extra limit"})]})]})]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Every agent starts with no extra limit, so nothing you already run changes until you set one here. An agent can tighten its own limit; only you can loosen it."}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"This covers what the agent asks DorkOS to do. An agent that can run terminal commands can still act outside DorkOS. Turn on Require login, in Settings under Access, to close that door too."})]})})}function Cn({agent:s,projectPath:n}){const t=us(),i=ms(),{config:a}=hs(),r=xe(),o=V(),d=Pe(s.runtime),u=(d==null?void 0:d.supportsMcp)??!0,x=l.useCallback(v=>{r.mutate({id:s.id,updates:{enabledToolGroups:v}},{onSettled:()=>{o.invalidateQueries({queryKey:re.all}),o.invalidateQueries({queryKey:pe})}})},[s.id,o,r]),p=l.useCallback((v,b)=>{x({...s.enabledToolGroups??{},[v]:b})},[s.enabledToolGroups,x]),m=l.useCallback(v=>{const b={...s.enabledToolGroups??{}};delete b[v],x(b)},[s.enabledToolGroups,x]),c=[{key:"tasks",configKey:"tasksTools",label:"Scheduling",description:"Create and run scheduled tasks",tools:X("tasks"),serverDisabled:!i,serverDisabledReason:"Disabled globally by server configuration."},{key:"relay",configKey:"relayTools",label:"Messaging",description:"Send and receive messages between agents",tools:X("relay"),serverDisabled:!t,serverDisabledReason:"Disabled globally by server configuration."},{key:"mesh",configKey:"meshTools",label:"Agent discovery",description:"Find and register agents on this machine",tools:X("mesh")},{key:"adapter",configKey:"adapterTools",label:"Connection management",description:"Set up Telegram, Slack, and webhooks, and route each chat to an agent",tools:X("adapter"),serverDisabled:!t,serverDisabledReason:"Disabled globally by server configuration."}],j=s.enabledToolGroups??{};return e.jsxs("div",{className:"space-y-4",children:[u?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Choose which tool groups this agent is told about. Turn a group off and the agent stops being told those tools exist, so it stops reaching for them. This is guidance, not a lock: an agent that asks for one anyway still gets it. Leave a group unset to inherit the global default."}),e.jsx(T,{children:e.jsx(A,{children:c.map(v=>e.jsx(Nn,{domain:v,agentOverride:j[v.key],globalDefault:a[v.configKey],onToggle:p,onReset:m},v.key))})}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Core tools (ping, server info, agent identity) are always registered, whatever you set here."})]}):e.jsx(T,{children:e.jsx(A,{children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent’s runtime does not support DorkOS tool groups (Scheduling, Messaging, Agent discovery, Connection management). These are delivered over MCP, which this runtime cannot consume."})})}),e.jsx(Sn,{agent:s}),e.jsx(yn,{agent:s,supportsDorkTools:u}),e.jsx(bn,{agent:s,projectPath:n})]})}function An({member:s}){const{agent:n,projectPath:t,isPending:i}=fs(s);return i?e.jsx(de,{className:"h-32 w-full"}):!n||t===null?e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s tools."}):e.jsx(Cn,{agent:n,projectPath:t})}export{An as ToolsPage};