moi-computer 0.12.1-next.4 → 0.13.1-next.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 (74) hide show
  1. package/client/api/query-client.ts +5 -0
  2. package/client/app/app-router.tsx +1 -1
  3. package/client/app/routes/workspace-route.tsx +2 -0
  4. package/client/features/account/account-provider.tsx +28 -77
  5. package/client/features/account/account-test-utils.tsx +95 -93
  6. package/client/features/account/api.ts +32 -109
  7. package/client/features/account/profile-actions.ts +31 -0
  8. package/client/features/app-settings/settings-page.tsx +0 -4
  9. package/client/features/chat/messages/tool-group/subagent-card.tsx +1 -0
  10. package/client/features/collab/client.ts +38 -13
  11. package/client/features/collab/components/user-avatar.tsx +4 -10
  12. package/client/features/collab/hooks.tsx +9 -8
  13. package/client/features/collab/host-state.ts +45 -85
  14. package/client/features/collab/testing/fake-engine.ts +13 -1
  15. package/client/features/collab/users.ts +0 -12
  16. package/client/features/connectors/api.ts +12 -4
  17. package/client/features/connectors/mcp-server-cards.tsx +17 -7
  18. package/client/features/connectors/read-connectors.ts +35 -0
  19. package/client/features/dev/cloud-avatar-upload.tsx +58 -0
  20. package/client/features/dev/cloud-page.tsx +363 -0
  21. package/client/features/dev/collab/local-user-settings.tsx +1 -1
  22. package/client/features/dev/dev-index-page.tsx +6 -0
  23. package/client/features/dev/dev-routes.tsx +2 -0
  24. package/client/features/identity/host-api.ts +34 -0
  25. package/client/features/identity/store.ts +32 -0
  26. package/client/features/identity/types.ts +41 -0
  27. package/client/features/identity/use-identity.ts +6 -0
  28. package/client/features/workspace/harness-transition.ts +1 -0
  29. package/client/features/workspace/settings/connectors-settings.tsx +31 -10
  30. package/client/features/workspace/settings/general-settings.tsx +17 -14
  31. package/client/features/workspace-members/api.ts +20 -0
  32. package/client/features/workspace-members/hooks.ts +127 -0
  33. package/client/features/workspace-members/keys.ts +6 -0
  34. package/client/features/workspace-members/store.ts +123 -0
  35. package/client/features/workspace-members/types.ts +53 -0
  36. package/client/index.html +1 -1
  37. package/client/index.tsx +5 -9
  38. package/client/main.tsx +2 -2
  39. package/dist/{chunk-71fn6rmj.js → chunk-00s35r33.js} +68 -68
  40. package/dist/{chunk-g0tcwqxc.js → chunk-7rz6g7g7.js} +1 -1
  41. package/dist/chunk-af2jyddf.js +2 -0
  42. package/dist/chunk-cekekc3f.css +1 -0
  43. package/dist/chunk-ep5vh16c.js +75 -0
  44. package/dist/{chunk-2y59vrxg.js → chunk-kdgk4dac.js} +1 -1
  45. package/dist/chunk-s5s1vzdw.js +2 -0
  46. package/dist/{chunk-58dyt9bk.js → chunk-svxhxfeq.js} +2 -2
  47. package/dist/chunk-t0r0bds1.js +1 -0
  48. package/dist/chunk-vp2qzc0d.js +1 -0
  49. package/dist/chunk-wz5qv1bn.js +2 -0
  50. package/dist/index.html +2 -2
  51. package/lib/types.ts +4 -2
  52. package/package.json +7 -4
  53. package/server/api/index.ts +26 -1
  54. package/server/app-config.ts +3 -1
  55. package/server/harness/claude-code/index.ts +3 -6
  56. package/server/harness/claude-code/mcp.ts +17 -0
  57. package/server/harness/codex/NOTES.md +9 -2
  58. package/server/harness/codex/client.ts +8 -5
  59. package/server/harness/codex/connectors.ts +92 -0
  60. package/server/harness/codex/index.ts +2 -1
  61. package/server/harness/codex/pagination.ts +8 -5
  62. package/server/harness/codex/transport.ts +13 -6
  63. package/server/harness/types.ts +4 -1
  64. package/server/onboarding/prompt.md +2 -2
  65. package/skill/references/DESIGN.md +22 -3
  66. package/client/features/account/identity.ts +0 -23
  67. package/client/features/app-settings/users-settings.tsx +0 -195
  68. package/dist/chunk-0mjzg20x.js +0 -2
  69. package/dist/chunk-5aj040e5.css +0 -1
  70. package/dist/chunk-7yg1m8hx.js +0 -2
  71. package/dist/chunk-825hys3h.js +0 -1
  72. package/dist/chunk-9bb8m9rx.js +0 -2
  73. package/dist/chunk-n0nab26d.js +0 -1
  74. package/dist/chunk-v88n1bay.js +0 -74
@@ -2,4 +2,4 @@
2
2
  * SVG/attribute allowlists and URI sanitization approach derived from DOMPurify.
3
3
  * DOMPurify — MIT License, Copyright (c) 2015 Mario Heiderich
4
4
  * https://github.com/cure53/DOMPurify/blob/main/LICENSE
5
- */var v=new Set(["svg","a","altglyph","altglyphdef","altglyphitem","animate","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","feblend","fecolormatrix","fecomponenttransfer","fecomposite","feconvolvematrix","fediffuselighting","fedisplacementmap","fedistantlight","fedropshadow","feflood","fefunca","fefuncb","fefuncg","fefuncr","fegaussianblur","feimage","femerge","femergenode","femorphology","feoffset","fepointlight","fespecularlighting","fespotlight","fetile","feturbulence","filter","font","foreignobject","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","set","stop","style","switch","symbol","text","textpath","title","tref","tspan","use","view","vkern"]),y=new Set(["a","b","blockquote","body","br","code","del","div","em","h1","h2","h3","h4","h5","h6","i","li","mark","ol","p","pre","span","strong","s","sub","sup","table","tbody","td","th","thead","tr","u","ul"]),A=new Set(["script","iframe","object","embed","form","input","textarea","select","button","link","meta","base","img","video","audio","source","picture","svg"]),x=new Set(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","clippathunits","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","diffuseconstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","from","fx","fy","g1","g2","glyph-name","glyphref","gradienttransform","gradientunits","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","kernelmatrix","kernelunitlength","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","mask","mask-type","maskcontentunits","maskunits","max","media","method","min","mode","name","numoctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","radius","refx","refy","repeatcount","repeatdur","requiredfeatures","restart","result","role","rotate","rx","ry","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","text-anchor","text-decoration","text-rendering","textlength","to","transform","transform-origin","type","u1","u2","unicode","values","version","vert-adv-y","vert-origin-x","vert-origin-y","viewbox","visibility","width","word-spacing","wrap","writing-mode","x","x1","x2","xchannelselector","xlink:href","xml:id","xml:space","xlink:title","xmlns","xmlns:xlink","y","y1","y2","z","zoomandpan"]),k=new Set(["class","dir","href","id","lang","role","style","tabindex","title"]),d=/^data-/,p=/^aria-/,o=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,g=/^(?:https?:|mailto:)/i,S=/^data:/i,T=/^data:image\/(?:png|jpeg|jpg|gif|webp|avif|bmp|tiff|x-icon|vnd\.microsoft\.icon)[;,]/i,_=/^data:image\/svg\+xml[;,]/i,u=/^#/;function w(t){return t.replace(/\\([0-9a-fA-F]{1,6})\s?|\\([^\n])/g,(i,r,n)=>{if(r){let e=parseInt(r,16);if(e>1114111||e===0)return"�";return String.fromCodePoint(e)}return n})}var E=/^data:(?:image\/(?:png|jpeg|jpg|gif|webp|avif)|font\/(?:woff2?|opentype|truetype|sfnt)|application\/(?:x-font-woff|font-woff2?|x-font-ttf|x-font-opentype|font-sfnt))[;,]/i;function f(t){let i=w(t);return i=i.replace(/@import\s+(?:url\s*\([^)]*\)|"[^"]*"|'[^']*')[^;]*;?|@import\b[^;]*;?/gi,""),i=i.replace(/expression\s*\([^)]*\)/gi,""),i=i.replace(/-moz-binding\s*:[^;]*/gi,""),i=i.replace(/behavior\s*:[^;]*/gi,""),i=i.replace(/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gis,(r,n,e)=>{let a=e.replace(o,"");if(E.test(a)||u.test(a))return r;return""}),i}function L(t){return f(t)}var N=new Set(["animate","set","animatecolor","animatetransform"]),R=/^(?:href|xlink:href|on)/i;function z(t){let i=t.getAttribute("attributeName");if(!i)return!1;return R.test(i.replace(o,""))}var h=/^on/i,D=new Set(["clip-path","cursor","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),m=10;function I(t){let i=t.search(/;base64,/i);if(i>=0){let n=t.slice(i+8),e=Uint8Array.from(atob(n),(a)=>a.charCodeAt(0));return new TextDecoder().decode(e)}let r=t.indexOf(",");if(r<0)return null;return decodeURIComponent(t.slice(r+1))}function C(t){let i=new TextEncoder().encode(t),r=Array.from(i,(n)=>String.fromCharCode(n)).join("");return"data:image/svg+xml;base64,"+btoa(r)}function G(t,i){if(i>=m)return console.warn(`Embedded SVG data URI recursion depth limit (${m}) reached`),null;let r;try{let e=I(t);if(e===null)return null;r=e}catch{return null}let n=b(r,i+1);if(!n)return null;return C(n)}function O(t,i,r,n){let e=r.replace(o,""),a=t.tagName.toLowerCase();if(a==="image"||a==="feimage"){if(T.test(e))return r;if(_.test(e))return G(e,n);return null}if(a==="use"){if(u.test(e))return r;return null}if(a==="a"){if(g.test(e))return r;return null}if(S.test(e)||u.test(e))return r;return null}function l(t,i){for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r],e=n.name.toLowerCase(),a=e.replace(o,"");if(h.test(a)){t.removeAttribute(n.name);continue}if(d.test(e)||p.test(e))continue;if(!x.has(e)){t.removeAttribute(n.name);continue}if(e==="href"||e==="xlink:href"){let s=O(t,e,n.value,i);if(s===null)t.removeAttribute(n.name);else if(s!==n.value)n.value=s;continue}if(e==="style"){n.value=f(n.value);continue}if(D.has(e)&&/url\s*\(/i.test(n.value))n.value=f(n.value)}}function M(t){let i=t.tagName.toLowerCase();for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r],e=n.name.toLowerCase(),a=e.replace(o,"");if(h.test(a)){t.removeAttribute(n.name);continue}if(d.test(e)||p.test(e))continue;if(!k.has(e)){t.removeAttribute(n.name);continue}if(e==="href"){if(i!=="a"){t.removeAttribute(n.name);continue}let s=n.value.replace(o,"");if(!g.test(s))t.removeAttribute(n.name);continue}if(e==="style")n.value=f(n.value)}}function c(t,i,r){for(let n=t.children.length-1;n>=0;n--){let e=t.children[n],a=e.tagName.toLowerCase();if(i==="svg")if(a==="foreignobject")l(e,r),c(e,"html",r);else if(a==="style"){if(l(e,r),e.textContent)e.textContent=L(e.textContent)}else if(N.has(a)&&z(e))e.remove();else if(v.has(a))l(e,r),c(e,"svg",r);else e.remove();else if(A.has(a))e.remove();else if(y.has(a))M(e),c(e,"html",r);else e.remove()}}function b(t,i){let r=new DOMParser().parseFromString(t,"image/svg+xml");if(r.querySelector("parsererror"))return"";let e=r.documentElement;if(e.tagName.toLowerCase()!=="svg")return"";if(l(e,i),c(e,"svg",i),e.children.length===0)return"";return new XMLSerializer().serializeToString(e)}function We(t){return b(t,0)}export{We};
5
+ */var v=new Set(["svg","a","altglyph","altglyphdef","altglyphitem","animate","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","feblend","fecolormatrix","fecomponenttransfer","fecomposite","feconvolvematrix","fediffuselighting","fedisplacementmap","fedistantlight","fedropshadow","feflood","fefunca","fefuncb","fefuncg","fefuncr","fegaussianblur","feimage","femerge","femergenode","femorphology","feoffset","fepointlight","fespecularlighting","fespotlight","fetile","feturbulence","filter","font","foreignobject","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","set","stop","style","switch","symbol","text","textpath","title","tref","tspan","use","view","vkern"]),y=new Set(["a","b","blockquote","body","br","code","del","div","em","h1","h2","h3","h4","h5","h6","i","li","mark","ol","p","pre","span","strong","s","sub","sup","table","tbody","td","th","thead","tr","u","ul"]),A=new Set(["script","iframe","object","embed","form","input","textarea","select","button","link","meta","base","img","video","audio","source","picture","svg"]),x=new Set(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","clippathunits","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","diffuseconstant","direction","display","divisor","dominant-baseline","dur","dx","dy","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","from","fx","fy","g1","g2","glyph-name","glyphref","gradienttransform","gradientunits","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","kernelmatrix","kernelunitlength","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","mask","mask-type","maskcontentunits","maskunits","max","media","method","min","mode","name","numoctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","radius","refx","refy","repeatcount","repeatdur","requiredfeatures","restart","result","role","rotate","rx","ry","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","text-anchor","text-decoration","text-rendering","textlength","to","transform","transform-origin","type","u1","u2","unicode","values","version","vert-adv-y","vert-origin-x","vert-origin-y","viewbox","visibility","width","word-spacing","wrap","writing-mode","x","x1","x2","xchannelselector","xlink:href","xml:id","xml:space","xlink:title","xmlns","xmlns:xlink","y","y1","y2","z","zoomandpan"]),k=new Set(["class","dir","href","id","lang","role","style","tabindex","title"]),d=/^data-/,p=/^aria-/,o=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,g=/^(?:https?:|mailto:)/i,S=/^data:/i,T=/^data:image\/(?:png|jpeg|jpg|gif|webp|avif|bmp|tiff|x-icon|vnd\.microsoft\.icon)[;,]/i,_=/^data:image\/svg\+xml[;,]/i,u=/^#/;function w(t){return t.replace(/\\([0-9a-fA-F]{1,6})\s?|\\([^\n])/g,(i,r,n)=>{if(r){let e=parseInt(r,16);if(e>1114111||e===0)return"�";return String.fromCodePoint(e)}return n})}var E=/^data:(?:image\/(?:png|jpeg|jpg|gif|webp|avif)|font\/(?:woff2?|opentype|truetype|sfnt)|application\/(?:x-font-woff|font-woff2?|x-font-ttf|x-font-opentype|font-sfnt))[;,]/i;function f(t){let i=w(t);return i=i.replace(/@import\s+(?:url\s*\([^)]*\)|"[^"]*"|'[^']*')[^;]*;?|@import\b[^;]*;?/gi,""),i=i.replace(/expression\s*\([^)]*\)/gi,""),i=i.replace(/-moz-binding\s*:[^;]*/gi,""),i=i.replace(/behavior\s*:[^;]*/gi,""),i=i.replace(/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gis,(r,n,e)=>{let a=e.replace(o,"");if(E.test(a)||u.test(a))return r;return""}),i}function L(t){return f(t)}var N=new Set(["animate","set","animatecolor","animatetransform"]),R=/^(?:href|xlink:href|on)/i;function z(t){let i=t.getAttribute("attributeName");if(!i)return!1;return R.test(i.replace(o,""))}var h=/^on/i,D=new Set(["clip-path","cursor","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),m=10;function I(t){let i=t.search(/;base64,/i);if(i>=0){let n=t.slice(i+8),e=Uint8Array.from(atob(n),(a)=>a.charCodeAt(0));return new TextDecoder().decode(e)}let r=t.indexOf(",");if(r<0)return null;return decodeURIComponent(t.slice(r+1))}function C(t){let i=new TextEncoder().encode(t),r=Array.from(i,(n)=>String.fromCharCode(n)).join("");return"data:image/svg+xml;base64,"+btoa(r)}function G(t,i){if(i>=m)return console.warn(`Embedded SVG data URI recursion depth limit (${m}) reached`),null;let r;try{let e=I(t);if(e===null)return null;r=e}catch{return null}let n=b(r,i+1);if(!n)return null;return C(n)}function O(t,i,r,n){let e=r.replace(o,""),a=t.tagName.toLowerCase();if(a==="image"||a==="feimage"){if(T.test(e))return r;if(_.test(e))return G(e,n);return null}if(a==="use"){if(u.test(e))return r;return null}if(a==="a"){if(g.test(e))return r;return null}if(S.test(e)||u.test(e))return r;return null}function l(t,i){for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r],e=n.name.toLowerCase(),a=e.replace(o,"");if(h.test(a)){t.removeAttribute(n.name);continue}if(d.test(e)||p.test(e))continue;if(!x.has(e)){t.removeAttribute(n.name);continue}if(e==="href"||e==="xlink:href"){let s=O(t,e,n.value,i);if(s===null)t.removeAttribute(n.name);else if(s!==n.value)n.value=s;continue}if(e==="style"){n.value=f(n.value);continue}if(D.has(e)&&/url\s*\(/i.test(n.value))n.value=f(n.value)}}function M(t){let i=t.tagName.toLowerCase();for(let r=t.attributes.length-1;r>=0;r--){let n=t.attributes[r],e=n.name.toLowerCase(),a=e.replace(o,"");if(h.test(a)){t.removeAttribute(n.name);continue}if(d.test(e)||p.test(e))continue;if(!k.has(e)){t.removeAttribute(n.name);continue}if(e==="href"){if(i!=="a"){t.removeAttribute(n.name);continue}let s=n.value.replace(o,"");if(!g.test(s))t.removeAttribute(n.name);continue}if(e==="style")n.value=f(n.value)}}function c(t,i,r){for(let n=t.children.length-1;n>=0;n--){let e=t.children[n],a=e.tagName.toLowerCase();if(i==="svg")if(a==="foreignobject")l(e,r),c(e,"html",r);else if(a==="style"){if(l(e,r),e.textContent)e.textContent=L(e.textContent)}else if(N.has(a)&&z(e))e.remove();else if(v.has(a))l(e,r),c(e,"svg",r);else e.remove();else if(A.has(a))e.remove();else if(y.has(a))M(e),c(e,"html",r);else e.remove()}}function b(t,i){let r=new DOMParser().parseFromString(t,"image/svg+xml");if(r.querySelector("parsererror"))return"";let e=r.documentElement;if(e.tagName.toLowerCase()!=="svg")return"";if(l(e,i),c(e,"svg",i),e.children.length===0)return"";return new XMLSerializer().serializeToString(e)}function gt(t){return b(t,0)}export{gt};
@@ -0,0 +1,2 @@
1
+ var na=Object.create;var{getPrototypeOf:sa,defineProperty:sr,getOwnPropertyNames:ca}=Object;var xr=Object.prototype.hasOwnProperty;function la(r){return this[r]}var da,pa,e=(r,a,t)=>{var o=r!=null&&typeof r==="object";if(o){var i=a?da??=new WeakMap:pa??=new WeakMap,c=i.get(r);if(c)return c}t=r!=null?na(sa(r)):{};let n=a||!r||!r.__esModule||!xr.call(r,"default")?sr(t,"default",{value:r,enumerable:!0}):t;if(r&&typeof r==="object"||typeof r==="function"){for(let s of ca(r))if(!xr.call(n,s))sr(n,s,{get:la.bind(r,s),enumerable:!0})}if(o)i.set(r,n);return n};var x=(r,a)=>()=>(a||r((a={exports:{}}).exports,a),a.exports);var ha=(r)=>r;function ga(r,a){this[r]=ha.bind(null,a)}var be=(r,a)=>{for(var t in a)sr(r,t,{get:a[t],enumerable:!0,configurable:!0,set:ga.bind(a,t)})};var st=((r)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(a,t)=>(typeof require<"u"?require:a)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var yr,cr,L,Y=(r,a)=>{for(var[t,o,i]of yr||[])for(var c=[r],n=globalThis,s=n.document,l,d,h,p,g;d=c.pop();)if(!cr[d]&&(h=o[d])){cr[d]=1;for(p=1;p<h.length;p++)c.push(i[h[p]]);if(!a&&d!==r&&(l=s&&s.head)){if(L===void 0)L=(p=s.querySelector("meta[property=csp-nonce]"))&&(p.nonce||p.getAttribute("nonce"))||"";if(g=s.createElement("link"),g.rel="modulepreload",g.crossOrigin="",L)g.nonce=L;g.href=new n.URL(h[0],t),l.appendChild(g)}}},ua=(r,a,t,o)=>{for(var i={},c=0;c<a.length;c++)i[a[c]]=t[c];(yr||=[]).push([r,i,a]),cr||={},Y(a[o],1)};ua(import.meta.url,["s5s1vzdw","ep5vh16c","vp2qzc0d","7rz6g7g7","nf2wkvf9","00s35r33","af2jyddf","wz5qv1bn","svxhxfeq","t0r0bds1","kdgk4dac"],[["/chunk-s5s1vzdw.js"],["/chunk-ep5vh16c.js",6,0,7,8],["/chunk-vp2qzc0d.js",7],["/chunk-7rz6g7g7.js",0,8],["/chunk-nf2wkvf9.js"],["/chunk-00s35r33.js",10,6,0,7],["/chunk-af2jyddf.js",0,7],["/chunk-wz5qv1bn.js",0,8],["/chunk-svxhxfeq.js"],["/chunk-t0r0bds1.js",10],["/chunk-kdgk4dac.js"]],0);
2
+ if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);var va={setTimeout:(r,a)=>setTimeout(r,a),clearTimeout:(r)=>clearTimeout(r),setInterval:(r,a)=>setInterval(r,a),clearInterval:(r)=>clearInterval(r)},wa=class{#r=va;#a=!1;setTimeoutProvider(r){this.#r=r}setTimeout(r,a){return this.#r.setTimeout(r,a)}clearTimeout(r){this.#r.clearTimeout(r)}setInterval(r,a){return this.#r.setInterval(r,a)}clearInterval(r){this.#r.clearInterval(r)}},Z=new wa;function kr(r){setTimeout(r,0)}var dr=typeof window>"u"||"Deno"in globalThis;function A(){}function Cr(r,a){return typeof r==="function"?r(a):r}function Be(r){return typeof r==="number"&&r>=0&&r!==1/0}function ze(r,a){return Math.max(r+(a||0)-Date.now(),0)}function T(r,a){return typeof r==="function"?r(a):r}function ve(r,a){let{type:t="all",exact:o,fetchStatus:i,predicate:c,queryKey:n,stale:s}=r;if(n){if(o){if(a.queryHash!==D(n,a.options))return!1}else if(!z(a.queryKey,n))return!1}if(t!=="all"){let l=a.isActive();if(t==="active"&&!l)return!1;if(t==="inactive"&&l)return!1}if(typeof s==="boolean"&&a.isStale()!==s)return!1;if(i&&i!==a.state.fetchStatus)return!1;if(c&&!c(a))return!1;return!0}function K(r,a){let{exact:t,status:o,predicate:i,mutationKey:c}=r;if(c){if(!a.options.mutationKey)return!1;if(t){if(J(a.options.mutationKey)!==J(c))return!1}else if(!z(a.options.mutationKey,c))return!1}if(o&&a.state.status!==o)return!1;if(i&&!i(a))return!1;return!0}function D(r,a){return(a?.queryKeyHashFn||J)(r)}function J(r){return JSON.stringify(r,(a,t)=>lr(t)?Object.keys(t).sort().reduce((o,i)=>(o[i]=t[i],o),{}):t)}function z(r,a){if(r===a)return!0;if(typeof r!==typeof a)return!1;if(r&&a&&typeof r==="object"&&typeof a==="object"){if(Array.isArray(r)&&Array.isArray(a)){for(let o=0;o<a.length;o++)if(!z(r[o],a[o]))return!1;return!0}let t=Object.keys(a);for(let o of t)if(!z(r[o],a[o]))return!1;return!0}return!1}var ma=Object.prototype.hasOwnProperty;function Re(r,a,t=0){if(r===a)return r;if(t>500)return a;let o=zr(r)&&zr(a);if(!o&&!(lr(r)&&lr(a)))return a;let i=(o?r:Object.keys(r)).length,c=o?a:Object.keys(a),n=c.length,s=o?Array(n):{},l=0;for(let d=0;d<n;d++){let h=o?d:c[d],p=r[h],g=a[h];if(p===g){if(s[h]=p,o?d<i:ma.call(r,h))l++;continue}if(p===null||g===null||typeof p!=="object"||typeof g!=="object"){s[h]=g;continue}let b=Re(p,g,t+1);if(s[h]=b,b===p)l++}return i===n&&l===i?r:s}function we(r,a){if(!a||Object.keys(r).length!==Object.keys(a).length)return!1;for(let t in r)if(r[t]!==a[t])return!1;return!0}function zr(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function lr(r){if(!_r(r))return!1;let a=r.constructor;if(a===void 0)return!0;let t=a.prototype;if(!_r(t))return!1;if(!t.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf(r)!==Object.prototype)return!1;return!0}function _r(r){return Object.prototype.toString.call(r)==="[object Object]"}function Er(r){return new Promise((a)=>{Z.setTimeout(a,r)})}function Ae(r,a,t){if(typeof t.structuralSharing==="function")return t.structuralSharing(r,a);else if(t.structuralSharing!==!1)return Re(r,a);return a}function Sr(r,a,t=0){let o=[...r,a];return t&&o.length>t?o.slice(1):o}function Ar(r,a,t=0){let o=[a,...r];return t&&o.length>t?o.slice(0,-1):o}var P=Symbol();function H(r,a){if(!r.queryFn&&a?.initialPromise)return()=>a.initialPromise;if(!r.queryFn||r.queryFn===P)return()=>Promise.reject(Error(`Missing queryFn: '${r.queryHash}'`));return r.queryFn}function Se(r,a){if(typeof r==="function")return r(...a);return!!r}function jr(r,a,t){let o=!1,i;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>{if(i??=a(),o)return i;if(o=!0,i.aborted)t();else i.addEventListener("abort",t,{once:!0});return i}}),r}var fa=()=>dr,Ie=()=>fa();var G=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var ba=class extends G{#r;#a;#t;constructor(){super();this.#t=(r)=>{if(typeof window<"u"&&window.addEventListener){let a=()=>r();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){if(!this.#a)this.setEventListener(this.#t)}onUnsubscribe(){if(!this.hasListeners())this.#a?.(),this.#a=void 0}setEventListener(r){this.#t=r,this.#a?.(),this.#a=r((a)=>{if(typeof a==="boolean")this.setFocused(a);else this.onFocus()})}setFocused(r){if(this.#r!==r)this.#r=r,this.onFocus()}onFocus(){let r=this.isFocused();this.listeners.forEach((a)=>{a(r)})}isFocused(){if(typeof this.#r==="boolean")return this.#r;return globalThis.document?.visibilityState!=="hidden"}},Ce=new ba;var Pr=kr;function xa(){let r=[],a=0,t=(s)=>{s()},o=(s)=>{s()},i=Pr,c=(s)=>{if(a)r.push(s);else i(()=>{t(s)})},n=()=>{let s=r;if(r=[],s.length)i(()=>{o(()=>{s.forEach((l)=>{t(l)})})})};return{batch:(s)=>{let l;a++;try{l=s()}finally{if(a--,!a)n()}return l},batchCalls:(s)=>(...l)=>{c(()=>{s(...l)})},schedule:c,setNotifyFunction:(s)=>{t=s},setBatchNotifyFunction:(s)=>{o=s},setScheduler:(s)=>{i=s}}}var C=xa();var ya=class extends G{#r=!0;#a;#t;constructor(){super();this.#t=(r)=>{if(typeof window<"u"&&window.addEventListener){let a=()=>r(!0),t=()=>r(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",t)}}}}onSubscribe(){if(!this.#a)this.setEventListener(this.#t)}onUnsubscribe(){if(!this.hasListeners())this.#a?.(),this.#a=void 0}setEventListener(r){this.#t=r,this.#a?.(),this.#a=r(this.setOnline.bind(this))}setOnline(r){if(this.#r!==r)this.#r=r,this.listeners.forEach((a)=>{a(r)})}isOnline(){return this.#r}},O=new ya;function ka(r){return Math.min(1000*2**r,30000)}function pr(r){return(r??"online")==="online"?O.isOnline():!0}var V=class extends Error{constructor(r){super("CancelledError");this.revert=r?.revert,this.silent=r?.silent}};function X(r){let a=!1,t=0,o,i="pending",c,n,s=new Promise((u,m)=>{c=u,n=m});s.catch(A);let l=()=>i!=="pending",d=(u)=>{if(!l()){let m=new V(u);w(m),r.onCancel?.(m)}},h=()=>{a=!0},p=()=>{a=!1},g=()=>Ce.isFocused()&&(r.networkMode==="always"||O.isOnline())&&r.canRun(),b=()=>pr(r.networkMode)&&r.canRun(),v=(u)=>{if(!l())o?.(),i="resolved",c(u)},w=(u)=>{if(!l())o?.(),i="rejected",n(u)},y=()=>new Promise((u)=>{o=(m)=>{if(l()||g())u(m)},r.onPause?.()}).then(()=>{if(o=void 0,!l())r.onContinue?.()}),R=()=>{if(l())return;let u,m=t===0?r.initialPromise:void 0;try{u=m??r.fn()}catch(f){u=Promise.reject(f)}Promise.resolve(u).then(v).catch((f)=>{if(l())return;let k=r.retry??(Ie()?0:3),S=r.retryDelay??ka,oa=typeof S==="function"?S(t,f):S,ia=k===!0||typeof k==="number"&&t<k||typeof k==="function"&&k(t,f);if(a||!ia){w(f);return}t++,r.onFail?.(t,f),Er(oa).then(()=>g()?void 0:y()).then(()=>{if(a)w(f);else R()})})};return{promise:s,status:()=>i,cancel:d,continue:()=>(o?.(),s),cancelRetry:h,continueRetry:p,canStart:b,start:()=>{if(b())R();else y().then(R);return s}}}var rr=class{#r;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),Be(this.gcTime))this.#r=Z.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(Ie()?1/0:300000))}clearGcTimeout(){if(this.#r!==void 0)Z.clearTimeout(this.#r),this.#r=void 0}};function Mr(r){return{onFetch:(a,t)=>{let o=a.options,i=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],n=a.state.data?.pageParams||[],s={pages:[],pageParams:[]},l=0,d=async()=>{let h=!1,p=(v)=>{jr(v,()=>a.signal,()=>h=!0)},g=H(a.options,a.fetchOptions),b=async(v,w,y)=>{if(h)return Promise.reject(a.signal.reason);if(w==null&&v.pages.length)return Promise.resolve(v);let u=(()=>{let S={client:a.client,queryKey:a.queryKey,pageParam:w,direction:y?"backward":"forward",meta:a.options.meta};return p(S),S})(),m=await g(u),{maxPages:f}=a.options,k=y?Ar:Sr;return{pages:k(v.pages,m,f),pageParams:k(v.pageParams,w,f)}};if(i&&c.length){let v=i==="backward",w=v?za:Or,y={pages:c,pageParams:n};s=await b(y,w(o,y),v)}else{let v=r??c.length;do{let w=l===0?n[0]??o.initialPageParam:Or(o,s);if(l>0&&w==null)break;s=await b(s,w),l++}while(l<v)}return s};if(a.options.persister)a.fetchFn=()=>a.options.persister?.(d,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},t);else a.fetchFn=d}}}function Or(r,{pages:a,pageParams:t}){let o=a.length-1;return a.length>0?r.getNextPageParam(a[o],a,t[o],t):void 0}function za(r,{pages:a,pageParams:t}){return a.length>0?r.getPreviousPageParam?.(a[0],a,t[0],t):void 0}var Dr=class extends rr{#r;#a;#t;#o;#i;#e;#c;#n;constructor(r){super();this.#n=!1,this.#c=r.defaultOptions,this.setOptions(r.options),this.observers=[],this.#i=r.client,this.#o=this.#i.getQueryCache(),this.queryKey=r.queryKey,this.queryHash=r.queryHash,this.#a=qr(this.options),this.state=r.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#r}get promise(){return this.#e?.promise}setOptions(r){if(this.options={...this.#c,...r},r?._type)this.#r=r._type;if(this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let a=qr(this.options);if(a.data!==void 0)this.setState(Ir(a.data,a.dataUpdatedAt)),this.#a=a}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#o.remove(this)}setData(r,a){let t=Ae(this.state.data,r,this.options);return this.#s({data:t,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),t}setState(r){this.#s({type:"setState",state:r})}cancel(r){let a=this.#e?.promise;return this.#e?.cancel(r),a?a.then(A).catch(A):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#a}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some((r)=>T(r.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===P||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some((r)=>T(r.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some((r)=>r.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){if(this.state.data===void 0)return!0;if(r==="static")return!1;if(this.state.isInvalidated)return!0;return!ze(this.state.dataUpdatedAt,r)}onFocus(){this.observers.find((r)=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#e?.continue()}onOnline(){this.observers.find((r)=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#e?.continue()}addObserver(r){if(!this.observers.includes(r))this.observers.push(r),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:r})}removeObserver(r){let a=this.observers.indexOf(r);if(a!==-1){if(this.observers.splice(a,1),!this.observers.length){if(this.#e)if(this.#n||this.state.fetchStatus==="paused"&&this.state.status==="pending")this.#e.cancel({revert:!0});else this.#e.cancelRetry();this.scheduleGc()}this.#o.notify({type:"observerRemoved",query:this,observer:r})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#s({type:"invalidate"})}async fetch(r,a){if(this.state.fetchStatus!=="idle"&&this.#e?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#e)return this.#e.continueRetry(),this.#e.promise}if(r)this.setOptions(r);if(!this.options.queryFn){let l=this.observers.find((d)=>d.options.queryFn);if(l)this.setOptions(l.options)}let t=new AbortController,o=(l)=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#n=!0,t.signal)})},i=()=>{let l=H(this.options,a),h=(()=>{let p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return o(p),p})();if(this.#n=!1,this.options.persister)return this.options.persister(l,h,this);return l(h)},n=(()=>{let l={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return o(l),l})();if((this.#r==="infinite"?Mr(this.options.pages):this.options.behavior)?.onFetch(n,this),this.#t=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==n.fetchOptions?.meta)this.#s({type:"fetch",meta:n.fetchOptions?.meta});let s=this.#e=X({initialPromise:a?.initialPromise,fn:n.fetchFn,onCancel:(l)=>{if(l instanceof V&&l.revert)this.setState({...this.#t,fetchStatus:"idle"});t.abort()},onFail:(l,d)=>{this.#s({type:"failed",failureCount:l,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:n.options.retry,retryDelay:n.options.retryDelay,networkMode:n.options.networkMode,canRun:()=>!0});try{let l=await s.start();if(l===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#o.config.onSuccess?.(l,this),this.#o.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof V){if(l.silent)return this.#e.promise;else if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#s({type:"error",error:l}),this.#o.config.onError?.(l,this),this.#o.config.onSettled?.(this.state.data,l,this),l}finally{if(this.#e===s)this.#e=void 0;this.scheduleGc()}}#s(r){let a=(t)=>{switch(r.type){case"failed":return{...t,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...Ze(t.data,this.options),fetchMeta:r.meta??null};case"success":let o={...t,...Ir(r.data,r.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=r.manual?o:void 0,o;case"error":let i=r.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...r.state}}};this.state=a(this.state),C.batch(()=>{this.observers.slice().forEach((t)=>{t.onQueryUpdate()}),this.#o.notify({query:this,type:"updated",action:r})})}};function Ze(r,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pr(a.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function Ir(r,a){return{data:r,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qr(r){let a=typeof r.initialData==="function"?r.initialData():r.initialData,t=a!==void 0,o=t?typeof r.initialDataUpdatedAt==="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:t?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var Ur=class extends rr{#r;#a;#t;#o;constructor(r){super();this.#r=r.client,this.mutationId=r.mutationId,this.#t=r.mutationCache,this.#a=[],this.state=r.state||Je(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){if(!this.#a.includes(r))this.#a.push(r),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:r})}removeObserver(r){this.#a=this.#a.filter((a)=>a!==r),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){if(!this.#a.length)if(this.state.status==="pending")this.scheduleGc();else this.#t.remove(this)}continue(){return this.#o?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(r){let a=()=>{this.#i({type:"continue"})},t={client:this.#r,meta:this.options.meta,mutationKey:this.options.mutationKey},o=this.#o=X({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn(r,t)},onFail:(n,s)=>{this.#i({type:"failed",failureCount:n,error:s})},onPause:()=>{this.#i({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)}),i=this.state.status==="pending",c=!o.canStart();try{if(i)a();else{if(this.#i({type:"pending",variables:r,isPaused:c}),this.#t.config.onMutate)await this.#t.config.onMutate(r,this,t);let s=await this.options.onMutate?.(r,t);if(s!==this.state.context)this.#i({type:"pending",context:s,variables:r,isPaused:c})}let n=await o.start();return await this.#t.config.onSuccess?.(n,r,this.state.context,this,t),await this.options.onSuccess?.(n,r,this.state.context,t),await this.#t.config.onSettled?.(n,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(n,null,r,this.state.context,t),this.#i({type:"success",data:n}),n}catch(n){try{await this.#t.config.onError?.(n,r,this.state.context,this,t)}catch(s){Promise.reject(s)}try{await this.options.onError?.(n,r,this.state.context,t)}catch(s){Promise.reject(s)}try{await this.#t.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this,t)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,n,r,this.state.context,t)}catch(s){Promise.reject(s)}throw this.#i({type:"error",error:n}),n}finally{if(this.#o===o)this.#o=void 0;this.#t.runNext(this)}}#i(r){let a=(t)=>{switch(r.type){case"failed":return{...t,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...t,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:r.error,failureCount:t.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=a(this.state),C.batch(()=>{this.#a.forEach((t)=>{t.onMutationUpdate(r)}),this.#t.notify({mutation:this,type:"updated",action:r})})}};function Je(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fr=class extends G{#r;#a;#t;constructor(r={}){super();this.config=r,this.#r=new Set,this.#a=new Map,this.#t=0}build(r,a,t){let o=new Ur({client:r,mutationCache:this,mutationId:++this.#t,options:r.defaultMutationOptions(a),state:t});return this.add(o),o}add(r){this.#r.add(r);let a=ar(r);if(typeof a==="string"){let t=this.#a.get(a);if(t)t.push(r);else this.#a.set(a,[r])}this.notify({type:"added",mutation:r})}remove(r){if(this.#r.delete(r)){let a=ar(r);if(typeof a==="string"){let t=this.#a.get(a);if(t){if(t.length>1){let o=t.indexOf(r);if(o!==-1)t.splice(o,1)}else if(t[0]===r)this.#a.delete(a)}}}this.notify({type:"removed",mutation:r})}canRun(r){let a=ar(r);if(typeof a==="string"){let t=this.#a.get(a)?.find((o)=>o.state.status==="pending");return!t||t===r}else return!0}runNext(r){let a=ar(r);if(typeof a==="string")return this.#a.get(a)?.find((t)=>t!==r&&t.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){C.batch(()=>{this.#r.forEach((r)=>{this.notify({type:"removed",mutation:r})}),this.#r.clear(),this.#a.clear()})}getAll(){return Array.from(this.#r)}find(r){let a={exact:!0,...r};return this.getAll().find((t)=>K(a,t))}findAll(r={}){return this.getAll().filter((a)=>K(r,a))}notify(r){C.batch(()=>{this.listeners.forEach((a)=>{a(r)})})}resumePausedMutations(){let r=this.getAll().filter((a)=>a.state.isPaused);return C.batch(()=>Promise.all(r.map((a)=>a.continue().catch(A))))}};function ar(r){return r.options.scope?.id}var Tr=class extends G{#r;constructor(r={}){super();this.config=r,this.#r=new Map}build(r,a,t){let o=a.queryKey,i=a.queryHash??D(o,a),c=this.get(i);if(!c)c=new Dr({client:r,queryKey:o,queryHash:i,options:r.defaultQueryOptions(a),state:t,defaultOptions:r.getQueryDefaults(o)}),this.add(c);return c}add(r){if(!this.#r.has(r.queryHash))this.#r.set(r.queryHash,r),this.notify({type:"added",query:r})}remove(r){let a=this.#r.get(r.queryHash);if(a){if(r.destroy(),a===r)this.#r.delete(r.queryHash);this.notify({type:"removed",query:r})}}clear(){C.batch(()=>{this.getAll().forEach((r)=>{this.remove(r)})})}get(r){return this.#r.get(r)}getAll(){return[...this.#r.values()]}find(r){let a={exact:!0,...r};return this.getAll().find((t)=>ve(a,t))}findAll(r={}){let a=this.getAll();return Object.keys(r).length>0?a.filter((t)=>ve(r,t)):a}notify(r){C.batch(()=>{this.listeners.forEach((a)=>{a(r)})})}onFocus(){C.batch(()=>{this.getAll().forEach((r)=>{r.onFocus()})})}onOnline(){C.batch(()=>{this.getAll().forEach((r)=>{r.onOnline()})})}};var hr=class{#r;#a;#t;#o;#i;#e;#c;#n;constructor(r={}){this.#r=r.queryCache||new Tr,this.#a=r.mutationCache||new Fr,this.#t=r.defaultOptions||{},this.#o=new Map,this.#i=new Map,this.#e=0}mount(){if(this.#e++,this.#e!==1)return;this.#c=Ce.subscribe(async(r)=>{if(r)await this.resumePausedMutations(),this.#r.onFocus()}),this.#n=O.subscribe(async(r)=>{if(r)await this.resumePausedMutations(),this.#r.onOnline()})}unmount(){if(this.#e--,this.#e!==0)return;this.#c?.(),this.#c=void 0,this.#n?.(),this.#n=void 0}isFetching(r){return this.#r.findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return this.#a.findAll({...r,status:"pending"}).length}getQueryData(r){let a=this.defaultQueryOptions({queryKey:r});return this.#r.get(a.queryHash)?.state.data}ensureQueryData(r){let a=this.defaultQueryOptions(r),t=this.#r.build(this,a),o=t.state.data;if(o===void 0)return this.fetchQuery(r);if(r.revalidateIfStale&&t.isStaleByTime(T(a.staleTime,t)))this.prefetchQuery(a);return Promise.resolve(o)}getQueriesData(r){return this.#r.findAll(r).map(({queryKey:a,state:t})=>[a,t.data])}setQueryData(r,a,t){let o=this.defaultQueryOptions({queryKey:r}),i=this.#r.get(o.queryHash)?.state.data,c=Cr(a,i);if(c===void 0)return;return this.#r.build(this,o).setData(c,{...t,manual:!0})}setQueriesData(r,a,t){return C.batch(()=>this.#r.findAll(r).map(({queryKey:o})=>[o,this.setQueryData(o,a,t)]))}getQueryState(r){let a=this.defaultQueryOptions({queryKey:r});return this.#r.get(a.queryHash)?.state}removeQueries(r){let a=this.#r;C.batch(()=>{a.findAll(r).forEach((t)=>{a.remove(t)})})}resetQueries(r,a){let t=this.#r;return C.batch(()=>{let o=t.findAll(r),i=new Set(o);return o.forEach((c)=>{c.reset()}),this.refetchQueries({type:"active",predicate:(c)=>i.has(c)},a)})}cancelQueries(r,a={}){let t={revert:!0,...a},o=C.batch(()=>this.#r.findAll(r).map((i)=>i.cancel(t)));return Promise.all(o).then(A).catch(A)}invalidateQueries(r,a={}){return C.batch(()=>{if(this.#r.findAll(r).forEach((t)=>{t.invalidate()}),r?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...r,type:r?.refetchType??r?.type??"active"},a)})}refetchQueries(r,a={}){let t={...a,cancelRefetch:a.cancelRefetch??!0},o=C.batch(()=>this.#r.findAll(r).filter((i)=>!i.isDisabled()&&!i.isStatic()).map((i)=>{let c=i.fetch(void 0,t);if(!t.throwOnError)c=c.catch(A);return i.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(o).then(A)}async query(r){let a=this.defaultQueryOptions(r);if(a.retry===void 0)a.retry=!1;let t=this.#r.build(this,a),o=t.isStaleByTime(T(a.staleTime,t))?await t.fetch(a):t.state.data,i=a.select;if(i)return i(o);return o}fetchQuery(r){let a=this.defaultQueryOptions(r);if(a.retry===void 0)a.retry=!1;let t=this.#r.build(this,a);return t.isStaleByTime(T(a.staleTime,t))?t.fetch(a):Promise.resolve(t.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(A).catch(A)}infiniteQuery(r){return r._type="infinite",this.query(r)}fetchInfiniteQuery(r){return r._type="infinite",this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(A).catch(A)}ensureInfiniteQueryData(r){return r._type="infinite",this.ensureQueryData(r)}resumePausedMutations(){if(O.isOnline())return this.#a.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#a}getDefaultOptions(){return this.#t}setDefaultOptions(r){this.#t=r}setQueryDefaults(r,a){this.#o.set(J(r),{queryKey:r,defaultOptions:a})}getQueryDefaults(r){let a=[...this.#o.values()],t={};return a.forEach((o)=>{if(z(r,o.queryKey))Object.assign(t,o.defaultOptions)}),t}setMutationDefaults(r,a){this.#i.set(J(r),{mutationKey:r,defaultOptions:a})}getMutationDefaults(r){let a=[...this.#i.values()],t={};return a.forEach((o)=>{if(z(r,o.mutationKey))Object.assign(t,o.defaultOptions)}),t}defaultQueryOptions(r){if(r._defaulted)return r;let a={...this.#t.queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};if(!a.queryHash)a.queryHash=D(a.queryKey,a);if(a.refetchOnReconnect===void 0)a.refetchOnReconnect=a.networkMode!=="always";if(a.throwOnError===void 0)a.throwOnError=!!a.suspense;if(!a.networkMode&&a.persister)a.networkMode="offlineFirst";if(a.queryFn===P)a.enabled=!1;return a}defaultMutationOptions(r){if(r?._defaulted)return r;return{...this.#t.mutations,...r?.mutationKey&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){this.#r.clear(),this.#a.clear()}};var M=new hr;var N={all:["workspace-members"],account:(r)=>[...N.all,r??"unknown"],workspace:(r,a)=>[...N.account(r),a]};var I=["pink","orange","amber","lime","emerald","cyan","blue","violet"];function tr(r){return typeof r==="string"&&I.includes(r)}function Qr(r){let a=2166136261;for(let t=0;t<r.length;t++)a^=r.charCodeAt(t),a=Math.imul(a,16777619);return I[(a>>>0)%I.length]??I[0]}var lt=1;var _a=8192,Ca=320;function ne(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)}function er(r,a=256){return typeof r==="string"&&r.length>0&&!r.includes("\x00")&&new TextEncoder().encode(r).length<=a}function Rr(r){return ne(r)&&er(r.id,240)&&r.id.trim().length>0&&(r.name===void 0||er(r.name)&&r.name.trim().length>0)&&tr(r.color)&&(r.avatar===void 0||er(r.avatar,_a))&&(r.email===void 0||er(r.email,Ca))}function or(r,a){return typeof r==="string"&&r.length<=a&&!r.includes("\x00")}function Ea(r){if(!or(r,2048))return!1;try{return["http:","https:"].includes(new URL(r).protocol)}catch{return!1}}function ie(r){if(!ne(r)||!or(r.id,240)||!r.id.trim()||r.id!==r.id.trim()||!or(r.name,256)||r.avatar!==void 0&&!Ea(r.avatar))throw Error("Invalid identity");let a={id:r.id,name:r.name,...r.avatar!==void 0?{avatar:r.avatar}:{}};if(r.type==="agent")return{...a,type:"agent"};if(r.type==="user"&&or(r.email,320)&&typeof r.isAnonymous==="boolean")return{...a,type:"user",email:r.email,isAnonymous:r.isAnonymous};throw Error("Invalid identity")}var W=(r)=>`${r.type}:${r.id}`,ir=(r)=>r.type==="agent"?`agent:${r.id}`:r.id;var nr,Lr=0,Nr=0,gr=new Set,U=()=>nr,_e=()=>Nr,Q=()=>Lr;function Ue(r){return gr.add(r),()=>{gr.delete(r)}}function ce(r){let a=r===null?null:ie(r);if((nr&&W(nr))!==(a&&W(a)))Lr++,M.cancelQueries({queryKey:N.all}),M.removeQueries({queryKey:N.all});Nr++,nr=a,gr.forEach((o)=>o())}var Sa=["Curious Kiwi","Cheerful Cherry","Sleepy Peach","Excited Banana","Cosmic Mango","Velvet Lemon","Electric Plum","Wandering Pear","Dramatic Papaya","Suspicious Pineapple","Confused Coconut","Sneaky Tangerine","Gentle Fig","Quiet Apricot","Mellow Melon","Dreamy Guava"];function Kr(r,a){let t=r.filter((o)=>o!==a);return t[Math.floor(Math.random()*t.length)]??r[0]}function Aa(r){return{name:Kr(Sa,r?.name),color:Kr(I,r?.color)}}function ja(r,a){let t=a.name.trim();return{id:r,...t?{name:t}:{},color:a.color}}function Br(){return ja(`local-${crypto.randomUUID().slice(0,8)}`,Aa())}var vr="moi:local-profile",_,E,F=new Set;function wr(r,a){return JSON.stringify(r)===JSON.stringify(a)}function q(r){if(!r||typeof r.id!=="string"||!r.id.trim())throw Error("A user profile needs an id.");if(r.name!==void 0&&typeof r.name!=="string")throw Error("A user profile name must be a string when provided.");if(r.color!==void 0&&!tr(r.color))throw Error("A user profile color must be one of the user palette names.");let a=r.id.trim(),t=r.name?.trim(),o={id:a,...t?{name:t}:{},color:r.color??Qr(a),...r.avatar!==void 0?{avatar:r.avatar}:{},...r.email!==void 0?{email:r.email}:{}};if(!Rr(o))throw Error("Invalid user profile.");return Object.freeze(o)}var ur,Hr;function B(){let r=U();if(r===void 0)return _;if(r!==Hr){Hr=r;let a=!r||r.type==="user"&&r.isAnonymous?void 0:q({id:ir(r),name:r.name||void 0,avatar:r.avatar,email:r.type==="user"?r.email||void 0:void 0});if(!wr(ur,a))ur=a}return ur}function ue(r){let a=B(),t=j(),o=()=>{let c=B(),n=j();if(a===c&&t===n)return;a=c,t=n,r()};F.add(o);let i=Ue(o);return()=>{F.delete(o),i()}}function j(){return U()!==void 0?"external":E}function ct({provider:r,profile:a}){if(j()==="external")return;if(r===void 0){if(E===void 0||E==="local")return;E=void 0,_=void 0}else{let t=a===void 0?void 0:q(a);if(E===r&&wr(_,t))return;E=r,_=t}F.forEach((t)=>t())}function Pa(){try{localStorage.setItem(vr,JSON.stringify(_))}catch{}}function He(r){if(j()!==void 0&&j()!=="local")return;let a=q(r);E="local",_=a,Pa(),F.forEach((t)=>t())}function Vr(r,a){if(!r||!a||a.provider!==void 0||j()!==void 0)return;try{let t=localStorage.getItem(vr);if(t){He(JSON.parse(t));return}}catch{}He(Br())}function Wr(r){if(r.key!==vr||!r.newValue||j()!=="local")return;try{let a=q(JSON.parse(r.newValue));if(wr(a,_))return;_=a,F.forEach((t)=>t())}catch{}}function $r(){return window.addEventListener("storage",Wr),()=>window.removeEventListener("storage",Wr)}function Me(r){if(!ne(r)||!Array.isArray(r.members)||!Array.isArray(r.invitations))throw Error("Invalid workspace members");let a=r.members.map((o)=>{let i=ie(o);if(ne(o)&&o.membershipId!==void 0){if(typeof o.membershipId!=="string"||!o.membershipId||o.membershipId.length>240)throw Error("Invalid membership id");return{...i,membershipId:o.membershipId}}return i}),t=r.invitations.map((o)=>{if(!ne(o)||typeof o.id!=="string"||!o.id||typeof o.email!=="string"||!o.email||typeof o.expiresAt!=="string"||!Number.isFinite(Date.parse(o.expiresAt)))throw Error("Invalid invitation");return{id:o.id,email:o.email,expiresAt:o.expiresAt}});if(new Set(a.map(W)).size!==a.length||new Set(t.map((o)=>o.id)).size!==t.length)throw Error("Duplicate workspace member or invitation");return{members:a,invitations:t}}function ke(r){if(!/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/.test(r))throw Error("Invalid workspace id");return r}M.setQueryDefaults(N.all,{gcTime:1/0});var fr=0,Jr,mr=new Set,Yr=new WeakMap;M.getQueryCache().subscribe((r)=>{if(r.query.queryKey[0]!==N.all[0])return;if(r.type==="removed"||r.type==="updated"&&r.action.type==="success")fr++});var Zr=()=>fr,Xr=new WeakMap;function We(){let r=U();if(Jr!==Q()||r?.type!=="user"||r.isAnonymous)return;let a=Yr.get(r);if(!a)a={members:[r],invitations:[]},Yr.set(r,a);return a}function Gr(r,a){let t=U(),o=N.workspace(t?W(t):void 0,r);ke(r);let i=Me(a);M.cancelQueries({queryKey:o,exact:!0}),M.setQueryData(o,i)}function ra(r){if(!Array.isArray(r))throw Error("Invalid workspace members");let a=r.map((n)=>({id:ke(n.id),data:Me(n)})),t=new Set(a.map((n)=>n.id));if(t.size!==a.length)throw Error("Duplicate workspace id");Jr=Q();let o=U(),i=o?W(o):void 0,c=N.account(i);M.cancelQueries({queryKey:c});for(let n of M.getQueryCache().findAll({queryKey:c}))if(!t.has(n.queryKey[2]))br(n.queryKey);for(let n of a)M.setQueryData(N.workspace(i,n.id),n.data);fr++,mr.forEach((n)=>n())}function aa(r){let a=U(),t=N.workspace(a?W(a):void 0,r);ke(r),M.cancelQueries({queryKey:t,exact:!0}),br(t)}function ta(){M.cancelQueries({queryKey:N.all});for(let r of M.getQueryCache().findAll({queryKey:N.all}))br(r.queryKey)}function br(r){M.setQueryData(r,We()??{members:[],invitations:[]})}function ut(r){let a=U(),t=N.workspace(a?W(a):void 0,r),o=M.getQueryData(t)??We();if(!o)return;let i=Xr.get(o);if(!i)i=o.members.map((c)=>q({id:ir(c),name:c.name||void 0,avatar:c.avatar,email:c.type==="user"?c.email||void 0:void 0})),Xr.set(o,i);return i}function Qe(r){mr.add(r);let a=M.getQueryCache().subscribe((t)=>{if(t.query.queryKey[0]===N.all[0])r()});return()=>{mr.delete(r),a()}}function ea(){if(typeof window>"u")return;let r=window;r.moi??={},r.moi.identity={set:ce,getRevision:_e},r.moi.workspaceMembers={set:Gr,setAll:ra,remove:aa,clear:ta,getRevision:Zr}}ea();$r();async function Oa(r){let[{mount:a},t,o]=await Promise.all([(Y("ep5vh16c"),import("/chunk-ep5vh16c.js")),(Y("vp2qzc0d"),import("/chunk-vp2qzc0d.js")).then((i)=>i.loadAppConfig()),(Y("7rz6g7g7"),import("/chunk-7rz6g7g7.js")).then((i)=>i.loadProxyUser())]);Vr(t?.environment==="local"&&!t.demo,o),a(r)}globalThis.__init=Oa;export{e,x,be,st,Y,Z,A,Be,ze,T,ve,J,Re,we,Ae,Se,Ie,G,Ce,C,Ze,Je,M,N,lt,ne,ie,W,U,_e,Q,Ue,ce,B,ue,j,ct,He,Me,ke,We,ut,Qe};
@@ -1,2 +1,2 @@
1
- async function s(t,e){let o=await t.text();return Error(o||e)}async function p(t,e,o="Request failed"){let n=await fetch(t,e);if(!n.ok)throw await s(n,o);return n.json()}async function N(t,e,o="Request failed"){let n=await fetch(t,e);if(!n.ok)throw await s(n,o)}function v(t,e){return{method:t,headers:{"Content-Type":"application/json"},body:e===void 0?void 0:JSON.stringify(e)}}
2
- export{p,N,v};
1
+ async function s(t,e){let o=await t.text();return Error(o||e)}async function p(t,e,o="Request failed"){let n=await fetch(t,e);if(!n.ok)throw await s(n,o);return n.json()}async function H(t,e,o="Request failed"){let n=await fetch(t,e);if(!n.ok)throw await s(n,o)}function v(t,e){return{method:t,headers:{"Content-Type":"application/json"},body:e===void 0?void 0:JSON.stringify(e)}}
2
+ export{p,H,v};
@@ -0,0 +1 @@
1
+ import{gt}from"/chunk-kdgk4dac.js";export{gt as sanitizeSvg};
@@ -0,0 +1 @@
1
+ import{xt,R}from"/chunk-wz5qv1bn.js";export{xt as loadAppConfig,R as useAppConfig};
@@ -0,0 +1,2 @@
1
+ import{e,x}from"/chunk-s5s1vzdw.js";import{p}from"/chunk-svxhxfeq.js";var t=x(function(a,r){r.exports=globalThis.__esm.react});var f=e(t(),1);var l={environment:"local",collab:!1,demo:!1,demoInstallUrl:"https://moi.computer"},o=l,i=new Set;function s(n){return i.add(n),()=>{i.delete(n)}}async function c(){try{o=await p("/api/config");for(let n of i)n();return o}catch{}}async function xt(){return c()}function R(){return f.useSyncExternalStore(s,()=>o)}
2
+ export{t,xt,R};
package/dist/index.html CHANGED
@@ -55,11 +55,11 @@
55
55
  <link rel="modulepreload" href="/vendor/react/19.2.4/production/react-dom-client.js" />
56
56
  <link rel="modulepreload" href="/vendor/react/19.2.4/production/_impl/react-dom-client.js" />
57
57
 
58
- <link rel="stylesheet" crossorigin href="/chunk-5aj040e5.css"><script type="module" crossorigin src="/chunk-0mjzg20x.js"></script></head>
58
+ <link rel="stylesheet" crossorigin href="/chunk-cekekc3f.css"><script type="module" crossorigin src="/chunk-s5s1vzdw.js"></script></head>
59
59
  <body>
60
60
  <div id="root"></div>
61
61
 
62
- <script type="module">
62
+ <script id="moi-start" type="module">
63
63
  const [react, jsxRuntime, jsxDevRuntime, reactDom, reactDomClient] = await Promise.all([
64
64
  import('react'),
65
65
  import('react/jsx-runtime'),
package/lib/types.ts CHANGED
@@ -512,13 +512,15 @@ export type WorkspaceIcon =
512
512
  | { type: 'glyph'; value: IdentityIconId; background?: 'theme' }
513
513
  | { type: 'upload'; value: string }
514
514
 
515
- // One MCP server's connection status, as surfaced by GET /api/workspaces/:id/mcp
516
- // (a subset of the agent SDK's McpServerStatus — only what the UI renders).
515
+ // One connector's status, as surfaced by GET /api/workspaces/:id/mcp.
516
+ // Includes standalone MCP servers and individual hosted apps.
517
517
  export type McpServerState = 'connected' | 'failed' | 'needs-auth' | 'pending' | 'disabled'
518
518
 
519
519
  export type McpServer = {
520
520
  name: string
521
521
  status: McpServerState
522
+ displayName?: string
523
+ iconUrl?: string
522
524
  }
523
525
 
524
526
  export type WorkspaceEntry = {
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "moi-computer",
3
- "version": "0.12.1-next.4",
3
+ "version": "0.13.1-next.0",
4
4
  "description": "Local AI workspace powered by the Claude Agent SDK, Bun, React, and Tailwind. Requires Bun.",
5
5
  "license": "Elastic-2.0",
6
6
  "type": "module",
7
- "homepage": "https://github.com/molefrog/moi#readme",
7
+ "homepage": "https://github.com/moi-computer/moi#readme",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/molefrog/moi.git"
10
+ "url": "git+https://github.com/moi-computer/moi.git"
11
11
  },
12
12
  "bugs": {
13
- "url": "https://github.com/molefrog/moi/issues"
13
+ "url": "https://github.com/moi-computer/moi/issues"
14
14
  },
15
15
  "keywords": [
16
16
  "ai",
@@ -52,6 +52,7 @@
52
52
  "lint:fix": "oxlint --fix",
53
53
  "registry:validate": "shadcn registry validate",
54
54
  "typecheck": "tsc -p tsconfig.json",
55
+ "test:visual": "bun tests/visual/run.ts",
55
56
  "format": "oxfmt",
56
57
  "format:check": "oxfmt --check",
57
58
  "prepare": "git config core.hooksPath .githooks",
@@ -67,6 +68,7 @@
67
68
  "@modelcontextprotocol/sdk": "^1.29.0",
68
69
  "@tabler/icons-react": "^3.46.0",
69
70
  "@tailwindcss/typography": "^0.5.20",
71
+ "@tanstack/query-core": "5.102.8",
70
72
  "@tanstack/react-query": "^5.102.8",
71
73
  "@tldraw/store": "5.2.3",
72
74
  "@tldraw/tlschema": "5.2.3",
@@ -127,6 +129,7 @@
127
129
  "@types/react-dom": "^19.2.7",
128
130
  "@types/react-grid-layout": "^2.1.0",
129
131
  "@types/react-resizable": "^3.0.8",
132
+ "@uiverify/bun": "1.0.0",
130
133
  "bun": ">=1.4.4",
131
134
  "date-fns": "^4.4.0",
132
135
  "embla-carousel-react": "^8.6.0",
@@ -613,7 +613,32 @@ one.get('/sessions/:sessionId/events', async c => {
613
613
 
614
614
  one.get('/mcp', async c => {
615
615
  const ws = c.get('ws')
616
- return c.json((await harnessFor(ws).mcpStatus?.(ws)) ?? [])
616
+ const harness = harnessFor(ws)
617
+ if (c.req.query('stream') !== 'true') return c.json((await harness.mcpStatus?.(ws)) ?? [])
618
+ let cancelled = false
619
+ const encoder = new TextEncoder()
620
+ return new Response(
621
+ new ReadableStream({
622
+ async start(controller) {
623
+ const emit = (frame: unknown) => {
624
+ if (!cancelled) controller.enqueue(encoder.encode(JSON.stringify(frame) + '\n'))
625
+ }
626
+ try {
627
+ const connectors =
628
+ (await harness.mcpStatus?.(ws, connectors => emit({ connectors }))) ?? []
629
+ emit({ connectors, done: true })
630
+ } catch {
631
+ emit({ error: 'Could not load connectors' })
632
+ } finally {
633
+ if (!cancelled) controller.close()
634
+ }
635
+ },
636
+ cancel() {
637
+ cancelled = true
638
+ }
639
+ }),
640
+ { headers: { 'Content-Type': 'application/x-ndjson', 'Cache-Control': 'no-store' } }
641
+ )
617
642
  })
618
643
 
619
644
  // Harness debug tap for /dev/harness: the backend's native wire frames
@@ -48,7 +48,7 @@ export type CloudflareAccessConfig = {
48
48
 
49
49
  const DEFAULTS: AppConfig = {
50
50
  environment: 'local',
51
- // Temporarily disabled while collaboration is being reconsidered.
51
+ // Experimental; deployments opt in explicitly.
52
52
  collab: false,
53
53
  demo: false,
54
54
  demoInstallUrl: 'https://moi.computer',
@@ -198,6 +198,7 @@ function fileValues(raw: Record<string, unknown>): Partial<AppConfig> {
198
198
  const out: Partial<AppConfig> = {}
199
199
  const environment = parseEnvironment(raw.environment)
200
200
  if (environment !== undefined) out.environment = environment
201
+ if (typeof raw.collab === 'boolean') out.collab = raw.collab
201
202
  if (raw.demo !== undefined) {
202
203
  if (typeof raw.demo === 'boolean') out.demo = raw.demo
203
204
  else warn('ignoring "demo" — expected a boolean')
@@ -225,6 +226,7 @@ export function loadAppConfig(
225
226
  const fromEnv: Partial<AppConfig> = {
226
227
  environment: parseEnvironment(env.MOI_ENVIRONMENT),
227
228
  demo: parseBool(env.MOI_DEMO),
229
+ collab: parseBool(env.MOI_COLLAB),
228
230
  demoInstallUrl: parseString(env.MOI_DEMO_INSTALL_URL)
229
231
  }
230
232
  const merged = { ...DEFAULTS, ...fromFile }
@@ -4,13 +4,11 @@ import { runClaudeAction } from './run-action'
4
4
  import { join } from 'node:path'
5
5
  import { forkSession } from '@anthropic-ai/claude-agent-sdk'
6
6
 
7
- import type { McpServer } from '@/lib/types'
8
-
9
7
  import type { DiscoveredWorkspaceCandidate, Harness } from '../types'
10
8
  import { findHarnessExecutable, pathHarnessAvailability } from '../executable'
11
9
  import { getClaudeAuthReadiness, startClaudeLogin } from './auth'
12
10
  import { isLinkedGitWorktree } from './git-worktree'
13
- import { getMcpStatus } from './mcp'
11
+ import { claudeConnectors, getMcpStatus } from './mcp'
14
12
  import { getClaudeModels, lastProbedClaudeCli, onClaudeCliChanged } from './models'
15
13
  import {
16
14
  SESSION_LIMITS,
@@ -106,9 +104,8 @@ export const claudeCodeHarness: Harness = {
106
104
  getSessionWorkspacePreview(ws.path, includeFirstUserMessage),
107
105
  sessionEvents: (ws, sessionId) => getSessionEvents(sessionId, ws.path),
108
106
  listModels: ws => getClaudeModels(ws.path),
109
- // The SDK's McpServerStatus is a superset of the UI's McpServer (extra
110
- // fields are ignored by the client) — pass it through unchanged.
111
- mcpStatus: async ws => (await getMcpStatus(ws.path)) as unknown as McpServer[],
107
+ // Expose only provider apps and explicitly configured MCP servers.
108
+ mcpStatus: async ws => claudeConnectors(await getMcpStatus(ws.path)),
112
109
  discoverWorkspaces,
113
110
  availability: async ws => {
114
111
  const runtime = await pathHarnessAvailability('claude-code')
@@ -1,5 +1,22 @@
1
1
  import { query } from '@anthropic-ai/claude-agent-sdk'
2
2
  import type { McpServerStatus, SDKUserMessage } from '@anthropic-ai/claude-agent-sdk'
3
+ import type { McpServer } from '@/lib/types'
4
+
5
+ export function claudeConnectors(servers: McpServerStatus[]): McpServer[] {
6
+ const customSources = new Set(['user', 'project', 'local', 'managed', 'enterprise', 'plugin'])
7
+ return servers.flatMap(server => {
8
+ const source = server.source ?? server.scope
9
+ if (source === 'sdk' || source === 'agent' || source === 'dynamic') return []
10
+ const app = source === 'claudeai' || server.config?.type === 'claudeai-proxy'
11
+ if (!app && (!source || !customSources.has(source))) return []
12
+ return [
13
+ {
14
+ name: server.name,
15
+ status: server.status
16
+ }
17
+ ]
18
+ })
19
+ }
3
20
 
4
21
  import { claudeCodeSpawn } from '../../agent-launcher'
5
22
  import { debugEnabled } from '../../debug'
@@ -209,8 +209,15 @@ Before restoring support:
209
209
  is required. The status request omits resource catalogs with `toolsAndAuthOnly`.
210
210
  It targets the workspace's most recently observed loaded chat, since an
211
211
  app-scoped request can return null runtime states.
212
- Full tool definitions are not carried into connector display rows. `codex_apps` branding
213
- uses the dotted tool-name prefix; connector `_meta` is not forwarded.
212
+ Settings list accessible apps from `app/list`, joined with `app/installed` for
213
+ runtime state. Custom MCP servers must have an explicit user, project, or admin
214
+ configuration layer; injected and packaged servers are omitted. Discovery failures
215
+ reach the Settings retry state. Full tool definitions and connector `_meta` are
216
+ not forwarded to display rows.
217
+ Settings request `/mcp?stream=true` for incremental NDJSON snapshots. Codex
218
+ `app/list/updated` notifications and paginated results feed partial rows; only
219
+ the final snapshot marks discovery complete. `app/list` has a 60-second RPC
220
+ deadline while other methods retain the default 30 seconds.
214
221
 
215
222
  ## Diagnostics and maintenance
216
223
 
@@ -2,6 +2,7 @@
2
2
  // threads share the connection. Framing lives in transport.ts; see NOTES.md
3
3
  // for lifecycle, configuration, and wire-type maintenance.
4
4
  import { homedir } from 'node:os'
5
+ import { expandCodexApps } from './connectors'
5
6
 
6
7
  import type { McpServer, Model, SessionSummary, StreamEvent } from '@/lib/types'
7
8
 
@@ -50,7 +51,7 @@ export function getCodexProcessInfo(workspacePath: string): Promise<CodexProcess
50
51
  }
51
52
 
52
53
  export type CodexClient = {
53
- rpc: <T>(method: string, params?: Json) => Promise<T>
54
+ rpc: <T>(method: string, params?: Json, options?: { timeoutMs?: number }) => Promise<T>
54
55
  onNotification: (l: NotificationListener) => () => void
55
56
  isAlive: () => boolean
56
57
  workspacePath: string
@@ -359,7 +360,8 @@ export async function getCodexModels(workspacePath: string): Promise<Model[]> {
359
360
  // Runtime status distinguishes failed/disabled servers from authenticated ones.
360
361
  export async function getCodexMcpStatus(
361
362
  workspacePath: string,
362
- sessionId?: string
363
+ sessionId?: string,
364
+ onProgress?: (connectors: McpServer[]) => void
363
365
  ): Promise<McpServer[]> {
364
366
  try {
365
367
  const client = await getCodexClient(workspacePath)
@@ -371,12 +373,13 @@ export async function getCodexMcpStatus(
371
373
  detail: 'toolsAndAuthOnly',
372
374
  ...(sessionId ? { threadId: sessionId } : {})
373
375
  })
374
- return servers
376
+ const mapped = servers
375
377
  .filter((s): s is { name: string; authStatus?: string } => typeof s.name === 'string')
376
378
  .map(codexMcpServerToServer)
379
+ return await expandCodexApps(client, mapped, sessionId, workspacePath, onProgress)
377
380
  } catch (err) {
378
- console.error('[codex] mcpServerStatus/list failed', err)
379
- return []
381
+ console.error('[codex] connector discovery failed', err)
382
+ throw err
380
383
  }
381
384
  }
382
385
 
@@ -0,0 +1,92 @@
1
+ import type { McpServer } from '@/lib/types'
2
+ import type { CodexClient } from './client'
3
+ import { readCodexPages } from './pagination'
4
+
5
+ type InstalledApp = { id: string; enabled: boolean; callable: boolean }
6
+ type App = {
7
+ id: string
8
+ name: string
9
+ logoUrl: string | null
10
+ isAccessible: boolean
11
+ isEnabled: boolean
12
+ }
13
+ type ConfigLayer = {
14
+ name: { type: string }
15
+ config: { mcp_servers?: Record<string, unknown> }
16
+ disabledReason?: string | null
17
+ }
18
+
19
+ const customSources = new Set([
20
+ 'user',
21
+ 'project',
22
+ 'system',
23
+ 'mdm',
24
+ 'enterpriseManaged',
25
+ 'legacyManagedConfigTomlFromFile',
26
+ 'legacyManagedConfigTomlFromMdm'
27
+ ])
28
+
29
+ export async function expandCodexApps(
30
+ client: Pick<CodexClient, 'rpc'> & Partial<Pick<CodexClient, 'onNotification'>>,
31
+ servers: McpServer[],
32
+ sessionId?: string,
33
+ workspacePath?: string,
34
+ onProgress?: (connectors: McpServer[]) => void
35
+ ): Promise<McpServer[]> {
36
+ const context = sessionId ? { threadId: sessionId } : {}
37
+ const config = await client.rpc<{ layers: ConfigLayer[] | null }>('config/read', {
38
+ cwd: workspacePath,
39
+ includeLayers: true
40
+ })
41
+ // Only explicit configuration belongs in the custom-server list. Runtime-injected
42
+ // and packaged tools have no user/project/admin definition.
43
+ const customNames = new Set(
44
+ (config.layers ?? [])
45
+ .filter(layer => !layer.disabledReason && customSources.has(layer.name.type))
46
+ .flatMap(layer => Object.keys(layer.config.mcp_servers ?? {}))
47
+ )
48
+ const custom = servers.filter(
49
+ server => server.name !== 'codex_apps' && customNames.has(server.name)
50
+ )
51
+ if (!servers.some(server => server.name === 'codex_apps')) return custom
52
+
53
+ onProgress?.(custom)
54
+ const installed = await client.rpc<{ apps: InstalledApp[] }>('app/installed', context)
55
+ const runtime = new Map(installed.apps.map(app => [app.id, app]))
56
+ const toConnectors = (apps: App[]): McpServer[] => [
57
+ ...custom,
58
+ ...apps.map((app): McpServer => {
59
+ const state = runtime.get(app.id)
60
+ return {
61
+ name: `codex_apps/${app.id}`,
62
+ displayName: app.name,
63
+ iconUrl: app.logoUrl ? new URL(app.logoUrl, 'https://chatgpt.com').href : undefined,
64
+ status: !(state?.enabled ?? app.isEnabled)
65
+ ? 'disabled'
66
+ : state?.callable
67
+ ? 'connected'
68
+ : 'pending'
69
+ }
70
+ })
71
+ ]
72
+ const progressApps = new Map<string, App>()
73
+ const publish = (apps: App[]) => {
74
+ for (const app of apps) if (app.isAccessible) progressApps.set(app.id, app)
75
+ onProgress?.(toConnectors([...progressApps.values()]))
76
+ }
77
+ const unsubscribe = client.onNotification?.((method, params) => {
78
+ if (method !== 'app/list/updated' || !Array.isArray(params.data)) return
79
+ publish(params.data as App[])
80
+ })
81
+ try {
82
+ const apps = await readCodexPages<App>(
83
+ client,
84
+ 'app/list',
85
+ { ...context, limit: 100 },
86
+ { timeoutMs: 60_000, onPage: publish }
87
+ )
88
+ return toConnectors(apps.filter(app => app.isAccessible))
89
+ } finally {
90
+ unsubscribe?.()
91
+ }
92
+ }
@@ -81,7 +81,8 @@ export const codexHarness: Harness = {
81
81
  }
82
82
  },
83
83
  listModels: ws => getCodexModels(ws.path),
84
- mcpStatus: ws => getCodexMcpStatus(ws.path, getLatestCodexSessionId(ws.id)),
84
+ mcpStatus: (ws, onProgress) =>
85
+ getCodexMcpStatus(ws.path, getLatestCodexSessionId(ws.id), onProgress),
85
86
  discoverWorkspaces: registeredPaths => discoverCodexWorkspaces(registeredPaths),
86
87
  availability: async ws => {
87
88
  const runtime = await pathHarnessAvailability('codex')
@@ -5,17 +5,20 @@ import type { CodexClient } from './client'
5
5
  export async function readCodexPages<T>(
6
6
  client: Pick<CodexClient, 'rpc'>,
7
7
  method: string,
8
- params: Record<string, unknown> = {}
8
+ params: Record<string, unknown> = {},
9
+ options?: { timeoutMs?: number; onPage?: (rows: T[]) => void }
9
10
  ): Promise<T[]> {
10
11
  const rows: T[] = []
11
12
  const cursors = new Set<string>()
12
13
  let cursor: string | undefined
13
14
  do {
14
- const page = await client.rpc<{ data?: T[]; nextCursor?: string | null }>(method, {
15
- ...params,
16
- ...(cursor ? { cursor } : {})
17
- })
15
+ const page = await client.rpc<{ data?: T[]; nextCursor?: string | null }>(
16
+ method,
17
+ { ...params, ...(cursor ? { cursor } : {}) },
18
+ options?.timeoutMs === undefined ? undefined : { timeoutMs: options.timeoutMs }
19
+ )
18
20
  rows.push(...(page.data ?? []))
21
+ options?.onPage?.(page.data ?? [])
19
22
  cursor = page.nextCursor || undefined
20
23
  if (cursor && cursors.has(cursor)) throw new Error(`Codex ${method} repeated a page cursor`)
21
24
  if (cursor) cursors.add(cursor)
@@ -17,7 +17,7 @@ export class CodexRpcError extends Error {
17
17
  }
18
18
 
19
19
  export type CodexTransport = {
20
- rpc: <T>(method: string, params?: Json) => Promise<T>
20
+ rpc: <T>(method: string, params?: Json, options?: { timeoutMs?: number }) => Promise<T>
21
21
  notify: (method: string, params?: Json) => void
22
22
  onNotification: (listener: NotificationListener) => () => void
23
23
  isAlive: () => boolean
@@ -92,14 +92,21 @@ export function createCodexTransport(options: TransportOptions): CodexTransport
92
92
  }
93
93
  }
94
94
 
95
- function rpc<T>(method: string, params: Json = {}): Promise<T> {
95
+ function rpc<T>(
96
+ method: string,
97
+ params: Json = {},
98
+ requestOptions?: { timeoutMs?: number }
99
+ ): Promise<T> {
96
100
  if (!alive) return Promise.reject(new Error('ChatGPT app-server is not running'))
97
101
  const id = nextId++
98
102
  return new Promise<T>((resolve, reject) => {
99
- const timer = setTimeout(() => {
100
- pending.delete(id)
101
- reject(new Error(`ChatGPT request timed out: ${method}`))
102
- }, options.timeoutMs ?? 30_000)
103
+ const timer = setTimeout(
104
+ () => {
105
+ pending.delete(id)
106
+ reject(new Error(`ChatGPT request timed out: ${method}`))
107
+ },
108
+ requestOptions?.timeoutMs ?? options.timeoutMs ?? 30_000
109
+ )
103
110
  // Register before writing: a synchronous response must find its waiter.
104
111
  pending.set(id, { resolve: resolve as (value: unknown) => void, reject, timer })
105
112
  send({ jsonrpc: '2.0', id, method, params })
@@ -136,7 +136,10 @@ export type Harness = {
136
136
  sessionEvents(ws: WorkspaceEntry, sessionId: string): Promise<StreamEvent[]>
137
137
  listModels(ws: WorkspaceEntry): Promise<Model[]>
138
138
  // MCP server status for the connectors UI; absent = backend has no MCP story.
139
- mcpStatus?(ws: WorkspaceEntry): Promise<McpServer[]>
139
+ mcpStatus?(
140
+ ws: WorkspaceEntry,
141
+ onProgress?: (connectors: McpServer[]) => void
142
+ ): Promise<McpServer[]>
140
143
  // Workspaces this backend knows about that aren't registered yet.
141
144
  discoverWorkspaces?(registeredPaths: Set<string>): Promise<DiscoveredWorkspaceCandidate[]>
142
145
  // Without a workspace, only check whether the runtime is installed. With a
@@ -35,12 +35,12 @@ Use sentence case for workspace, view, and widget names, preserving proper nouns
35
35
 
36
36
  ### Views and widgets
37
37
 
38
- Include exactly three full-page views, each with its own tab and build chat, and optionally up to four focused Overview widgets. For each, provide:
38
+ Include exactly three full-page views, each with its own tab and build chat, and two to four focused Overview widgets. For each, provide:
39
39
 
40
40
  - A sentence-case name.
41
41
  - For views, a relevant built-in Moi icon ID. The workspace and view icons within each option must all be different.
42
42
  - A short description of its purpose and content.
43
- - Only the features needed for one small, complete workflow. Aim for two or three focused features per view, covering its main action, needed data, and saved state. For widgets, include the main action or link to a view where useful.
43
+ - Only the features needed for one small, complete workflow. Aim for two or three focused features per view, covering its main action, needed data, and saved state. Each widget must show live information or let people act in place; never plan one that only links to a view.
44
44
 
45
45
  Keep each plan small and ready to build. Include useful source references and access limitations in the features, without private transcripts or secrets. Do not promise integrations you haven't verified.
46
46