PageSourceSearch

https://mymori.ai/assets/m-7cn7Kuhe.js

js mymori.ai collected 2026-10-05 14:01:39 UTC 14,526 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/m-D8snVOMi.js","assets/m-D-MmE8SN.js","assets/m-C3pNwEaH.css"])))=>i.map(i=>d[i]);
2import{br as F,aa as P,aQ as I,u as M,r as p,j as e,C as j,a as y,Y as q,b as v,k as h,c as N,B as f,G as S,a4 as G,Q as w,ac as b,H as L,U as $,F as U}from"./m-D-MmE8SN.js";import{T as V,a as H,b as A,c as C}from"./m-DySGkD76.js";import{c as z,d as B,b as O,r as W}from"./m-Brf5lJxV.js";import{logAgentEvent as k}from"./m-D8snVOMi.js";import{C as Q}from"./m-o4GYaZq6.js";import{S as Y}from"./m-DADxhLJl.js";function X(s,a){return{invoke:async(r,l)=>{if(!s.allowedTools.includes(r)){const c=`Agent "${s.agentId}" attempted disallowed tool: ${r}`;throw console.error(`[AgentControl] ${c}`),await k({agentId:s.agentId,userId:a.userId,requestId:a.requestId,actionType:"tool_access_denied",authorityMode:s.authorityMode,status:"blocked",metadata:{toolName:r}}),new Error(c)}if(s.authorityMode==="read"&&Z(r)){const c=`Read-mode agent "${s.agentId}" cannot use write tool: ${r}`;throw console.error(`[AgentControl] ${c}`),await k({agentId:s.agentId,userId:a.userId,requestId:a.requestId,actionType:"write_blocked_read_agent",authorityMode:s.authorityMode,status:"blocked",metadata:{toolName:r}}),new Error(c)}const n=(await P(()=>import("./m-D8snVOMi.js"),__vite__mapDeps([0,1,2])))[r];if(typeof n!="function")throw new Error(`Tool "${r}" not found in agentTools module`);return n({...l,_ctx:a})}}}const J=new Set(["create_pending_agent_action","draft_family_invitation","draft_document_section","draft_acp_reflection_summary","build_crisis_packet_summary"]);function Z(s){return J.has(s)}async function R(s,a,r,l){const i=F(),n=z(s);if(!n)return console.error(`[AgentControl] Unknown agent: ${s}`),{success:!1,requestId:i,agentId:s,error:`Agent "${s}" not registered`};const c={agentId:s,userId:a,requestId:i,sessionId:l};n.eventLoggingRequired&&await k({agentId:n.agentId,userId:a,requestId:i,actionType:"agent_invoked",authorityMode:n.authorityMode,status:"started"});try{const u=X(n,c),o=await r(c,n,u);return n.eventLoggingRequired&&await k({agentId:n.agentId,userId:a,requestId:i,actionType:"agent_completed",authorityMode:n.authorityMode,status:"completed"}),{success:!0,requestId:i,agentId:s,data:o}}catch(u){const o=u instanceof Error?u.message:"Unknown error";return n.eventLoggingRequired&&await k({agentId:n.agentId,userId:a,requestId:i,actionType:"agent_error",authorityMode:n.authorityMode,status:"error",metadata:{error:o}}),console.error(`[AgentControl] Agent "${s}" failed:`,o),{success:!1,requestId:i,agentId:s,error:o}}}async function K(s){return R("continuity-gap-detector",s,async(a,r,l)=>{const i=await l.invoke("read_continuity_gaps",{userId:s});return await l.invoke("log_agent_event",{agentId:a.agentId,userId:a.userId,requestId:a.requestId,actionType:"gaps_detected",authorityMode:"read",status:"completed",metadata:{totalGaps:i.totalGaps,readinessScore:i.readinessScore}}),i})}async function ee(s,a){return R("acp-reflective-guide",s,async(r,l,i)=>{const n=await i.invoke("draft_acp_reflection_summary",{userId:s,reflectionNotes:a}),c=await i.invoke("create_pending_agent_action",{agentId:r.agentId,userId:s,actionType:"save_acp_reflection_summary",actionPayload:n.draft});return{draft:n.draft,status:"pending_approval",requiresApproval:!0,pendingActionId:c.id}})}async function se(s,a){return R("family-coordination-agent",s,async(r,l,i)=>{const n=await i.invoke("read_user_context",{userId:s}),c=[];n.familyMembers.length===0&&c.push({type:"add_family",description:"Consider adding at least one trusted family member or friend to your continuity circle."}),n.familyMembers.length<3&&c.push({type:"expand_circle",description:"Your continuity circle could benefit from additional members for resilience."});let u,o;return a?.recipientName,{recommendations:c,pendingInvitation:u,pendingActionId:o}})}async function te(s,a){return R("document-preparation-agent",s,async(r,l,i)=>{const n=await i.invoke("draft_document_section",{userId:s,sectionType:a}),c=await i.invoke("create_pending_agent_action",{agentId:r.agentId,userId:s,actionType:"finalize_document_section",actionPayload:n.draft});return{draft:n.draft,pendingActionId:c.id}})}async function ae(s){return R("crisis-readiness-agent",s,async(a,r,l)=>{const i=await l.invoke("build_crisis_packet_summary",{userId:s}),n=await l.invoke("create_pending_agent_action",{agentId:a.agentId,userId:s,actionType:"share_crisis_packet",actionPayload:i.summary});return{summary:i.summary,pendingActionId:n.id}})}function ne(){const{user:s}=I(),{toast:a}=M(),[r,l]=p.useState([]),[i,n]=p.useState(!0);p.useEffect(()=>{s?.id&&c()},[s?.id]);const c=async()=>
2{if(!s?.id)return;n(!0);const m=await B(s.id);l(m),n(!1)},u=async m=>{if(!s?.id)return;await O(m,s.id)&&(a({title:"Action Approved",description:"The agent action has been approved."}),c())},o=async m=>{if(!s?.id)return;await W(m,s.id)&&(a({title:"Action Rejected",description:"The agent action has been rejected."}),c())};return i||r.length===0?null:e.jsxs(j,{children:[e.jsx(y,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-5 w-5 text-amber-500"}),e.jsx(v,{className:"text-lg",children:"Pending Agent Actions"}),e.jsx(h,{variant:"outline",children:r.length})]})}),e.jsx(N,{className:"space-y-3",children:r.map(m=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:m.agent_id}),e.jsx(h,{variant:"secondary",className:"text-xs",children:m.action_type})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(m.created_at).toLocaleString()})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(f,{size:"sm",variant:"outline",onClick:()=>u(m.id),children:[e.jsx(S,{className:"h-3 w-3 mr-1"})," Approve"]}),e.jsxs(f,{size:"sm",variant:"ghost",onClick:()=>o(m.id),children:[e.jsx(Q,{className:"h-3 w-3 mr-1"})," Reject"]})]})]},m.id))})]})}function me(){const{user:s}=I(),{toast:a}=M(),[r,l]=p.useState(null),[i,n]=p.useState(null),[c,u]=p.useState(null),[o,m]=p.useState(null),[x,E]=p.useState(null),[g,T]=p.useState(null),_=async d=>{if(s?.id){T(d);try{switch(d){case"gaps":{const t=await K(s.id);t.success&&t.data?l(t.data):a({title:"Error",description:t.error,variant:"destructive"});break}case"reflection":{const t=await ee(s.id);t.success&&t.data?n(t.data):a({title:"Error",description:t.error,variant:"destructive"});break}case"family":{const t=await se(s.id);t.success&&t.data?u(t.data):a({title:"Error",description:t.error,variant:"destructive"});break}case"documents":{const t=await te(s.id,"Healthcare Directive");t.success&&t.data?m(t.data):a({title:"Error",description:t.error,variant:"destructive"});break}case"crisis":{const t=await ae(s.id);t.success&&t.data?E(t.data):a({title:"Error",description:t.error,variant:"destructive"});break}}}catch(t){a({title:"Agent Error",description:t.message,variant:"destructive"})}finally{T(null)}}},D=d=>d==="high"?"destructive":d==="medium"?"outline":"secondary";return e.jsxs("div",{className:"container mx-auto py-8 space-y-6 max-w-4xl",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Continuity Assistant"}),e.jsx("p",{className:"text-muted-foreground",children:"AI-powered insights to strengthen your continuity planning"})]}
2),e.jsxs(V,{defaultValue:"gaps",children:[e.jsxs(H,{className:"grid grid-cols-5 w-full",children:[e.jsx(A,{value:"gaps",className:"text-xs",children:"Gaps"}),e.jsx(A,{value:"reflection",className:"text-xs",children:"Reflection"}),e.jsx(A,{value:"family",className:"text-xs",children:"Family"}),e.jsx(A,{value:"documents",className:"text-xs",children:"Documents"}),e.jsx(A,{value:"crisis",className:"text-xs",children:"Crisis"})]}),e.jsx(C,{value:"gaps",children:e.jsxs(j,{children:[e.jsxs(y,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{className:"h-5 w-5 text-amber-500"}),e.jsx(v,{children:"Continuity Gap Detector"})]}),e.jsx(w,{children:"Identify missing, stale, or incomplete items in your continuity plan"})]}),e.jsxs(N,{className:"space-y-4",children:[e.jsx(f,{onClick:()=>_("gaps"),disabled:g==="gaps",children:g==="gaps"?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-4 w-4 animate-spin mr-2"})," Analyzing..."]}):"Run Gap Analysis"}),r&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(h,{className:"text-lg px-3 py-1",children:["Readiness: ",r.readinessScore,"%"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[r.totalGaps," gap(s) found"]})]}),r.gaps.map((d,t)=>e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-muted/50",children:[e.jsx(h,{variant:D(d.severity),children:d.severity}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:d.area}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.description})]})]},t))]})]})]})}),e.jsx(C,{value:"reflection",children:e.jsxs(j,{children:[e.jsxs(y,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-5 w-5 text-rose-500"}),e.jsx(v,{children:"ACP Reflective Guide"})]}),e.jsx(w,{children:"Explore your values and care preferences through guided reflection"})]}),e.jsxs(N,{className:"space-y-4",children:[e.jsx(f,{onClick:()=>_("reflection"),disabled:g==="reflection",children:g==="reflection"?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-4 w-4 animate-spin mr-2"})," Generating..."]}):"Start Reflection"}),i&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs(h,{variant:"outline",className:"gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," Draft — Requires Approval"]}),e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 space-y-2",children:[e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Values:"})," ",i.draft.valuesHighlights]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"What Matters:"})," ",i.draft.whatMatters]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium mt-2",children:"Suggested follow-up questions:"}),e.jsx("ul",{className:"list-disc pl-5 text-sm text-muted-foreground",children:i.draft.suggestedFollowUp.map((d,t)=>e.jsx("li",{children:d},t))})]})]})]})]})]})}),e.jsx(C,{value:"family",children:e.jsxs(j,{children:[e.jsxs(y,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{className:"h-5 w-5 text-blue-500"}),e.jsx(v,{children:"Family Coordination"})]}),e.jsx(w,{children:"Strengthen your continuity circle with coordination suggestions"})]}),e.jsxs(N,{className:"space-y-4",children:[e.jsx(f,{onClick:()=>_("family"),disabled:g==="family",children:g==="family"?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-4 w-4 animate-spin mr-2"})," Analyzing..."]}):"Review Circle"}),c&&e.jsx("div",{className:"space-y-3",children:c.recommendations.map((d,t)=>e.jsxs("div",{className:"p-3 rounded-lg bg-muted/50",children:[e.jsx(h,{variant:"secondary",className:"mb-1",children:d.type}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.description})]},t))})]})]})}),e.jsx(C,{value:"documents",children:e.jsxs(j,{children:[e.jsxs(y,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"h-5 w-5 text-violet-500"}),e.jsx(v,{children:"Document Preparation"})]}),e.jsx(w,{children:"Draft document sections based on your existing data"})]}),e.jsxs(N,{className:"space-y-4",children:[e.jsx(f,{onClick:()=>_("documents"),disabled:g==="documents",children:g==="documents"?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-4 w-4 animate-spin mr-2"})," Drafting..."]}):"Draft Healthcare Directive"}),o&&e.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 space-y-2",children:[e.jsx(h,{variant:"outline",children:"Draft — Requires Approval"}),e.jsx("p",{className:"text-sm font-medium",children:o.draft.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:o.draft.content}),o.draft.missingFields.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-amber-600",children:"Missing fields:"}),e.jsx("ul",{className:"list-disc pl-5 text-sm text-muted-foreground",children:o.draft.missingFields.map((d,t)=>e.jsx("li",{children:d},t))})]})]})]})]})}),e.jsx(C,{value:"crisis",children:e.jsxs(j,{children:[e.jsxs(y,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{className:"h-5 w-5 text-red-500"}),e.jsx(v,{children:"Crisis Readiness"})]}),e.jsx(w,{children:"Assess your emergency readiness and continuity packet status"})]}),e.jsxs(N,{className:"space-y-4",children:[e.jsx(f,{onClick:()=>_("crisis"),disabled:g==="crisis",children:g==="crisis"?e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-4 w-4 animate-spin mr-2"})," Assessing..."]}):"Check Readiness"}),x&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs(h,{className:"text-lg px-3 py-1",children:["Readiness: ",x.summary.readinessScore,"%"]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"text-muted-foreground",children:"Documents"}),e.jsx("p",{className:"font-medium",children:x.summary.documentCount})]}),e.jsxs("div",{className:"p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"text-muted-foreground",children:"Emergency Contacts"}),e.jsx("p",{className:"font-medium",children:x.summary.emergencyContactCount})]}),e.jsxs("div",{className:"p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"text-muted-foreground",children:"Family Members"}),e.jsx("p",{className:"font-medium",children:x.summary.familyMemberCount})]}),e.jsxs("div",{className:"p-3 rounded-lg bg-muted/50",children:[e.jsx("p",{className:"text-muted-foreground",children:"Values & Voice"}),e.jsx("p",{className:"font-medium",children:x.summary.hasValuesVoice?"Complete":"Missing"})]})]}),x.summary.criticalMissing.length>0&&e.jsxs("div",{className:"p-3 rounded-lg border border-destructive/30",children:[e.jsx("p",{className:"text-sm font-medium text-destructive mb-1",children:"Critical Missing Items"}),e.jsx("ul",{className:"list-disc pl-5 text-sm text-muted-foreground",children:x.summary.criticalMissing.map((d,t)=>e.jsx("li",{children:d},t))})]})]})]})]})})]}),e.jsx(ne,{})]})}
2export{me as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.