@rizom/brain 0.2.0-alpha.827 → 0.2.0-alpha.829

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 (57) hide show
  1. package/dist/brain.js +47 -47
  2. package/dist/chunks/{app-0s6jdkd5.js → app-shz82apb.js} +2 -2
  3. package/dist/chunks/{index-c0c63tnw.js → index-9yytew70.js} +2 -2
  4. package/dist/chunks/{index-0yb7rsks.js → index-qzhjcjg5.js} +3 -3
  5. package/dist/chunks/{index-0yb7rsks.js.map → index-qzhjcjg5.js.map} +1 -1
  6. package/dist/chunks/{package-zhrskdvp.js → package-p222jg1b.js} +3 -3
  7. package/dist/chunks/{package-zhrskdvp.js.map → package-p222jg1b.js.map} +1 -1
  8. package/dist/model.js +46 -46
  9. package/dist/model.js.map +6 -6
  10. package/dist/testing.js +1 -1
  11. package/dist/ui/dashboard.js +23 -23
  12. package/dist/ui/guest.js +24 -24
  13. package/dist/ui/{studio-app-4sh6fhd2.js → studio-app-9va3ejnz.js} +89 -89
  14. package/dist/ui/{studio-app-4sh6fhd2.js.map → studio-app-9va3ejnz.js.map} +3 -3
  15. package/dist/ui/{studio-app-71322f564d8bbb203ad19ee0b474e8cf32371188e4be3ca2a7fa55ab0ef1c263.css → studio-app-d25cb6eb3069c969c883593ddf79770cdf9c7d3db9e1332920ca43099cf12a98.css} +76 -18
  16. package/dist/ui/studio-asset-manifest.json +39 -39
  17. package/dist/ui/studio-chunks/{account-view-1yjj4wnz.js → account-view-cvprn705.js} +2 -2
  18. package/dist/ui/studio-chunks/{account-view-1yjj4wnz.js.map → account-view-cvprn705.js.map} +1 -1
  19. package/dist/ui/studio-chunks/{chat-7mpjprjt.js → chat-9211209g.js} +2 -2
  20. package/dist/ui/studio-chunks/{chat-7mpjprjt.js.map → chat-9211209g.js.map} +1 -1
  21. package/dist/ui/studio-chunks/{highlighted-body-OFNGDK62-7g0x8zaz.js → highlighted-body-OFNGDK62-xxa1j3w4.js} +2 -2
  22. package/dist/ui/studio-chunks/{highlighted-body-OFNGDK62-7g0x8zaz.js.map → highlighted-body-OFNGDK62-xxa1j3w4.js.map} +1 -1
  23. package/dist/ui/studio-chunks/{main-ykhhz1dv.js → main-58mcmvrd.js} +3 -3
  24. package/dist/ui/studio-chunks/{main-ykhhz1dv.js.map → main-58mcmvrd.js.map} +1 -1
  25. package/dist/ui/studio-chunks/main-6e8fr481.js +4 -0
  26. package/dist/ui/studio-chunks/{main-9v0jde66.js.map → main-6e8fr481.js.map} +10 -8
  27. package/dist/ui/studio-chunks/{main-eh7nyakc.js → main-7pzrevcx.js} +3 -3
  28. package/dist/ui/studio-chunks/{main-eh7nyakc.js.map → main-7pzrevcx.js.map} +1 -1
  29. package/dist/ui/studio-chunks/{main-d2zzd603.js → main-a0bqvrke.js} +5 -5
  30. package/dist/ui/studio-chunks/{main-d2zzd603.js.map → main-a0bqvrke.js.map} +1 -1
  31. package/dist/ui/studio-chunks/{main-15a2cggv.js → main-m4w9yc1d.js} +2 -2
  32. package/dist/ui/studio-chunks/{main-15a2cggv.js.map → main-m4w9yc1d.js.map} +1 -1
  33. package/dist/ui/studio-chunks/{main-jygp4w4c.js → main-ph9ny1pw.js} +3 -3
  34. package/dist/ui/studio-chunks/{main-jygp4w4c.js.map → main-ph9ny1pw.js.map} +1 -1
  35. package/dist/ui/studio-chunks/{main-7awmjjcm.js → main-pns7z40c.js} +2 -2
  36. package/dist/ui/studio-chunks/{main-7awmjjcm.js.map → main-pns7z40c.js.map} +1 -1
  37. package/dist/ui/studio-chunks/{main-6nm0n4v1.js → main-sev4xarv.js} +3 -3
  38. package/dist/ui/studio-chunks/{main-6nm0n4v1.js.map → main-sev4xarv.js.map} +1 -1
  39. package/dist/ui/studio-chunks/{main-eqd1vphg.js → main-t1xn9zx1.js} +3 -3
  40. package/dist/ui/studio-chunks/{main-eqd1vphg.js.map → main-t1xn9zx1.js.map} +1 -1
  41. package/dist/ui/studio-chunks/{main-kt2bxy2m.js → main-w46t7s4p.js} +4 -4
  42. package/dist/ui/studio-chunks/{main-kt2bxy2m.js.map → main-w46t7s4p.js.map} +3 -3
  43. package/dist/ui/studio-chunks/{main-vrqd9bsz.js → main-zf98b634.js} +3 -3
  44. package/dist/ui/studio-chunks/{main-vrqd9bsz.js.map → main-zf98b634.js.map} +1 -1
  45. package/dist/ui/studio-chunks/mermaid-GHXKKRXX-9hf8qx6r.js +3 -0
  46. package/dist/ui/studio-chunks/mermaid-GHXKKRXX-9hf8qx6r.js.map +9 -0
  47. package/dist/ui/studio-chunks/{studio-ask-panel-qyrt1xnn.js → studio-ask-panel-41kaf4cp.js} +2 -2
  48. package/dist/ui/studio-chunks/{studio-ask-panel-qyrt1xnn.js.map → studio-ask-panel-41kaf4cp.js.map} +1 -1
  49. package/dist/ui/studio-chunks/studio-chat-workspace-ky67yatx.js +3 -0
  50. package/dist/ui/studio-chunks/{studio-chat-workspace-ff60f8b9.js.map → studio-chat-workspace-ky67yatx.js.map} +2 -2
  51. package/package.json +1 -1
  52. package/dist/ui/studio-chunks/main-9v0jde66.js +0 -4
  53. package/dist/ui/studio-chunks/mermaid-GHXKKRXX-0knk6c55.js +0 -3
  54. package/dist/ui/studio-chunks/mermaid-GHXKKRXX-0knk6c55.js.map +0 -9
  55. package/dist/ui/studio-chunks/studio-chat-workspace-ff60f8b9.js +0 -3
  56. /package/dist/chunks/{app-0s6jdkd5.js.map → app-shz82apb.js.map} +0 -0
  57. /package/dist/chunks/{index-c0c63tnw.js.map → index-9yytew70.js.map} +0 -0
@@ -1,3 +1,3 @@
1
- import{Mb as c,Nb as o,Ob as d,Qb as me,Rb as $e,Sb as Me,Tb as Le,Ub as ve,Wb as we}from"./main-vrqd9bsz.js";import{Zb as Ve,bc as ze,cc as Je}from"./main-jygp4w4c.js";import{Kc as ke,Pc as X,Qc as A,Rc as je,Wc as H,Xc as F,gc as x,ic as y,jc as J,mc as te,nd as Ce,sc as He,uc as Ke,vc as Ye,vd as qe,wc as M,wd as ee,xc as L}from"./main-kt2bxy2m.js";import{Xd as i}from"./main-ykhhz1dv.js";import{hf as ne}from"./main-eqd1vphg.js";import{Pf as b}from"./main-15a2cggv.js";var K=b(ne(),1);var We=i.object({displayName:i.string(),role:i.enum(["admin","trusted","public"]),profileEntityId:i.string().optional(),passkeys:i.array(i.object({id:i.string(),transports:i.array(i.string()).optional(),credentialDeviceType:i.string().optional(),credentialBackedUp:i.boolean(),createdAt:i.number(),updatedAt:i.number()})),appPasswords:i.array(i.object({id:i.string(),username:i.string(),label:i.string(),access:i.enum(["read","write"]),createdAt:i.number(),expiresAt:i.number(),lastUsedAt:i.number().optional()})),connectedChannels:i.array(i.object({type:i.string(),label:i.string(),verifiedAt:i.number()})),pluginSettings:i.array(i.object({id:i.string(),title:i.string(),description:i.string().optional(),configured:i.boolean(),revision:i.number().nullable(),fields:i.array(i.object({name:i.string(),label:i.string(),control:i.enum(["text","url","number","checkbox"]),secret:i.boolean(),required:i.boolean(),value:i.union([i.string(),i.number(),i.boolean(),i.null()]).optional(),set:i.boolean().optional()}))})),sessions:i.array(i.object({id:i.string(),current:i.boolean(),createdAt:i.number(),expiresAt:i.number()}))});function Ge(e){return We.safeParse(e).success}var ge=i.custom(Ge,{message:"Invalid account response"}),ie=i.object({account:ge}),Ze=i.object({account:ge.optional(),appPassword:i.object({username:i.string(),password:i.string()}).optional(),revoked:i.object({sessions:i.number(),refreshTokens:i.number().optional()}).optional(),signedOut:i.boolean().optional()});function Qe(e){return Ze.safeParse(e).success}var Xe=i.custom(Qe,{message:"Invalid account mutation response"}),et=i.custom((e)=>{if(!X(e))return!1;return typeof e.challenge==="string"&&X(e.rp)&&X(e.user)&&Array.isArray(e.pubKeyCredParams)},{message:"Invalid passkey registration options"});class he extends Error{status;constructor(e,t){super(e);this.name="AccountApiError",this.status=t}}async function V(e,t){let n;try{n=await e.json()}catch{n={}}if(!e.ok){let a=typeof n==="object"&&n!==null&&"error"in n&&typeof n.error==="string"?n.error:"Account request failed";throw new he(a,e.status)}return t.parse(n)}function se(e){let t=e.replaceAll("-","+").replaceAll("_","/").padEnd(Math.ceil(e.length/4)*4,"=");return Uint8Array.from(atob(t),(n)=>n.charCodeAt(0)).buffer}function re(e){let t=new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return btoa(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function tt(e){return{challenge:se(e.challenge),rp:e.rp,user:{...e.user,id:se(e.user.id)},pubKeyCredParams:e.pubKeyCredParams,...e.timeout!==void 0?{timeout:e.timeout}:{},...e.excludeCredentials?{excludeCredentials:e.excludeCredentials.map((t)=>({...t,id:se(t.id)}))}:{},...e.authenticatorSelection?{authenticatorSelection:e.authenticatorSelection}:{},...e.attestation?{attestation:e.attestation}:{},...e.extensions?{extensions:e.extensions}:{}}}var nt=(e,t)=>fetch(e,t);class ce{fetchFn;constructor(e={}){this.fetchFn=e.fetch??nt}async fetchAccount(){return(await V(await this.fetchFn("/auth/account",{credentials:"same-origin",cache:"no-store"}),ie)).account}async mutatePluginSettings(e){return(await V(await this.fetchFn("/auth/account/plugin-settings",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ie)).account}async mutateAccount(e){return V(await this.fetchFn("/auth/account/mutations",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xe)}async registerPasskey(){let e=await V(await this.fetchFn("/auth/account/passkeys/options",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}"}),et),t=await navigator.credentials.create({publicKey:tt(e)});if(!(t instanceof PublicKeyCredential))throw Error("Passkey registration was cancelled");if(!(t.response instanceof AuthenticatorAttestationResponse))throw Error("Authenticator returned an invalid passkey response");let n=t.response,a={id:t.id,rawId:re(t.rawId),type:t.type,...t.authenticatorAttachment?{authenticatorAttachment:t.authenticatorAttachment}:{},clientExtensionResults:t.getClientExtensionResults(),response:{clientDataJSON:re(n.clientDataJSON),attestationObject:re(n.attestationObject),transports:typeof n.getTransports==="function"?n.getTransports():[]}};return(await V(await this.fetchFn("/auth/account/passkeys/verify",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),ie.extend({verified:i.literal(!0)}))).account}}function ye(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map((t)=>t.slice(0,1).toUpperCase()).join("")}function Ae(e,t){let n=t.indexOf("/");if(n<=0||n===t.length-1)return;let a=t.slice(0,n),s=t.slice(n+1);return`${e==="/"?"":e.replace(/\/+$/,"")}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`}function j(e,t=!1){return new Date(t?e:e*1000).toISOString()}var R=b(x(),1);function z(e){return R.jsxDEV(y,{variant:e.tone==="danger"?"danger":e.tone==="primary"?"primary":"outline",type:e.type??"button",onClick:e.onClick,disabled:e.disabled,children:e.children},void 0,!1,void 0,this)}function U(e){return R.jsxDEV("div",{className:o("account-access-item",c.access),children:[R.jsxDEV(ve,{density:"comfortable",title:e.kind,description:e.description,metadata:e.metadata??[]},void 0,!1,void 0,this),e.action]},void 0,!0,void 0,this)}function C(e){return R.jsxDEV("section",{className:o("account-detail-section",c.section),children:[R.jsxDEV("div",{className:"account-section-label",children:[R.jsxDEV("h3",{className:o("",c.heading,ee.section,e.titleHidden===!0&&c.headingHidden),children:e.title},void 0,!1,void 0,this),e.description?R.jsxDEV("p",{className:o("",c.description),children:e.description},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),R.jsxDEV("div",{className:o("people-stack",c.stack),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function be(e,t){let n=Object.fromEntries(t.entries());for(let a of e)if(a.control==="checkbox")n[a.name]=t.has(a.name);else if(a.control==="number"&&typeof n[a.name]==="string"&&n[a.name]!=="")n[a.name]=Number(n[a.name]);return n}function Se(e){if(e.secret)return"password";if(e.control==="url"||e.control==="number")return e.control;return"text"}var r=b(x(),1);function Ne(e){let{account:t,actions:n,title:a,studioPath:s}=e,g=t.role,h=t.profileEntityId?Ae(s,t.profileEntityId):void 0;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV(C,{title:"Profile",titleHidden:!0,children:[r.jsxDEV("div",{className:o("account-identity",c.identity),children:r.jsxDEV("div",{className:o("people-detail-person",c.person),children:[r.jsxDEV("span",{className:o("people-avatar people-avatar--large",c.avatar),children:ye(a)},void 0,!1,void 0,this),r.jsxDEV("span",{className:o("",c.personCopy),children:[r.jsxDEV("span",{className:o("people-detail-name",c.name,ee.secondaryDisplay),children:a},void 0,!1,void 0,this),r.jsxDEV("span",{"data-account-role":g,className:o("account-role",c.role),children:ke(g)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),t.profileEntityId?r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("account-profile-note",c.description),children:"Managed by the Anchor profile — your account name follows the published profile."},void 0,!1,void 0,this),r.jsxDEV(U,{kind:"Anchor profile",description:a,action:h?r.jsxDEV(y,{asChild:!0,variant:"link",children:r.jsxDEV("a",{href:h,children:"Edit Anchor Profile →"},void 0,!1,void 0,this)},void 0,!1,void 0,this):void 0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(O)=>{O.preventDefault(),n.saveName()},children:[r.jsxDEV("label",{className:o("",c.formLabel),htmlFor:"display-name",children:"Display name"},void 0,!1,void 0,this),r.jsxDEV(J,{id:"display-name",maxLength:200,autoComplete:"name",required:!0,value:n.displayName,onChange:(O)=>n.setDisplayName(O.target.value)},void 0,!1,void 0,this),r.jsxDEV(z,{type:"submit",disabled:n.busy,children:"Save name"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV("p",{className:o("",c.description),children:"Your role controls access to this brain. An administrator manages access in Administration."},void 0,!1,void 0,this),g==="admin"&&r.jsxDEV(y,{asChild:!0,variant:"outline",children:r.jsxDEV("a",{href:Ce(s,"admin:administration"),children:"Manage people in Administration →"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Te(e){let t=e.account.connectedChannels;return r.jsxDEV(C,{title:"Linked identities",titleHidden:!0,description:"How this brain recognizes messages from you. These are your identities, not services configured for the whole brain.",children:t.length===0?r.jsxDEV("p",{className:o("people-empty",c.empty),children:"No linked identities."},void 0,!1,void 0,this):t.map((n)=>r.jsxDEV(U,{kind:n.type,description:n.label,metadata:[`Verified: ${j(n.verifiedAt,!0)}`]},`${n.type}:${n.label}`,!1,void 0,this))},void 0,!1,void 0,this)}function Pe(e){let{account:t,actions:n}=e;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("",c.description),children:"Settings for your account only. These do not configure shared services for the brain."},void 0,!1,void 0,this),t.pluginSettings.map((a)=>r.jsxDEV(we,{label:a.title,density:"comfortable",presentation:"disclosure",children:[r.jsxDEV("p",{className:o("account-settings-description",c.description),children:a.description??"Private settings for this account."},void 0,!1,void 0,this),r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(s)=>{s.preventDefault(),n.saveSettings(a,new FormData(s.currentTarget))},children:[a.fields.map((s)=>r.jsxDEV("label",{htmlFor:`setting-${a.id}-${s.name}`,className:o("",c.field),children:[r.jsxDEV("span",{className:o("",c.formLabel),children:s.label},void 0,!1,void 0,this),s.control==="checkbox"?r.jsxDEV(te,{id:`setting-${a.id}-${s.name}`,name:s.name,defaultChecked:s.value===!0},void 0,!1,void 0,this):r.jsxDEV(J,{id:`setting-${a.id}-${s.name}`,name:s.name,type:Se(s),required:s.required&&(!a.configured||s.secret)&&!s.set,defaultValue:s.secret?"":typeof s.value==="string"||typeof s.value==="number"?s.value:"",placeholder:s.secret&&s.set?"Stored — leave blank to keep":void 0,autoComplete:"off"},void 0,!1,void 0,this)]},s.name,!0,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:[r.jsxDEV(z,{type:"submit",tone:"primary",disabled:n.busy,children:"Save settings"},void 0,!1,void 0,this),a.configured?r.jsxDEV(y,{variant:"danger",disabled:n.busy,type:"button",onClick:()=>n.removeSettings(a),children:"Remove"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},`${a.id}:${a.revision??"unset"}`,!0,void 0,this)]},a.id,!0,void 0,this))]},void 0,!0,void 0,this)}function xe(e){let{account:t,actions:n}=e,{busy:a}=n;return r.jsxDEV("div",{className:o("",c.column),children:[r.jsxDEV(C,{title:"Sign-in",description:"Passkeys used to access this account. Your final passkey is protected from revocation.",children:[t.passkeys.map((s)=>r.jsxDEV(U,{kind:s.credentialBackedUp?"Synced passkey":"Device passkey",metadata:[`Added: ${j(s.createdAt,!0)}`],action:t.passkeys.length>1?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokePasskey(s.id),children:"Revoke"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:r.jsxDEV(y,{variant:"outline",disabled:a,type:"button",onClick:n.addPasskey,children:"Add passkey"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV(C,{title:"Signed-in sessions",children:t.sessions.map((s)=>r.jsxDEV(U,{kind:s.current?"This session":"Browser session",metadata:[`Started: ${j(s.createdAt)}`,...s.current?["Current browser"]:[]],action:!s.current?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokeSession(s.id),children:"End"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this))},void 0,!1,void 0,this),r.jsxDEV("footer",{className:o("account-session-actions",c.footer),children:[r.jsxDEV("small",{children:"Access changes require an Admin."},void 0,!1,void 0,this),r.jsxDEV("div",{className:o("",c.actions),children:[r.jsxDEV(z,{disabled:a||t.sessions.every((s)=>s.current),onClick:n.revokeOtherSessions,children:"End other sessions"},void 0,!1,void 0,this),r.jsxDEV(z,{tone:"danger",disabled:a,onClick:n.revokeAllSessions,children:"Sign out everywhere"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ee=b(ne(),1);function de(e){return new URL(e).host.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function le(e){return JSON.stringify(e,null,2)}function Oe(e,t,n){return["Already have servers there? Add only the ",{code:`"${n}"`}," entry inside ",{code:`"${t}"`},` of ${e}.`]}function Re(e){let t=de(e),n="Sign in with your passkey when asked.";return[{id:"claude",group:"primary",name:"Claude",note:["Desktop app and claude.ai."],steps:[["Open Settings → Connectors → Add custom connector."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when asked."]]},{id:"chatgpt",group:"primary",name:"ChatGPT",steps:[["Open Settings → Apps & Connectors → Advanced and turn on Developer mode."],["Choose Create, name it ",{code:t},", paste your brain’s address and pick OAuth."],["Sign in with your passkey when asked."]]},{id:"claude-code",group:"developer",name:"Claude Code",lead:[["Add the server in your terminal:"]],snippet:{label:"Claude Code command",code:`claude mcp add --transport http ${t} ${e}`},after:[["Then start Claude Code, run ",{code:"/mcp"},", choose ",{code:t}," and sign in with your passkey."]]},{id:"cursor",group:"developer",name:"Cursor",steps:[["Open Cursor Settings → MCP → Add new global MCP server."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when Cursor asks."]],lead:[["Or add it to ",{code:"~/.cursor/mcp.json"},":"]],snippet:{label:"Cursor configuration",code:le({mcpServers:{[t]:{url:e}}})},after:[Oe("the file","mcpServers",t)]},{id:"vscode",group:"developer",name:"VS Code",steps:[["Open the Command Palette and run ",{code:"MCP: Add Server"},"."],["Choose HTTP, paste your brain’s address and name it ",{code:t},"."],["Choose Global, then sign in with your passkey when asked."]],lead:[["Or run ",{code:"MCP: Open User Configuration"}," and add:"]],snippet:{label:"VS Code configuration",code:le({servers:{[t]:{type:"http",url:e}}})},after:[Oe("your user configuration","servers",t)]},{id:"other",group:"developer",name:"Any other MCP client",inlineName:"any other MCP client",note:["Look for “add MCP server”, “connector” or “integration” in the tool’s settings and fill in:"],fields:[{label:"Name",value:[{code:t}]},{label:"Type",value:["Remote server, Streamable HTTP — not stdio, not SSE"]},{label:"URL",value:[{code:e}]},{label:"Authentication",value:["OAuth. Leave API key, token, client ID and secret empty; the tool registers itself."]}],lead:[["When you connect, your browser opens “Authorize <tool>?” on your brain. Approve MCP access with your passkey. The tool then has two tools: ",{code:"chat"},", to ask your brain anything as you would in chat, and ",{code:"confirm"},", to approve changes when the brain asks."],["Tool only takes local (stdio) servers, or insists on an API key? Bridge it with ",{code:"mcp-remote"},", which handles the sign-in:"]],snippet:{label:"mcp-remote bridge configuration",code:le({mcpServers:{[t]:{command:"npx",args:["-y","mcp-remote",e]}}})}}]}var u=b(x(),1);function W(e){return u.jsxDEV(u.Fragment,{children:e.text.map((t,n)=>typeof t==="string"?t:u.jsxDEV("code",{className:o("",d.code),children:t.code},n,!1,void 0,this))},void 0,!1,void 0,this)}function _(e){let[t,n]=Ee.useState("idle"),a=async()=>{try{await navigator.clipboard.writeText(e.code),n("copied")}catch{n("unavailable")}};return u.jsxDEV("div",{className:o("ai-tools-snippet",d.snippet),children:[u.jsxDEV("pre",{className:o("",d.snippetCode),"aria-label":e.label,children:e.code},void 0,!1,void 0,this),u.jsxDEV(y,{variant:"outline",size:"sm",onClick:()=>void a(),"aria-label":`Copy ${e.label}`,children:t==="copied"?"Copied":t==="unavailable"?"Select to copy":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function G(e){let{client:t}=e;return u.jsxDEV("article",{className:o("ai-tools-client",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:t.name},void 0,!1,void 0,this),t.note?u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:t.note},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,t.steps?u.jsxDEV("ol",{className:o("",d.steps),children:t.steps.map((n,a)=>u.jsxDEV("li",{children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},a,!1,void 0,this))},void 0,!1,void 0,this):null,t.fields?u.jsxDEV("dl",{className:o("",d.fields),children:t.fields.map((n)=>u.jsxDEV("div",{className:o("",d.field),children:[u.jsxDEV("dt",{className:o("",d.fieldLabel),children:n.label},void 0,!1,void 0,this),u.jsxDEV("dd",{className:o("",d.fieldValue),children:u.jsxDEV(W,{text:n.value},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},n.label,!0,void 0,this))},void 0,!1,void 0,this):null,t.lead?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`lead-${a}`,!1,void 0,this)),t.snippet?u.jsxDEV(_,{...t.snippet},void 0,!1,void 0,this):null,t.after?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`after-${a}`,!1,void 0,this))]},void 0,!0,void 0,this)}function ot(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function De(e){let t=Re(e.mcpUrl),n=t.filter((s)=>s.group==="primary"),a=t.filter((s)=>s.group==="developer");return u.jsxDEV(C,{title:"AI tools",description:"Connect AI tools you already use to this brain. A connected tool talks to the brain as you do in chat — asking, saving and updating within your access — after you sign in with your passkey.",children:[u.jsxDEV("article",{className:o("ai-tools-address",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s address"},void 0,!1,void 0,this),u.jsxDEV(_,{label:"brain address",code:e.mcpUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients),children:n.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this),u.jsxDEV("details",{className:o("ai-tools-developer",d.developer),children:[u.jsxDEV("summary",{className:o("",d.developerSummary),children:["Developer tools and other clients",u.jsxDEV("span",{className:o("",d.developerHint),children:ot(a.map((s)=>s.inlineName??s.name))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients,d.developerClients),children:a.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Z=b(ne(),1);var ue="Enter the username and password of an app password from this page.";function Ie(e){let t=new URL(e),n=`${t.protocol==="https:"?"davs":"dav"}://${t.host}${t.pathname}`,a=de(e);return[{id:"macos",group:"file-manager",name:"macOS",note:["Finder, on any Mac."],steps:[["In Finder, choose Go → Connect to Server (⌘K)."],["Paste the address below and click Connect."],["Choose Registered User. ",ue]],snippet:{label:"macOS address",code:e}},{id:"windows",group:"file-manager",name:"Windows",note:["File Explorer, on Windows 10 and 11."],steps:[["In File Explorer, open This PC and choose Map network drive."],["Paste the address below as the folder, tick Connect using different credentials, and click Finish."],[ue]],snippet:{label:"Windows address",code:e}},{id:"gnome-files",group:"file-manager",name:"GNOME Files",note:["The file manager on Ubuntu, Fedora and other GNOME desktops."],steps:[["Open Files → Other Locations (or Network)."],["Under Connect to Server, enter the address below and connect."],[ue]],snippet:{label:"GNOME Files address",code:n}},{id:"rclone",group:"command-line",name:"rclone",note:["Linux, macOS and Windows, from a terminal."],lead:[["Store the drive as a remote, with your app password’s username and password:"]],snippet:{label:"rclone remote command",code:`rclone config create ${a} webdav url=${e} vendor=other user=YOUR_USERNAME pass=YOUR_PASSWORD --obscure`},after:[["Then mount it on an empty folder: ",{code:`rclone mount ${a}: ~/Brain --vfs-cache-mode writes`},"."]]}]}var l=b(x(),1),oe="app-password-label",Ue="app-password-write";function pe(e){return j(e).slice(0,10)}function at(e,t){return[`Created: ${pe(e.createdAt)}`,`${e.expiresAt<=t?"Expired":"Expires"}: ${pe(e.expiresAt)}`,e.lastUsedAt===void 0?"Never used":`Last used: ${pe(e.lastUsedAt)}`]}function Fe(e){let{account:t,actions:n,connect:a}=e,{busy:s,createdAppPassword:g}=n,[h,O]=Z.useState(void 0),v=a!==void 0&&h!==void 0?$e(g,h,t.appPasswords,me(a)):null;Z.useEffect(()=>{if(a&&v)Me(a,v)},[a,v]);let N=Math.floor(Date.now()/1000),[T,S]=Z.useState(!1),D=Ie(e.davUrl),I=D.filter((f)=>f.group==="file-manager"),E=D.filter((f)=>f.group==="command-line");return l.jsxDEV("div",{className:o("",c.column),children:[l.jsxDEV(C,{title:"Drive",description:"Mount this brain as a network drive. It shows the notes, posts and files you can see here, as folders and files, to open and edit on your computer.",children:[a?l.jsxDEV(Le,{connect:a,created:v,busy:s||h!==void 0&&v===null,onConnect:()=>{O(g?.username??null),n.createAppPassword(me(a),"write")}},void 0,!1,void 0,this):null,l.jsxDEV("article",{className:o("drive-address",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s drive address"},void 0,!1,void 0,this),l.jsxDEV(_,{label:"drive address",code:e.davUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"App passwords",description:"A mount signs in with an app password instead of your passkey. It works only for the drive, expires after a year and can be revoked here. It can only read unless you allow saving changes.",children:[g&&g!==v?l.jsxDEV("article",{"data-app-password-reveal":!0,className:o("drive-reveal",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your new app password"},void 0,!1,void 0,this),l.jsxDEV("p",{className:o("",d.text),children:"Copy both now. The password is shown only once."},void 0,!1,void 0,this),l.jsxDEV(_,{label:"username",code:g.username},void 0,!1,void 0,this),l.jsxDEV(_,{label:"password",code:g.password},void 0,!1,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",type:"button",onClick:n.dismissCreatedAppPassword,children:"Done"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,t.appPasswords.length===0?l.jsxDEV("p",{className:o("",d.text),children:"No app passwords yet."},void 0,!1,void 0,this):t.appPasswords.map((f)=>l.jsxDEV(U,{kind:f.label,description:`${f.username} · ${f.access==="write"?"Read and write":"Read-only"}`,metadata:at(f,N),action:l.jsxDEV(y,{variant:"danger",disabled:s,type:"button",onClick:()=>n.revokeAppPassword(f.id),children:"Revoke"},void 0,!1,void 0,this)},f.id,!1,void 0,this)),l.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(f)=>{f.preventDefault();let Y=f.currentTarget,P=String(new FormData(Y).get(oe)??"");if(P.trim()==="")return;n.createAppPassword(P.trim(),T?"write":"read"),Y.reset(),S(!1)},children:[l.jsxDEV("label",{htmlFor:oe,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Name it after the computer it is for"},void 0,!1,void 0,this),l.jsxDEV(J,{id:oe,name:oe,type:"text",required:!0,maxLength:100,placeholder:"Laptop",autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("label",{htmlFor:Ue,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Allow saving changes"},void 0,!1,void 0,this),l.jsxDEV(te,{id:Ue,"aria-label":"Allow saving changes",checked:T,onCheckedChange:S},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",disabled:s,type:"submit",children:"New app password"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"Use it in Obsidian",description:"Keep an Obsidian vault on your computer in step with your brain. Obsidian stays fast and works offline; notes and images sync in the background.",children:l.jsxDEV("article",{className:o("drive-obsidian",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Rizom Brain"},void 0,!1,void 0,this),l.jsxDEV("ol",{className:o("",d.steps),children:[l.jsxDEV("li",{children:"Install the Rizom Brain plugin in Obsidian and turn it on."},void 0,!1,void 0,this),l.jsxDEV("li",{children:["In its settings, enter your brain’s address:"," ",l.jsxDEV("code",{children:new URL(e.davUrl).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("li",{children:"Choose Connect, and confirm on the page that opens here."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),l.jsxDEV(C,{title:"Connect your computer",description:"Use your computer’s own file manager. The brain then appears as a drive beside your other folders.",children:[l.jsxDEV("div",{className:o("drive-clients",d.clients),children:I.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this),l.jsxDEV("details",{className:o("drive-command-line",d.developer),children:[l.jsxDEV("summary",{className:o("",d.developerSummary),children:["Command line",l.jsxDEV("span",{className:o("",d.developerHint),children:E.map((f)=>f.name).join(", ")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("drive-command-line-clients",d.clients,d.developerClients),children:E.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var w=b(ne(),1);var ae={revokePasskey:{title:"Revoke this passkey?",message:"You will not be able to use this passkey again.",confirmLabel:"Revoke passkey",pending:"Revoking passkey…",complete:"Passkey revoked."},revokeSession:{title:"End this browser session?",message:"That browser will need a passkey to sign in again.",confirmLabel:"End session",pending:"Ending session…",complete:"Session ended."},revokeAppPassword:{title:"Revoke this app password?",message:"Anything mounted with it stops working at once. Its password cannot be recovered.",confirmLabel:"Revoke app password",pending:"Revoking app password…",complete:"App password revoked."},revokeOtherSessions:{title:"End every other browser session?",message:"Your current browser will remain signed in.",confirmLabel:"End other sessions",pending:"Ending other sessions…",complete:"Other sessions ended."}};function Be(e){return je(e,"Account request failed")}function _e(e){let{client:t,initialAccount:n}=e,[a,s]=w.useState(n),[g,h]=w.useState(n?.displayName??e.initialDisplayName),[O,v]=w.useState(""),[N,T]=w.useState(!1),[S,D]=w.useState(!1),[I,E]=w.useState(null),[f,Y]=w.useState(null);w.useEffect(()=>{if(n)return;let p=!1;return t.fetchAccount().then((k)=>{if(p)return;s(k),h(k.displayName)}).catch((k)=>{if(p)return;T(!0),v(Be(k))}),()=>{p=!0}},[t,n]);let P=w.useCallback(async(p,k,B)=>{D(!0),T(!1),v(p);try{let q=await B();if(q)s(q),h(q.displayName);v(k)}catch(q){T(!0),v(Be(q))}finally{D(!1)}},[]),fe=async(p)=>(await t.mutateAccount(p)).account,Q=(p,k)=>E({title:p.title,message:p.message,confirmLabel:p.confirmLabel,action:()=>{P(p.pending,p.complete,()=>fe(k))}});return{account:a,displayName:g,setDisplayName:h,status:O,error:N,busy:S,confirmation:I,cancelConfirmation:()=>E(null),confirm:()=>{if(!I)return;E(null),I.action()},saveName:()=>{P("Saving…","Display name updated.",()=>fe({action:A.updateDisplayName,confirmation:A.updateDisplayName,displayName:g}))},addPasskey:()=>{P("Waiting for your authenticator…","Passkey added.",()=>t.registerPasskey())},revokePasskey:(p)=>Q(ae.revokePasskey,{action:A.revokePasskey,confirmation:A.revokePasskey,credentialId:p}),revokeSession:(p)=>Q(ae.revokeSession,{action:A.revokeSession,confirmation:A.revokeSession,sessionId:p}),revokeOtherSessions:()=>Q(ae.revokeOtherSessions,{action:A.revokeOtherSessions,confirmation:A.revokeOtherSessions}),revokeAllSessions:()=>E({title:"Sign out everywhere?",message:"This ends every session, including this one. You will need your passkey to return.",confirmLabel:"Sign out everywhere",action:()=>{P("Signing out everywhere…","Signed out.",async()=>{await t.mutateAccount({action:A.revokeAllSessions,confirmation:A.revokeAllSessions}),window.location.assign(`/login?return_to=${encodeURIComponent(e.routePath)}`);return})}}),saveSettings:(p,k)=>{let B=be(p.fields,k);P(`Saving ${p.title}…`,`${p.title} updated.`,()=>t.mutatePluginSettings({action:"save",definitionId:p.id,values:B}))},createdAppPassword:f,createAppPassword:(p,k)=>{P("Creating app password…","App password created.",async()=>{let B=await t.mutateAccount({action:A.createAppPassword,confirmation:A.createAppPassword,label:p,...k==="write"?{access:k}:{}});return Y(B.appPassword??null),B.account})},dismissCreatedAppPassword:()=>Y(null),revokeAppPassword:(p)=>Q(ae.revokeAppPassword,{action:A.revokeAppPassword,confirmation:A.revokeAppPassword,appPasswordId:p}),removeSettings:(p)=>E({title:`Remove ${p.title}?`,message:"The stored settings for this integration will be removed from your account only.",confirmLabel:"Remove settings",action:()=>{P(`Removing ${p.title}…`,`${p.title} removed.`,()=>t.mutatePluginSettings({action:"delete",definitionId:p.id}))}})}}var m=b(x(),1),it=["profile","security","identities","settings",H,F];function st(e){let t=e.connect?F:it.find((n)=>n===e.initialSection);if(!t||t===H&&!e.mcpUrl||t===F&&!e.davUrl)return"profile";return t}function rt(e){let t=["your profile","sign-in security","linked identities",...e.settings?["personal settings"]:[],...e.aiTools?["AI tools"]:[],...e.drive?["your drive"]:[]];return`Your account on this brain. Manage ${`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`} here—not shared services or other people’s access.`}function cn({bootstrap:e,initialAccount:t,client:n}){let a=qe(),s=K.useMemo(()=>n??new ce({fetch:a.fetch}),[n,a]),g=_e({client:s,initialAccount:t,initialDisplayName:e.displayName,routePath:e.routePath}),{account:h,status:O,error:v,busy:N,confirmation:T}=g,[S,D]=K.useState(()=>st(e));K.useEffect(()=>{document.querySelector('.account-tabs [role="tab"][aria-selected="true"]')?.scrollIntoView({block:"nearest",inline:"nearest"})},[S]);let I=h?.displayName??e.displayName;return m.jsxDEV(m.Fragment,{children:[m.jsxDEV("div",{className:o("account-shell",c.shell,Ve.inset),children:[m.jsxDEV(Je,{model:{access:ze("public"),title:"Your account",totals:[]}},void 0,!1,void 0,this),m.jsxDEV("p",{className:o("account-scope",c.description),children:rt({settings:(h?.pluginSettings.length??0)>0,aiTools:Boolean(e.mcpUrl),drive:Boolean(e.davUrl)})},void 0,!1,void 0,this),m.jsxDEV("p",{className:o(`account-status${v?" is-error":""}`,c.feedback,v&&c.feedbackError),role:"status","aria-live":"polite",children:O},void 0,!1,void 0,this),!h?m.jsxDEV("p",{className:o("account-loading",c.loading),children:"Reading your account…"},void 0,!1,void 0,this):m.jsxDEV(Ke,{className:"account-details",value:S,onValueChange:D,children:[m.jsxDEV(Ye,{"aria-label":"Account sections",className:o("account-tabs",c.tabs),children:[m.jsxDEV(M,{value:"profile",disabled:N,children:"Profile"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"security",disabled:N,children:"Sign-in & sessions"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"identities",disabled:N,children:"Linked identities"},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(M,{value:"settings",disabled:N,children:"Personal settings"},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(M,{value:H,disabled:N,children:"AI tools"},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(M,{value:F,disabled:N,children:"Drive"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV(L,{value:"profile",forceMount:!0,hidden:S!=="profile",className:o("account-detail-sections",c.tabPanel),children:m.jsxDEV(Ne,{account:h,actions:g,title:I,studioPath:e.studioPath},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"identities",forceMount:!0,hidden:S!=="identities",className:o("",c.tabPanel),children:m.jsxDEV(Te,{account:h},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(L,{value:"settings",forceMount:!0,hidden:S!=="settings",className:o("",c.tabPanel),children:m.jsxDEV(Pe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"security",forceMount:!0,hidden:S!=="security",className:o("",c.tabPanel),children:m.jsxDEV(xe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(L,{value:H,forceMount:!0,hidden:S!==H,className:o("",c.tabPanel),children:m.jsxDEV(De,{mcpUrl:e.mcpUrl},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(L,{value:F,forceMount:!0,hidden:S!==F,className:o("",c.tabPanel),children:m.jsxDEV(Fe,{davUrl:e.davUrl,account:h,actions:g,connect:e.connect},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T&&m.jsxDEV(He,{mark:"!",title:T.title,titleId:"account-confirmation-title",cancelLabel:"Cancel",confirmLabel:T.confirmLabel,confirmVariant:"danger",pending:N,onCancel:g.cancelConfirmation,onConfirm:g.confirm,children:m.jsxDEV("p",{children:T.message},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{cn as AccountApp};
1
+ import{Pb as c,Qb as o,Rb as d,Tb as me,Ub as $e,Vb as Me,Wb as Le,Xb as ve,Zb as we}from"./main-zf98b634.js";import{ac as Ve,ec as ze,fc as Je}from"./main-ph9ny1pw.js";import{$c as F,Ac as M,Ad as ee,Bc as L,Oc as ke,Tc as X,Uc as A,Vc as je,_c as H,kc as x,mc as y,nc as J,qc as te,rd as Ce,wc as He,yc as Ke,zc as Ye,zd as qe}from"./main-w46t7s4p.js";import{$d as i}from"./main-58mcmvrd.js";import{lf as ne}from"./main-t1xn9zx1.js";import{Tf as b}from"./main-m4w9yc1d.js";var K=b(ne(),1);var We=i.object({displayName:i.string(),role:i.enum(["admin","trusted","public"]),profileEntityId:i.string().optional(),passkeys:i.array(i.object({id:i.string(),transports:i.array(i.string()).optional(),credentialDeviceType:i.string().optional(),credentialBackedUp:i.boolean(),createdAt:i.number(),updatedAt:i.number()})),appPasswords:i.array(i.object({id:i.string(),username:i.string(),label:i.string(),access:i.enum(["read","write"]),createdAt:i.number(),expiresAt:i.number(),lastUsedAt:i.number().optional()})),connectedChannels:i.array(i.object({type:i.string(),label:i.string(),verifiedAt:i.number()})),pluginSettings:i.array(i.object({id:i.string(),title:i.string(),description:i.string().optional(),configured:i.boolean(),revision:i.number().nullable(),fields:i.array(i.object({name:i.string(),label:i.string(),control:i.enum(["text","url","number","checkbox"]),secret:i.boolean(),required:i.boolean(),value:i.union([i.string(),i.number(),i.boolean(),i.null()]).optional(),set:i.boolean().optional()}))})),sessions:i.array(i.object({id:i.string(),current:i.boolean(),createdAt:i.number(),expiresAt:i.number()}))});function Ge(e){return We.safeParse(e).success}var ge=i.custom(Ge,{message:"Invalid account response"}),ie=i.object({account:ge}),Ze=i.object({account:ge.optional(),appPassword:i.object({username:i.string(),password:i.string()}).optional(),revoked:i.object({sessions:i.number(),refreshTokens:i.number().optional()}).optional(),signedOut:i.boolean().optional()});function Qe(e){return Ze.safeParse(e).success}var Xe=i.custom(Qe,{message:"Invalid account mutation response"}),et=i.custom((e)=>{if(!X(e))return!1;return typeof e.challenge==="string"&&X(e.rp)&&X(e.user)&&Array.isArray(e.pubKeyCredParams)},{message:"Invalid passkey registration options"});class he extends Error{status;constructor(e,t){super(e);this.name="AccountApiError",this.status=t}}async function V(e,t){let n;try{n=await e.json()}catch{n={}}if(!e.ok){let a=typeof n==="object"&&n!==null&&"error"in n&&typeof n.error==="string"?n.error:"Account request failed";throw new he(a,e.status)}return t.parse(n)}function se(e){let t=e.replaceAll("-","+").replaceAll("_","/").padEnd(Math.ceil(e.length/4)*4,"=");return Uint8Array.from(atob(t),(n)=>n.charCodeAt(0)).buffer}function re(e){let t=new Uint8Array(e),n="";for(let a of t)n+=String.fromCharCode(a);return btoa(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function tt(e){return{challenge:se(e.challenge),rp:e.rp,user:{...e.user,id:se(e.user.id)},pubKeyCredParams:e.pubKeyCredParams,...e.timeout!==void 0?{timeout:e.timeout}:{},...e.excludeCredentials?{excludeCredentials:e.excludeCredentials.map((t)=>({...t,id:se(t.id)}))}:{},...e.authenticatorSelection?{authenticatorSelection:e.authenticatorSelection}:{},...e.attestation?{attestation:e.attestation}:{},...e.extensions?{extensions:e.extensions}:{}}}var nt=(e,t)=>fetch(e,t);class ce{fetchFn;constructor(e={}){this.fetchFn=e.fetch??nt}async fetchAccount(){return(await V(await this.fetchFn("/auth/account",{credentials:"same-origin",cache:"no-store"}),ie)).account}async mutatePluginSettings(e){return(await V(await this.fetchFn("/auth/account/plugin-settings",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),ie)).account}async mutateAccount(e){return V(await this.fetchFn("/auth/account/mutations",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Xe)}async registerPasskey(){let e=await V(await this.fetchFn("/auth/account/passkeys/options",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:"{}"}),et),t=await navigator.credentials.create({publicKey:tt(e)});if(!(t instanceof PublicKeyCredential))throw Error("Passkey registration was cancelled");if(!(t.response instanceof AuthenticatorAttestationResponse))throw Error("Authenticator returned an invalid passkey response");let n=t.response,a={id:t.id,rawId:re(t.rawId),type:t.type,...t.authenticatorAttachment?{authenticatorAttachment:t.authenticatorAttachment}:{},clientExtensionResults:t.getClientExtensionResults(),response:{clientDataJSON:re(n.clientDataJSON),attestationObject:re(n.attestationObject),transports:typeof n.getTransports==="function"?n.getTransports():[]}};return(await V(await this.fetchFn("/auth/account/passkeys/verify",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),ie.extend({verified:i.literal(!0)}))).account}}function ye(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map((t)=>t.slice(0,1).toUpperCase()).join("")}function Ae(e,t){let n=t.indexOf("/");if(n<=0||n===t.length-1)return;let a=t.slice(0,n),s=t.slice(n+1);return`${e==="/"?"":e.replace(/\/+$/,"")}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`}function j(e,t=!1){return new Date(t?e:e*1000).toISOString()}var R=b(x(),1);function z(e){return R.jsxDEV(y,{variant:e.tone==="danger"?"danger":e.tone==="primary"?"primary":"outline",type:e.type??"button",onClick:e.onClick,disabled:e.disabled,children:e.children},void 0,!1,void 0,this)}function U(e){return R.jsxDEV("div",{className:o("account-access-item",c.access),children:[R.jsxDEV(ve,{density:"comfortable",title:e.kind,description:e.description,metadata:e.metadata??[]},void 0,!1,void 0,this),e.action]},void 0,!0,void 0,this)}function C(e){return R.jsxDEV("section",{className:o("account-detail-section",c.section),children:[R.jsxDEV("div",{className:"account-section-label",children:[R.jsxDEV("h3",{className:o("",c.heading,ee.section,e.titleHidden===!0&&c.headingHidden),children:e.title},void 0,!1,void 0,this),e.description?R.jsxDEV("p",{className:o("",c.description),children:e.description},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),R.jsxDEV("div",{className:o("people-stack",c.stack),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function be(e,t){let n=Object.fromEntries(t.entries());for(let a of e)if(a.control==="checkbox")n[a.name]=t.has(a.name);else if(a.control==="number"&&typeof n[a.name]==="string"&&n[a.name]!=="")n[a.name]=Number(n[a.name]);return n}function Se(e){if(e.secret)return"password";if(e.control==="url"||e.control==="number")return e.control;return"text"}var r=b(x(),1);function Ne(e){let{account:t,actions:n,title:a,studioPath:s}=e,g=t.role,h=t.profileEntityId?Ae(s,t.profileEntityId):void 0;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV(C,{title:"Profile",titleHidden:!0,children:[r.jsxDEV("div",{className:o("account-identity",c.identity),children:r.jsxDEV("div",{className:o("people-detail-person",c.person),children:[r.jsxDEV("span",{className:o("people-avatar people-avatar--large",c.avatar),children:ye(a)},void 0,!1,void 0,this),r.jsxDEV("span",{className:o("",c.personCopy),children:[r.jsxDEV("span",{className:o("people-detail-name",c.name,ee.secondaryDisplay),children:a},void 0,!1,void 0,this),r.jsxDEV("span",{"data-account-role":g,className:o("account-role",c.role),children:ke(g)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),t.profileEntityId?r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("account-profile-note",c.description),children:"Managed by the Anchor profile — your account name follows the published profile."},void 0,!1,void 0,this),r.jsxDEV(U,{kind:"Anchor profile",description:a,action:h?r.jsxDEV(y,{asChild:!0,variant:"link",children:r.jsxDEV("a",{href:h,children:"Edit Anchor Profile →"},void 0,!1,void 0,this)},void 0,!1,void 0,this):void 0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(O)=>{O.preventDefault(),n.saveName()},children:[r.jsxDEV("label",{className:o("",c.formLabel),htmlFor:"display-name",children:"Display name"},void 0,!1,void 0,this),r.jsxDEV(J,{id:"display-name",maxLength:200,autoComplete:"name",required:!0,value:n.displayName,onChange:(O)=>n.setDisplayName(O.target.value)},void 0,!1,void 0,this),r.jsxDEV(z,{type:"submit",disabled:n.busy,children:"Save name"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV("p",{className:o("",c.description),children:"Your role controls access to this brain. An administrator manages access in Administration."},void 0,!1,void 0,this),g==="admin"&&r.jsxDEV(y,{asChild:!0,variant:"outline",children:r.jsxDEV("a",{href:Ce(s,"admin:administration"),children:"Manage people in Administration →"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Te(e){let t=e.account.connectedChannels;return r.jsxDEV(C,{title:"Linked identities",titleHidden:!0,description:"How this brain recognizes messages from you. These are your identities, not services configured for the whole brain.",children:t.length===0?r.jsxDEV("p",{className:o("people-empty",c.empty),children:"No linked identities."},void 0,!1,void 0,this):t.map((n)=>r.jsxDEV(U,{kind:n.type,description:n.label,metadata:[`Verified: ${j(n.verifiedAt,!0)}`]},`${n.type}:${n.label}`,!1,void 0,this))},void 0,!1,void 0,this)}function Pe(e){let{account:t,actions:n}=e;return r.jsxDEV(r.Fragment,{children:[r.jsxDEV("p",{className:o("",c.description),children:"Settings for your account only. These do not configure shared services for the brain."},void 0,!1,void 0,this),t.pluginSettings.map((a)=>r.jsxDEV(we,{label:a.title,density:"comfortable",presentation:"disclosure",children:[r.jsxDEV("p",{className:o("account-settings-description",c.description),children:a.description??"Private settings for this account."},void 0,!1,void 0,this),r.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(s)=>{s.preventDefault(),n.saveSettings(a,new FormData(s.currentTarget))},children:[a.fields.map((s)=>r.jsxDEV("label",{htmlFor:`setting-${a.id}-${s.name}`,className:o("",c.field),children:[r.jsxDEV("span",{className:o("",c.formLabel),children:s.label},void 0,!1,void 0,this),s.control==="checkbox"?r.jsxDEV(te,{id:`setting-${a.id}-${s.name}`,name:s.name,defaultChecked:s.value===!0},void 0,!1,void 0,this):r.jsxDEV(J,{id:`setting-${a.id}-${s.name}`,name:s.name,type:Se(s),required:s.required&&(!a.configured||s.secret)&&!s.set,defaultValue:s.secret?"":typeof s.value==="string"||typeof s.value==="number"?s.value:"",placeholder:s.secret&&s.set?"Stored — leave blank to keep":void 0,autoComplete:"off"},void 0,!1,void 0,this)]},s.name,!0,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:[r.jsxDEV(z,{type:"submit",tone:"primary",disabled:n.busy,children:"Save settings"},void 0,!1,void 0,this),a.configured?r.jsxDEV(y,{variant:"danger",disabled:n.busy,type:"button",onClick:()=>n.removeSettings(a),children:"Remove"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},`${a.id}:${a.revision??"unset"}`,!0,void 0,this)]},a.id,!0,void 0,this))]},void 0,!0,void 0,this)}function xe(e){let{account:t,actions:n}=e,{busy:a}=n;return r.jsxDEV("div",{className:o("",c.column),children:[r.jsxDEV(C,{title:"Sign-in",description:"Passkeys used to access this account. Your final passkey is protected from revocation.",children:[t.passkeys.map((s)=>r.jsxDEV(U,{kind:s.credentialBackedUp?"Synced passkey":"Device passkey",metadata:[`Added: ${j(s.createdAt,!0)}`],action:t.passkeys.length>1?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokePasskey(s.id),children:"Revoke"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this)),r.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:r.jsxDEV(y,{variant:"outline",disabled:a,type:"button",onClick:n.addPasskey,children:"Add passkey"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r.jsxDEV(C,{title:"Signed-in sessions",children:t.sessions.map((s)=>r.jsxDEV(U,{kind:s.current?"This session":"Browser session",metadata:[`Started: ${j(s.createdAt)}`,...s.current?["Current browser"]:[]],action:!s.current?r.jsxDEV(y,{variant:"danger",disabled:a,type:"button",onClick:()=>n.revokeSession(s.id),children:"End"},void 0,!1,void 0,this):void 0},s.id,!1,void 0,this))},void 0,!1,void 0,this),r.jsxDEV("footer",{className:o("account-session-actions",c.footer),children:[r.jsxDEV("small",{children:"Access changes require an Admin."},void 0,!1,void 0,this),r.jsxDEV("div",{className:o("",c.actions),children:[r.jsxDEV(z,{disabled:a||t.sessions.every((s)=>s.current),onClick:n.revokeOtherSessions,children:"End other sessions"},void 0,!1,void 0,this),r.jsxDEV(z,{tone:"danger",disabled:a,onClick:n.revokeAllSessions,children:"Sign out everywhere"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ee=b(ne(),1);function de(e){return new URL(e).host.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function le(e){return JSON.stringify(e,null,2)}function Oe(e,t,n){return["Already have servers there? Add only the ",{code:`"${n}"`}," entry inside ",{code:`"${t}"`},` of ${e}.`]}function Re(e){let t=de(e),n="Sign in with your passkey when asked.";return[{id:"claude",group:"primary",name:"Claude",note:["Desktop app and claude.ai."],steps:[["Open Settings → Connectors → Add custom connector."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when asked."]]},{id:"chatgpt",group:"primary",name:"ChatGPT",steps:[["Open Settings → Apps & Connectors → Advanced and turn on Developer mode."],["Choose Create, name it ",{code:t},", paste your brain’s address and pick OAuth."],["Sign in with your passkey when asked."]]},{id:"claude-code",group:"developer",name:"Claude Code",lead:[["Add the server in your terminal:"]],snippet:{label:"Claude Code command",code:`claude mcp add --transport http ${t} ${e}`},after:[["Then start Claude Code, run ",{code:"/mcp"},", choose ",{code:t}," and sign in with your passkey."]]},{id:"cursor",group:"developer",name:"Cursor",steps:[["Open Cursor Settings → MCP → Add new global MCP server."],["Name it ",{code:t}," and paste your brain’s address."],["Sign in with your passkey when Cursor asks."]],lead:[["Or add it to ",{code:"~/.cursor/mcp.json"},":"]],snippet:{label:"Cursor configuration",code:le({mcpServers:{[t]:{url:e}}})},after:[Oe("the file","mcpServers",t)]},{id:"vscode",group:"developer",name:"VS Code",steps:[["Open the Command Palette and run ",{code:"MCP: Add Server"},"."],["Choose HTTP, paste your brain’s address and name it ",{code:t},"."],["Choose Global, then sign in with your passkey when asked."]],lead:[["Or run ",{code:"MCP: Open User Configuration"}," and add:"]],snippet:{label:"VS Code configuration",code:le({servers:{[t]:{type:"http",url:e}}})},after:[Oe("your user configuration","servers",t)]},{id:"other",group:"developer",name:"Any other MCP client",inlineName:"any other MCP client",note:["Look for “add MCP server”, “connector” or “integration” in the tool’s settings and fill in:"],fields:[{label:"Name",value:[{code:t}]},{label:"Type",value:["Remote server, Streamable HTTP — not stdio, not SSE"]},{label:"URL",value:[{code:e}]},{label:"Authentication",value:["OAuth. Leave API key, token, client ID and secret empty; the tool registers itself."]}],lead:[["When you connect, your browser opens “Authorize <tool>?” on your brain. Approve MCP access with your passkey. The tool then has two tools: ",{code:"chat"},", to ask your brain anything as you would in chat, and ",{code:"confirm"},", to approve changes when the brain asks."],["Tool only takes local (stdio) servers, or insists on an API key? Bridge it with ",{code:"mcp-remote"},", which handles the sign-in:"]],snippet:{label:"mcp-remote bridge configuration",code:le({mcpServers:{[t]:{command:"npx",args:["-y","mcp-remote",e]}}})}}]}var u=b(x(),1);function W(e){return u.jsxDEV(u.Fragment,{children:e.text.map((t,n)=>typeof t==="string"?t:u.jsxDEV("code",{className:o("",d.code),children:t.code},n,!1,void 0,this))},void 0,!1,void 0,this)}function _(e){let[t,n]=Ee.useState("idle"),a=async()=>{try{await navigator.clipboard.writeText(e.code),n("copied")}catch{n("unavailable")}};return u.jsxDEV("div",{className:o("ai-tools-snippet",d.snippet),children:[u.jsxDEV("pre",{className:o("",d.snippetCode),"aria-label":e.label,children:e.code},void 0,!1,void 0,this),u.jsxDEV(y,{variant:"outline",size:"sm",onClick:()=>void a(),"aria-label":`Copy ${e.label}`,children:t==="copied"?"Copied":t==="unavailable"?"Select to copy":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function G(e){let{client:t}=e;return u.jsxDEV("article",{className:o("ai-tools-client",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:t.name},void 0,!1,void 0,this),t.note?u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:t.note},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,t.steps?u.jsxDEV("ol",{className:o("",d.steps),children:t.steps.map((n,a)=>u.jsxDEV("li",{children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},a,!1,void 0,this))},void 0,!1,void 0,this):null,t.fields?u.jsxDEV("dl",{className:o("",d.fields),children:t.fields.map((n)=>u.jsxDEV("div",{className:o("",d.field),children:[u.jsxDEV("dt",{className:o("",d.fieldLabel),children:n.label},void 0,!1,void 0,this),u.jsxDEV("dd",{className:o("",d.fieldValue),children:u.jsxDEV(W,{text:n.value},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},n.label,!0,void 0,this))},void 0,!1,void 0,this):null,t.lead?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`lead-${a}`,!1,void 0,this)),t.snippet?u.jsxDEV(_,{...t.snippet},void 0,!1,void 0,this):null,t.after?.map((n,a)=>u.jsxDEV("p",{className:o("",d.text),children:u.jsxDEV(W,{text:n},void 0,!1,void 0,this)},`after-${a}`,!1,void 0,this))]},void 0,!0,void 0,this)}function ot(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function De(e){let t=Re(e.mcpUrl),n=t.filter((s)=>s.group==="primary"),a=t.filter((s)=>s.group==="developer");return u.jsxDEV(C,{title:"AI tools",description:"Connect AI tools you already use to this brain. A connected tool talks to the brain as you do in chat — asking, saving and updating within your access — after you sign in with your passkey.",children:[u.jsxDEV("article",{className:o("ai-tools-address",d.client),children:[u.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s address"},void 0,!1,void 0,this),u.jsxDEV(_,{label:"brain address",code:e.mcpUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients),children:n.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this),u.jsxDEV("details",{className:o("ai-tools-developer",d.developer),children:[u.jsxDEV("summary",{className:o("",d.developerSummary),children:["Developer tools and other clients",u.jsxDEV("span",{className:o("",d.developerHint),children:ot(a.map((s)=>s.inlineName??s.name))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),u.jsxDEV("div",{className:o("ai-tools-clients",d.clients,d.developerClients),children:a.map((s)=>u.jsxDEV(G,{client:s},s.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Z=b(ne(),1);var ue="Enter the username and password of an app password from this page.";function Ie(e){let t=new URL(e),n=`${t.protocol==="https:"?"davs":"dav"}://${t.host}${t.pathname}`,a=de(e);return[{id:"macos",group:"file-manager",name:"macOS",note:["Finder, on any Mac."],steps:[["In Finder, choose Go → Connect to Server (⌘K)."],["Paste the address below and click Connect."],["Choose Registered User. ",ue]],snippet:{label:"macOS address",code:e}},{id:"windows",group:"file-manager",name:"Windows",note:["File Explorer, on Windows 10 and 11."],steps:[["In File Explorer, open This PC and choose Map network drive."],["Paste the address below as the folder, tick Connect using different credentials, and click Finish."],[ue]],snippet:{label:"Windows address",code:e}},{id:"gnome-files",group:"file-manager",name:"GNOME Files",note:["The file manager on Ubuntu, Fedora and other GNOME desktops."],steps:[["Open Files → Other Locations (or Network)."],["Under Connect to Server, enter the address below and connect."],[ue]],snippet:{label:"GNOME Files address",code:n}},{id:"rclone",group:"command-line",name:"rclone",note:["Linux, macOS and Windows, from a terminal."],lead:[["Store the drive as a remote, with your app password’s username and password:"]],snippet:{label:"rclone remote command",code:`rclone config create ${a} webdav url=${e} vendor=other user=YOUR_USERNAME pass=YOUR_PASSWORD --obscure`},after:[["Then mount it on an empty folder: ",{code:`rclone mount ${a}: ~/Brain --vfs-cache-mode writes`},"."]]}]}var l=b(x(),1),oe="app-password-label",Ue="app-password-write";function pe(e){return j(e).slice(0,10)}function at(e,t){return[`Created: ${pe(e.createdAt)}`,`${e.expiresAt<=t?"Expired":"Expires"}: ${pe(e.expiresAt)}`,e.lastUsedAt===void 0?"Never used":`Last used: ${pe(e.lastUsedAt)}`]}function Fe(e){let{account:t,actions:n,connect:a}=e,{busy:s,createdAppPassword:g}=n,[h,O]=Z.useState(void 0),v=a!==void 0&&h!==void 0?$e(g,h,t.appPasswords,me(a)):null;Z.useEffect(()=>{if(a&&v)Me(a,v)},[a,v]);let N=Math.floor(Date.now()/1000),[T,S]=Z.useState(!1),D=Ie(e.davUrl),I=D.filter((f)=>f.group==="file-manager"),E=D.filter((f)=>f.group==="command-line");return l.jsxDEV("div",{className:o("",c.column),children:[l.jsxDEV(C,{title:"Drive",description:"Mount this brain as a network drive. It shows the notes, posts and files you can see here, as folders and files, to open and edit on your computer.",children:[a?l.jsxDEV(Le,{connect:a,created:v,busy:s||h!==void 0&&v===null,onConnect:()=>{O(g?.username??null),n.createAppPassword(me(a),"write")}},void 0,!1,void 0,this):null,l.jsxDEV("article",{className:o("drive-address",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your brain’s drive address"},void 0,!1,void 0,this),l.jsxDEV(_,{label:"drive address",code:e.davUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"App passwords",description:"A mount signs in with an app password instead of your passkey. It works only for the drive, expires after a year and can be revoked here. It can only read unless you allow saving changes.",children:[g&&g!==v?l.jsxDEV("article",{"data-app-password-reveal":!0,className:o("drive-reveal",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Your new app password"},void 0,!1,void 0,this),l.jsxDEV("p",{className:o("",d.text),children:"Copy both now. The password is shown only once."},void 0,!1,void 0,this),l.jsxDEV(_,{label:"username",code:g.username},void 0,!1,void 0,this),l.jsxDEV(_,{label:"password",code:g.password},void 0,!1,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",type:"button",onClick:n.dismissCreatedAppPassword,children:"Done"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,t.appPasswords.length===0?l.jsxDEV("p",{className:o("",d.text),children:"No app passwords yet."},void 0,!1,void 0,this):t.appPasswords.map((f)=>l.jsxDEV(U,{kind:f.label,description:`${f.username} · ${f.access==="write"?"Read and write":"Read-only"}`,metadata:at(f,N),action:l.jsxDEV(y,{variant:"danger",disabled:s,type:"button",onClick:()=>n.revokeAppPassword(f.id),children:"Revoke"},void 0,!1,void 0,this)},f.id,!1,void 0,this)),l.jsxDEV("form",{className:o("name-form",c.form),onSubmit:(f)=>{f.preventDefault();let Y=f.currentTarget,P=String(new FormData(Y).get(oe)??"");if(P.trim()==="")return;n.createAppPassword(P.trim(),T?"write":"read"),Y.reset(),S(!1)},children:[l.jsxDEV("label",{htmlFor:oe,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Name it after the computer it is for"},void 0,!1,void 0,this),l.jsxDEV(J,{id:oe,name:oe,type:"text",required:!0,maxLength:100,placeholder:"Laptop",autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("label",{htmlFor:Ue,className:o("",c.field),children:[l.jsxDEV("span",{className:o("",c.formLabel),children:"Allow saving changes"},void 0,!1,void 0,this),l.jsxDEV(te,{id:Ue,"aria-label":"Allow saving changes",checked:T,onCheckedChange:S},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("people-inline-actions",c.inlineActions),children:l.jsxDEV(y,{variant:"outline",disabled:s,type:"submit",children:"New app password"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(C,{title:"Use it in Obsidian",description:"Keep an Obsidian vault on your computer in step with your brain. Obsidian stays fast and works offline; notes and images sync in the background.",children:l.jsxDEV("article",{className:o("drive-obsidian",d.client),children:[l.jsxDEV("h4",{className:o("",d.clientName),children:"Rizom Brain"},void 0,!1,void 0,this),l.jsxDEV("ol",{className:o("",d.steps),children:[l.jsxDEV("li",{children:"Install the Rizom Brain plugin in Obsidian and turn it on."},void 0,!1,void 0,this),l.jsxDEV("li",{children:["In its settings, enter your brain’s address:"," ",l.jsxDEV("code",{children:new URL(e.davUrl).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("li",{children:"Choose Connect, and confirm on the page that opens here."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),l.jsxDEV(C,{title:"Connect your computer",description:"Use your computer’s own file manager. The brain then appears as a drive beside your other folders.",children:[l.jsxDEV("div",{className:o("drive-clients",d.clients),children:I.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this),l.jsxDEV("details",{className:o("drive-command-line",d.developer),children:[l.jsxDEV("summary",{className:o("",d.developerSummary),children:["Command line",l.jsxDEV("span",{className:o("",d.developerHint),children:E.map((f)=>f.name).join(", ")},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:o("drive-command-line-clients",d.clients,d.developerClients),children:E.map((f)=>l.jsxDEV(G,{client:f},f.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var w=b(ne(),1);var ae={revokePasskey:{title:"Revoke this passkey?",message:"You will not be able to use this passkey again.",confirmLabel:"Revoke passkey",pending:"Revoking passkey…",complete:"Passkey revoked."},revokeSession:{title:"End this browser session?",message:"That browser will need a passkey to sign in again.",confirmLabel:"End session",pending:"Ending session…",complete:"Session ended."},revokeAppPassword:{title:"Revoke this app password?",message:"Anything mounted with it stops working at once. Its password cannot be recovered.",confirmLabel:"Revoke app password",pending:"Revoking app password…",complete:"App password revoked."},revokeOtherSessions:{title:"End every other browser session?",message:"Your current browser will remain signed in.",confirmLabel:"End other sessions",pending:"Ending other sessions…",complete:"Other sessions ended."}};function Be(e){return je(e,"Account request failed")}function _e(e){let{client:t,initialAccount:n}=e,[a,s]=w.useState(n),[g,h]=w.useState(n?.displayName??e.initialDisplayName),[O,v]=w.useState(""),[N,T]=w.useState(!1),[S,D]=w.useState(!1),[I,E]=w.useState(null),[f,Y]=w.useState(null);w.useEffect(()=>{if(n)return;let p=!1;return t.fetchAccount().then((k)=>{if(p)return;s(k),h(k.displayName)}).catch((k)=>{if(p)return;T(!0),v(Be(k))}),()=>{p=!0}},[t,n]);let P=w.useCallback(async(p,k,B)=>{D(!0),T(!1),v(p);try{let q=await B();if(q)s(q),h(q.displayName);v(k)}catch(q){T(!0),v(Be(q))}finally{D(!1)}},[]),fe=async(p)=>(await t.mutateAccount(p)).account,Q=(p,k)=>E({title:p.title,message:p.message,confirmLabel:p.confirmLabel,action:()=>{P(p.pending,p.complete,()=>fe(k))}});return{account:a,displayName:g,setDisplayName:h,status:O,error:N,busy:S,confirmation:I,cancelConfirmation:()=>E(null),confirm:()=>{if(!I)return;E(null),I.action()},saveName:()=>{P("Saving…","Display name updated.",()=>fe({action:A.updateDisplayName,confirmation:A.updateDisplayName,displayName:g}))},addPasskey:()=>{P("Waiting for your authenticator…","Passkey added.",()=>t.registerPasskey())},revokePasskey:(p)=>Q(ae.revokePasskey,{action:A.revokePasskey,confirmation:A.revokePasskey,credentialId:p}),revokeSession:(p)=>Q(ae.revokeSession,{action:A.revokeSession,confirmation:A.revokeSession,sessionId:p}),revokeOtherSessions:()=>Q(ae.revokeOtherSessions,{action:A.revokeOtherSessions,confirmation:A.revokeOtherSessions}),revokeAllSessions:()=>E({title:"Sign out everywhere?",message:"This ends every session, including this one. You will need your passkey to return.",confirmLabel:"Sign out everywhere",action:()=>{P("Signing out everywhere…","Signed out.",async()=>{await t.mutateAccount({action:A.revokeAllSessions,confirmation:A.revokeAllSessions}),window.location.assign(`/login?return_to=${encodeURIComponent(e.routePath)}`);return})}}),saveSettings:(p,k)=>{let B=be(p.fields,k);P(`Saving ${p.title}…`,`${p.title} updated.`,()=>t.mutatePluginSettings({action:"save",definitionId:p.id,values:B}))},createdAppPassword:f,createAppPassword:(p,k)=>{P("Creating app password…","App password created.",async()=>{let B=await t.mutateAccount({action:A.createAppPassword,confirmation:A.createAppPassword,label:p,...k==="write"?{access:k}:{}});return Y(B.appPassword??null),B.account})},dismissCreatedAppPassword:()=>Y(null),revokeAppPassword:(p)=>Q(ae.revokeAppPassword,{action:A.revokeAppPassword,confirmation:A.revokeAppPassword,appPasswordId:p}),removeSettings:(p)=>E({title:`Remove ${p.title}?`,message:"The stored settings for this integration will be removed from your account only.",confirmLabel:"Remove settings",action:()=>{P(`Removing ${p.title}…`,`${p.title} removed.`,()=>t.mutatePluginSettings({action:"delete",definitionId:p.id}))}})}}var m=b(x(),1),it=["profile","security","identities","settings",H,F];function st(e){let t=e.connect?F:it.find((n)=>n===e.initialSection);if(!t||t===H&&!e.mcpUrl||t===F&&!e.davUrl)return"profile";return t}function rt(e){let t=["your profile","sign-in security","linked identities",...e.settings?["personal settings"]:[],...e.aiTools?["AI tools"]:[],...e.drive?["your drive"]:[]];return`Your account on this brain. Manage ${`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`} here—not shared services or other people’s access.`}function cn({bootstrap:e,initialAccount:t,client:n}){let a=qe(),s=K.useMemo(()=>n??new ce({fetch:a.fetch}),[n,a]),g=_e({client:s,initialAccount:t,initialDisplayName:e.displayName,routePath:e.routePath}),{account:h,status:O,error:v,busy:N,confirmation:T}=g,[S,D]=K.useState(()=>st(e));K.useEffect(()=>{document.querySelector('.account-tabs [role="tab"][aria-selected="true"]')?.scrollIntoView({block:"nearest",inline:"nearest"})},[S]);let I=h?.displayName??e.displayName;return m.jsxDEV(m.Fragment,{children:[m.jsxDEV("div",{className:o("account-shell",c.shell,Ve.inset),children:[m.jsxDEV(Je,{model:{access:ze("public"),title:"Your account",totals:[]}},void 0,!1,void 0,this),m.jsxDEV("p",{className:o("account-scope",c.description),children:rt({settings:(h?.pluginSettings.length??0)>0,aiTools:Boolean(e.mcpUrl),drive:Boolean(e.davUrl)})},void 0,!1,void 0,this),m.jsxDEV("p",{className:o(`account-status${v?" is-error":""}`,c.feedback,v&&c.feedbackError),role:"status","aria-live":"polite",children:O},void 0,!1,void 0,this),!h?m.jsxDEV("p",{className:o("account-loading",c.loading),children:"Reading your account…"},void 0,!1,void 0,this):m.jsxDEV(Ke,{className:"account-details",value:S,onValueChange:D,children:[m.jsxDEV(Ye,{"aria-label":"Account sections",className:o("account-tabs",c.tabs),children:[m.jsxDEV(M,{value:"profile",disabled:N,children:"Profile"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"security",disabled:N,children:"Sign-in & sessions"},void 0,!1,void 0,this),m.jsxDEV(M,{value:"identities",disabled:N,children:"Linked identities"},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(M,{value:"settings",disabled:N,children:"Personal settings"},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(M,{value:H,disabled:N,children:"AI tools"},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(M,{value:F,disabled:N,children:"Drive"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),m.jsxDEV(L,{value:"profile",forceMount:!0,hidden:S!=="profile",className:o("account-detail-sections",c.tabPanel),children:m.jsxDEV(Ne,{account:h,actions:g,title:I,studioPath:e.studioPath},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"identities",forceMount:!0,hidden:S!=="identities",className:o("",c.tabPanel),children:m.jsxDEV(Te,{account:h},void 0,!1,void 0,this)},void 0,!1,void 0,this),h.pluginSettings.length>0&&m.jsxDEV(L,{value:"settings",forceMount:!0,hidden:S!=="settings",className:o("",c.tabPanel),children:m.jsxDEV(Pe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),m.jsxDEV(L,{value:"security",forceMount:!0,hidden:S!=="security",className:o("",c.tabPanel),children:m.jsxDEV(xe,{account:h,actions:g},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.mcpUrl&&m.jsxDEV(L,{value:H,forceMount:!0,hidden:S!==H,className:o("",c.tabPanel),children:m.jsxDEV(De,{mcpUrl:e.mcpUrl},void 0,!1,void 0,this)},void 0,!1,void 0,this),e.davUrl&&m.jsxDEV(L,{value:F,forceMount:!0,hidden:S!==F,className:o("",c.tabPanel),children:m.jsxDEV(Fe,{davUrl:e.davUrl,account:h,actions:g,connect:e.connect},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T&&m.jsxDEV(He,{mark:"!",title:T.title,titleId:"account-confirmation-title",cancelLabel:"Cancel",confirmLabel:T.confirmLabel,confirmVariant:"danger",pending:N,onCancel:g.cancelConfirmation,onConfirm:g.confirm,children:m.jsxDEV("p",{children:T.message},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{cn as AccountApp};
2
2
 
3
- //# debugId=07A34EF1E200888164756E2164756E21
3
+ //# debugId=E54EFDEE0FECCD9964756E2164756E21
@@ -15,6 +15,6 @@
15
15
  "import { useCallback, useEffect, useState } from \"react\";\nimport {\n AUTH_ACCOUNT_MUTATION_ACTIONS,\n type AuthAccountAppPasswordSecret,\n type AuthAccountMutation,\n type AuthAppPasswordAccess,\n type AuthAccountPluginSettingsForm,\n type AuthAccountSnapshot,\n} from \"@brains/contracts\";\nimport { getErrorMessage } from \"@brains/utils/error\";\nimport type { AccountClient } from \"./account-api\";\nimport { settingsFormValues } from \"./account-settings\";\n\nexport interface AccountConfirmation {\n title: string;\n message: string;\n confirmLabel: string;\n action: () => void;\n}\n\ninterface ConfirmedMutationCopy {\n title: string;\n message: string;\n confirmLabel: string;\n pending: string;\n complete: string;\n}\n\n/** The copy for each account change that asks before it runs. */\nconst CONFIRMED_MUTATIONS = {\n revokePasskey: {\n title: \"Revoke this passkey?\",\n message: \"You will not be able to use this passkey again.\",\n confirmLabel: \"Revoke passkey\",\n pending: \"Revoking passkey…\",\n complete: \"Passkey revoked.\",\n },\n revokeSession: {\n title: \"End this browser session?\",\n message: \"That browser will need a passkey to sign in again.\",\n confirmLabel: \"End session\",\n pending: \"Ending session…\",\n complete: \"Session ended.\",\n },\n revokeAppPassword: {\n title: \"Revoke this app password?\",\n message:\n \"Anything mounted with it stops working at once. Its password cannot be recovered.\",\n confirmLabel: \"Revoke app password\",\n pending: \"Revoking app password…\",\n complete: \"App password revoked.\",\n },\n revokeOtherSessions: {\n title: \"End every other browser session?\",\n message: \"Your current browser will remain signed in.\",\n confirmLabel: \"End other sessions\",\n pending: \"Ending other sessions…\",\n complete: \"Other sessions ended.\",\n },\n} satisfies Record<string, ConfirmedMutationCopy>;\n\nfunction messageOf(error: unknown): string {\n return getErrorMessage(error, \"Account request failed\");\n}\n\nexport interface AccountActionsInput {\n client: AccountClient;\n initialAccount: AuthAccountSnapshot | undefined;\n initialDisplayName: string;\n /** Where to come back to after signing out everywhere. */\n routePath: string;\n}\n\nexport interface AccountActions {\n account: AuthAccountSnapshot | undefined;\n displayName: string;\n setDisplayName: (value: string) => void;\n status: string;\n error: boolean;\n busy: boolean;\n confirmation: AccountConfirmation | null;\n cancelConfirmation: () => void;\n confirm: () => void;\n saveName: () => void;\n addPasskey: () => void;\n revokePasskey: (credentialId: string) => void;\n revokeSession: (sessionId: string) => void;\n revokeOtherSessions: () => void;\n revokeAllSessions: () => void;\n saveSettings: (\n settings: AuthAccountPluginSettingsForm,\n formData: FormData,\n ) => void;\n removeSettings: (settings: AuthAccountPluginSettingsForm) => void;\n /** The app password just created: the only time its password is known. */\n createdAppPassword: AuthAccountAppPasswordSecret | null;\n createAppPassword: (label: string, access: AuthAppPasswordAccess) => void;\n dismissCreatedAppPassword: () => void;\n revokeAppPassword: (appPasswordId: string) => void;\n}\n\n/**\n * The signed-in account and every change the Account page can make to it.\n * Each change reports its progress in one status line; destructive ones ask\n * first through a single pending confirmation.\n */\nexport function useAccountActions(input: AccountActionsInput): AccountActions {\n const { client, initialAccount } = input;\n const [account, setAccount] = useState(initialAccount);\n const [displayName, setDisplayName] = useState(\n initialAccount?.displayName ?? input.initialDisplayName,\n );\n const [status, setStatus] = useState(\"\");\n const [error, setError] = useState(false);\n const [busy, setBusy] = useState(false);\n const [confirmation, setConfirmation] = useState<AccountConfirmation | null>(\n null,\n );\n const [createdAppPassword, setCreatedAppPassword] =\n useState<AuthAccountAppPasswordSecret | null>(null);\n\n useEffect(() => {\n if (initialAccount) return;\n let cancelled = false;\n client\n .fetchAccount()\n .then((next) => {\n if (cancelled) return;\n setAccount(next);\n setDisplayName(next.displayName);\n })\n .catch((nextError: unknown) => {\n if (cancelled) return;\n setError(true);\n setStatus(messageOf(nextError));\n });\n return (): void => {\n cancelled = true;\n };\n }, [client, initialAccount]);\n\n const run = useCallback(\n async (\n pending: string,\n complete: string,\n action: () => Promise<AuthAccountSnapshot | undefined>,\n ): Promise<void> => {\n setBusy(true);\n setError(false);\n setStatus(pending);\n try {\n const next = await action();\n if (next) {\n setAccount(next);\n setDisplayName(next.displayName);\n }\n setStatus(complete);\n } catch (nextError) {\n setError(true);\n setStatus(messageOf(nextError));\n } finally {\n setBusy(false);\n }\n },\n [],\n );\n\n const mutate = async (\n mutation: AuthAccountMutation,\n ): Promise<AuthAccountSnapshot | undefined> =>\n (await client.mutateAccount(mutation)).account;\n\n const confirmMutation = (\n copy: ConfirmedMutationCopy,\n mutation: AuthAccountMutation,\n ): void =>\n setConfirmation({\n title: copy.title,\n message: copy.message,\n confirmLabel: copy.confirmLabel,\n action: () => {\n void run(copy.pending, copy.complete, () => mutate(mutation));\n },\n });\n\n return {\n account,\n displayName,\n setDisplayName,\n status,\n error,\n busy,\n confirmation,\n cancelConfirmation: () => setConfirmation(null),\n confirm: (): void => {\n if (!confirmation) return;\n setConfirmation(null);\n confirmation.action();\n },\n saveName: (): void => {\n void run(\"Saving…\", \"Display name updated.\", () =>\n mutate({\n action: AUTH_ACCOUNT_MUTATION_ACTIONS.updateDisplayName,\n confirmation: AUTH_ACCOUNT_MUTATION_ACTIONS.updateDisplayName,\n displayName,\n }),\n );\n },\n addPasskey: (): void => {\n void run(\"Waiting for your authenticator…\", \"Passkey added.\", () =>\n client.registerPasskey(),\n );\n },\n revokePasskey: (credentialId) =>\n confirmMutation(CONFIRMED_MUTATIONS.revokePasskey, {\n action: AUTH_ACCOUNT_MUTATION_ACTIONS.revokePasskey,\n confirmation: AUTH_ACCOUNT_MUTATION_ACTIONS.revokePasskey,\n credentialId,\n }),\n revokeSession: (sessionId) =>\n confirmMutation(CONFIRMED_MUTATIONS.revokeSession, {\n action: AUTH_ACCOUNT_MUTATION_ACTIONS.revokeSession,\n confirmation: AUTH_ACCOUNT_MUTATION_ACTIONS.revokeSession,\n sessionId,\n }),\n revokeOtherSessions: () =>\n confirmMutation(CONFIRMED_MUTATIONS.revokeOtherSessions, {\n action: AUTH_ACCOUNT_MUTATION_ACTIONS.revokeOtherSessions,\n confirmation: AUTH_ACCOUNT_MUTATION_ACTIONS.revokeOtherSessions,\n }),\n // Ending this session too, so the page leaves for the login instead of\n // showing an account it can no longer read.\n revokeAllSessions: () =>\n setConfirmation({\n title: \"Sign out everywhere?\",\n message:\n \"This ends every session, including this one. You will need your passkey to return.\",\n confirmLabel: \"Sign out everywhere\",\n action: () => {\n void run(\"Signing out everywhere…\", \"Signed out.\", async () => {\n await client.mutateAccount({\n action: AUTH_ACCOUNT_MUTATION_ACTIONS.revokeAllSessions,\n confirmation: AUTH_ACCOUNT_MUTATION_ACTIONS.revokeAllSessions,\n });\n window.location.assign(\n `/login?return_to=${encodeURIComponent(input.routePath)}`,\n );\n return undefined;\n });\n },\n }),\n saveSettings: (settings, formData): void => {\n const values = settingsFormValues(settings.fields, formData);\n void run(`Saving ${settings.title}…`, `${settings.title} updated.`, () =>\n client.mutatePluginSettings({\n action: \"save\",\n definitionId: settings.id,\n values,\n }),\n );\n },\n createdAppPassword,\n createAppPassword: (label, access): void => {\n void run(\"Creating app password…\", \"App password created.\", async () => {\n const created = await client.mutateAccount({\n action: AUTH_ACCOUNT_MUTATION_ACTIONS.createAppPassword,\n confirmation: AUTH_ACCOUNT_MUTATION_ACTIONS.createAppPassword,\n label,\n // Read-only is the default; only the wider access is named.\n ...(access === \"write\" ? { access } : {}),\n });\n setCreatedAppPassword(created.appPassword ?? null);\n return created.account;\n });\n },\n dismissCreatedAppPassword: () => setCreatedAppPassword(null),\n revokeAppPassword: (appPasswordId) =>\n confirmMutation(CONFIRMED_MUTATIONS.revokeAppPassword, {\n action: AUTH_ACCOUNT_MUTATION_ACTIONS.revokeAppPassword,\n confirmation: AUTH_ACCOUNT_MUTATION_ACTIONS.revokeAppPassword,\n appPasswordId,\n }),\n removeSettings: (settings) =>\n setConfirmation({\n title: `Remove ${settings.title}?`,\n message:\n \"The stored settings for this integration will be removed from your account only.\",\n confirmLabel: \"Remove settings\",\n action: () => {\n void run(\n `Removing ${settings.title}…`,\n `${settings.title} removed.`,\n () =>\n client.mutatePluginSettings({\n action: \"delete\",\n definitionId: settings.id,\n }),\n );\n },\n }),\n };\n}\n"
16
16
  ],
17
17
  "mappings": "2dAkBA,gBCcA,IAAM,GAA2B,EAAE,OAAO,CACxC,YAAa,EAAE,OAAO,EACtB,KAAM,EAAE,KAAK,CAAC,QAAS,UAAW,QAAQ,CAAC,EAC3C,gBAAiB,EAAE,OAAO,EAAE,SAAS,EACrC,SAAU,EAAE,MACV,EAAE,OAAO,CACP,GAAI,EAAE,OAAO,EACb,WAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EACzC,qBAAsB,EAAE,OAAO,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E,IA5JN,qBA8JE",
18
- "debugId": "07A34EF1E200888164756E2164756E21",
18
+ "debugId": "E54EFDEE0FECCD9964756E2164756E21",
19
19
  "names": []
20
20
  }
@@ -1,3 +1,3 @@
1
- import{$d as c,$e as W,Ae as v,Be as w,Ce as x,De as y,Ee as z,Fe as A,Ge as B,He as C,Ie as D,Je as E,Ke as F,Le as G,Me as H,Ne as I,Oe as J,Pe as K,Qe as L,Re as M,Se as N,Te as O,Ue as P,Ve as Q,We as R,Xe as S,Ye as T,Zd as a,Ze as U,_d as b,_e as V,ae as d,af as X,be as e,bf as Y,ce as f,cf as Z,de as g,df as _,ee as h,ef as aa,fe as i,ff as ba,gf as ca,oe as j,pe as k,qe as l,re as m,se as n,te as o,ue as p,ve as q,we as r,xe as s,ye as t,ze as u}from"./main-ykhhz1dv.js";import"./main-15a2cggv.js";export{a as ASK_SOURCES_EVENT,j as CHAT_API_VERSION,o as CHAT_CONVERSATION_ID_HEADER,aa as ChatApiError,k as DEFAULT_CHAT_API_PATH,W as archiveChatSessionResponseSchema,b as askSourcesDetailSchema,Y as chatActionRequestSchema,v as chatActionResponseSchema,M as chatApprovalResponsePartSchema,L as chatApprovalResponseSchema,s as chatCardSchema,x as chatContextHandoffRequestSchema,T as chatContextHandoffResponseSchema,u as chatEventActionSchema,I as chatFilePartSchema,C as chatHistoryAttachmentSchema,B as chatHistoryAttachmentSourceSchema,D as chatHistoryMessageSchema,Z as chatJobStatusSchema,O as chatMessageRequestSchema,N as chatMessageSchema,E as chatMessagesResponseSchema,Q as chatProgressEventSchema,S as chatProtocolEventSchema,y as chatSessionListQuerySchema,z as chatSessionSchema,A as chatSessionsResponseSchema,r as chatSourceCitationSchema,H as chatTextPartSchema,R as chatToolStatusEventSchema,K as chatUploadPartSchema,J as chatUploadRefSchema,_ as chatUploadResponseSchema,w as createChatApiPaths,ca as createChatClient,X as deleteChatSessionResponseSchema,t as getGuestSourceCards,G as guestChatHistoryResponseSchema,P as guestChatMessageRequestSchema,p as guestChatSessionResponseSchema,F as guestChatSubmissionIdSchema,q as guestChatSubmissionStatusSchema,n as guestConversationOwnershipSchema,c as guestExecutionLimitsSchema,d as guestExecutionPolicySchema,l as guestInterfaceType,i as guestRefusalCategorySchema,m as guestRetentionSchema,h as guestScreeningCategorySchema,g as guestScreeningSchema,f as guestTurnCostSchema,e as guestTurnUsageSchema,ba as readChatProtocolEvents,U as renameChatSessionRequestSchema,V as renameChatSessionResponseSchema};
1
+ import{$e as S,Ae as r,Be as s,Ce as t,De as u,Ee as v,Fe as w,Ge as x,He as y,Ie as z,Je as A,Ke as B,Le as C,Me as D,Ne as E,Oe as F,Pe as G,Qe as H,Re as I,Se as J,Te as K,Ue as L,Ve as M,We as N,Xe as O,Ye as P,Ze as Q,_e as R,af as T,be as a,bf as U,ce as b,cf as V,de as c,df as W,ee as d,ef as X,fe as e,ff as Y,ge as f,gf as Z,he as g,hf as _,ie as h,if as aa,je as i,jf as ba,kf as ca,se as j,te as k,ue as l,ve as m,we as n,xe as o,ye as p,ze as q}from"./main-58mcmvrd.js";import"./main-m4w9yc1d.js";export{a as ASK_SOURCES_EVENT,j as CHAT_API_VERSION,o as CHAT_CONVERSATION_ID_HEADER,aa as ChatApiError,k as DEFAULT_CHAT_API_PATH,W as archiveChatSessionResponseSchema,b as askSourcesDetailSchema,Y as chatActionRequestSchema,v as chatActionResponseSchema,M as chatApprovalResponsePartSchema,L as chatApprovalResponseSchema,s as chatCardSchema,x as chatContextHandoffRequestSchema,T as chatContextHandoffResponseSchema,u as chatEventActionSchema,I as chatFilePartSchema,C as chatHistoryAttachmentSchema,B as chatHistoryAttachmentSourceSchema,D as chatHistoryMessageSchema,Z as chatJobStatusSchema,O as chatMessageRequestSchema,N as chatMessageSchema,E as chatMessagesResponseSchema,Q as chatProgressEventSchema,S as chatProtocolEventSchema,y as chatSessionListQuerySchema,z as chatSessionSchema,A as chatSessionsResponseSchema,r as chatSourceCitationSchema,H as chatTextPartSchema,R as chatToolStatusEventSchema,K as chatUploadPartSchema,J as chatUploadRefSchema,_ as chatUploadResponseSchema,w as createChatApiPaths,ca as createChatClient,X as deleteChatSessionResponseSchema,t as getGuestSourceCards,G as guestChatHistoryResponseSchema,P as guestChatMessageRequestSchema,p as guestChatSessionResponseSchema,F as guestChatSubmissionIdSchema,q as guestChatSubmissionStatusSchema,n as guestConversationOwnershipSchema,c as guestExecutionLimitsSchema,d as guestExecutionPolicySchema,l as guestInterfaceType,i as guestRefusalCategorySchema,m as guestRetentionSchema,h as guestScreeningCategorySchema,g as guestScreeningSchema,f as guestTurnCostSchema,e as guestTurnUsageSchema,ba as readChatProtocolEvents,U as renameChatSessionRequestSchema,V as renameChatSessionResponseSchema};
2
2
 
3
- //# debugId=F0D38AE5B5F99A3264756E2164756E21
3
+ //# debugId=F2AEC3CF99F41C7764756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "F0D38AE5B5F99A3264756E2164756E21",
7
+ "debugId": "F2AEC3CF99F41C7764756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -1,3 +1,3 @@
1
- import{Fb as n,Hb as g,Jb as c}from"./main-d2zzd603.js";import{hf as b,if as k}from"./main-eqd1vphg.js";import{Pf as m}from"./main-15a2cggv.js";var e=m(b(),1),u=m(k(),1),C=({code:s,language:t,raw:r,className:h,startLine:f,lineNumbers:d,...p})=>{let{shikiTheme:l}=e.useContext(c),a=g(),[N,i]=e.useState(r);return e.useEffect(()=>{if(!a){i(r);return}let o=a.highlight({code:s,language:t,themes:l},(x)=>{i(x)});o&&i(o)},[s,t,l,a,r]),u.jsx(n,{className:h,language:t,lineNumbers:d,result:N,startLine:f,...p})};export{C as HighlightedCodeBlockBody};
1
+ import{Ib as n,Kb as g,Mb as c}from"./main-a0bqvrke.js";import{lf as b,mf as k}from"./main-t1xn9zx1.js";import{Tf as m}from"./main-m4w9yc1d.js";var e=m(b(),1),u=m(k(),1),C=({code:s,language:t,raw:r,className:h,startLine:f,lineNumbers:d,...p})=>{let{shikiTheme:l}=e.useContext(c),a=g(),[N,i]=e.useState(r);return e.useEffect(()=>{if(!a){i(r);return}let o=a.highlight({code:s,language:t,themes:l},(x)=>{i(x)});o&&i(o)},[s,t,l,a,r]),u.jsx(n,{className:h,language:t,lineNumbers:d,result:N,startLine:f,...p})};export{C as HighlightedCodeBlockBody};
2
2
 
3
- //# debugId=5F855BD91177FE4B64756E2164756E21
3
+ //# debugId=75FE59CA137DCCC764756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "\"use client\";\nimport {A,f,c}from'./chunk-BO2N2NFS.js';import {useContext,useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';var R=({code:s,language:e,raw:t,className:h,startLine:d,lineNumbers:m,...p})=>{let{shikiTheme:l}=useContext(A),o=f(),[a,i]=useState(t);return useEffect(()=>{if(!o){i(t);return}let r=o.highlight({code:s,language:e,themes:l},c=>{i(c);});r&&i(r);},[s,e,l,o,t]),jsx(c,{className:h,language:e,lineNumbers:m,result:a,startLine:d,...p})};export{R as HighlightedCodeBlockBody};"
6
6
  ],
7
7
  "mappings": "gJACwC,eAAkD,WAAwC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,KAAK,KAAK,CAAC,IAAI,WAAW,GAAG,aAAW,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,WAAS,CAAC,EAAE,OAAO,YAAU,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,IAAI,EAAE,EAAE,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,KAAG,CAAC,EAAE,CAAC,EAAG,EAAE,GAAG,EAAE,CAAC,GAAI,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAI,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,KAAK,CAAC,CAAC",
8
- "debugId": "5F855BD91177FE4B64756E2164756E21",
8
+ "debugId": "75FE59CA137DCCC764756E2164756E21",
9
9
  "names": []
10
10
  }