Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["6368"],{60514(e,r,n){n.r(r),n.d(r,{metadata:()=>t,default:()=>E,frontMatter:()=>T,contentTitle:()=>S,toc:()=>N,assets:()=>C});var t=JSON.parse('{"id":"daemon-mode/platform-guide","title":"Platform-Specific Guide","description":"mercury service install creates a LaunchAgent at ~/Library/LaunchAgents/com.cosmicstack.mercury.plist.","source":"@site/docs/daemon-mode/platform-guide.mdx","sourceDirName":"daemon-mode","slug":"/daemon-mode/platform-guide","permalink":"/docs/daemon-mode/platform-guide","draft":false,"unlisted":false,"editUrl":"https://github.com/cosmicstack-labs/mercury-agent/tree/main/website/docs/daemon-mode/platform-guide.mdx","tags":[],"version":"current","frontMatter":{"id":"platform-guide","title":"Platform-Specific Guide"},"sidebar":"docsSidebar","previous":{"title":"System Service (Auto-Start on Boot)","permalink":"/docs/daemon-mode/system-service"},"next":{"title":"Web Dashboard","permalink":"/docs/integrations/web-dashboard"}}'),s=n(74848),a=n(28453),l=n(96540),i=n(34164),c=n(88287),o=n(56347),u=n(99989),d=n(96629),h=n(80618),m=n(41367);function x({value:e,tabValues:r}){return r.some(r=>r.value===e)}let f=(0,l.createContext)(null);function p(){let e=l.useContext(f);if(!e)throw Error("useTabsContext() must be used within a Tabs component");return e}function g(e){return(0,s.jsx)(f.Provider,{value:e.value,children:e.children})}var j=n(28584),v=n(19863);function y({className:e}){let{selectedValue:r,selectValue:n,tabValues:t,block:a}=p(),l=[],{blockElementScrollPositionUntilNextRender:c}=(0,j.a_)(),o=e=>{let s=e.currentTarget,a=t[l.indexOf(s)].value;a!==r&&(c(s),n(a))},u=e=>{let r=null;switch(e.key){case"Enter":o(e);break;case"ArrowRight":{let n=l.indexOf(e.currentTarget)+1;r=l[n]??l[0];break}case"ArrowLeft":{let n=l.indexOf(e.currentTarget)-1;r=l[n]??l[l.length-1]}}r?.focus()};return(0,s.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.A)("tabs",{"tabs--block":a},e),children:t.map(({value:e,label:n,attributes:t})=>(0,s.jsx)("li",{role:"tab",tabIndex:r===e?0:-1,"aria-selected":r===e,ref:e=>{l.push(e)},onKeyDown:u,onClick:o,...t,className:(0,i.A)("tabs__item","tabItem_LNqP",t?.className,{"tabs__item--active":r===e}),children:n??e},e))})}function b({children:e}){return(0,s.jsx)("div",{className:"margin-top--md",children:e})}function k({className:e,children:r}){return(0,s.jsxs)("div",{className:(0,i.A)(c.G.tabs.container,"tabs-container","tabList__CuJ"),children:[(0,s.jsx)(y,{className:e}),(0,s.jsx)(b,{children:r})]})}function w(e){var r;let n=(0,v.A)(),t=function(e){let r,{defaultValue:n,queryString:t=!1,groupId:s}=e,a=function(e){let{values:r,children:n}=e;return(0,l.useMemo)(()=>{let e=r??l.Children.toArray(n).flatMap(e=>{if(!e)return[];if((0,l.isValidElement)(e)&&function(e){let{props:r}=e;return!!r&&"object"==typeof r&&"value"in r}(e))return[e];let r="string"==typeof e.type?e.type:e.type.name;throw Error(`Docusaurus error: Bad <Tabs> child <${r}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.
If you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)}).map(({props:{value:e,label:r,attributes:n,default:t}})=>({value:e,label:r,attributes:n,default:t})),t=(0,h.XI)(e,(e,r)=>e.value===r.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>`'${e.value}'`).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[r,n])}(e),[i,c]=(0,l.useState)(()=>(function({defaultValue:e,tabValues:r}){if(0===r.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!x({value:e,tabValues:r}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${r.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}let n=r.find(e=>e.default)??r[0];if(!n)throw Error("Unexpected error: 0 tabValues");return n.value})({defaultValue:n,tabValues:a})),[f,p]=function({queryString:e=!1,groupId:r}){let n=(0,o.W6)(),t=function({queryString:e=!1,groupId:r}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!r)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:e,groupId:r});return[(0,d.aZ)(t),(0,l.useCallback)(e=>{if(!t)return;let r=new URLSearchParams(n.location.search);r.set(t,e),n.replace({...n.location,search:r.toString()})},[t,n])]}({queryString:t,groupId:s}),[g,j]=function({groupId:e}){let r=e?`docusaurus.tab.${e}`:null,[n,t]=(0,m.Dv)(r);return[n,(0,l.useCallback)(e=>{r&&t.set(e)},[r,t])]}({groupId:s}),v=x({value:r=f??g,tabValues:a})?r:null;return(0,u.A)(()=>{v&&c(v)},[v]),{selectedValue:i,selectValue:(0,l.useCallback)(e=>{if(!x({value:e,tabValues:a}))throw Error(`Can't select invalid tab value=${e}`);c(e),p(e),j(e)},[p,j,a]),tabValues:a,lazy:e.lazy??!1,block:e.block??!1}}(e);return(0,s.jsx)(g,{value:t,children:(0,s.jsx)(k,{className:e.className,children:(r=e.children,l.Children.toArray(r).filter(e=>"\n"!==e))})},String(n))}function A({children:e,className:r,hidden:n}){return(0,s.jsx)("div",{role:"tabpanel",className:(0,i.A)("tabItem_Ymn6",r),hidden:n,children:e})}function L({children:e,className:r,value:n}){let{selectedValue:t,lazy:a}=p(),l=n===t;return!l&&a?null:(0,s.jsx)(A,{className:r,hidden:!l,children:e})}let T={id:"platform-guide",title:"Platform-Specific Guide"},S,C={},N=[{value:"Manual management",id:"manual-management",level:3},{value:"Manual management",id:"manual-management-1",level:3},{value:"Manual management",id:"manual-management-2",level:3},{value:"Docker Status",id:"docker-status",level:2}];function M(e){let r={code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(w,{children:[(0,s.jsxs)(L,{value:"macos",label:"macOS",default:!0,children:[(0,s.jsxs)(r.p,{children:[(0,s.jsx)(r.code,{children:"mercury service install"})," creates a LaunchAgent at ",(0,s.jsx)(r.code,{children:"~/Library/LaunchAgents/com.cosmicstack.mercury.plist"}),"."]}),(0,s.jsxs)(r.ul,{children:["\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Auto-start"}),": Loads on login via ",(0,s.jsx)(r.code,{children:"launchctl load"})]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Crash recovery"}),": ",(0,s.jsx)(r.code,{children:"KeepAlive SuccessfulExit = false"})," restarts on crash"]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"No sudo needed"}),": User-level LaunchAgent, not system daemon"]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Logs"}),": ",(0,s.jsx)(r.code,{children:"~/.mercury/daemon.log"})," and ",(0,s.jsx)(r.code,{children:"~/.mercury/daemon-error.log"})]}),"\n"]}),(0,s.jsx)(r.h3,{id:"manual-management",children:"Manual management"}),(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-bash",children:"launchctl load ~/Library/LaunchAgents/com.cosmicstack.mercury.plist\nlaunchctl unload ~/Library/LaunchAgents/com.cosmicstack.mercury.plist\n"})})]}),(0,s.jsxs)(L,{value:"linux",label:"Linux",children:[(0,s.jsxs)(r.p,{children:[(0,s.jsx)(r.code,{children:"mercury service install"})," creates a systemd user unit at ",(0,s.jsx)(r.code,{children:"~/.config/systemd/user/mercury.service"}),"."]}),(0,s.jsxs)(r.ul,{children:["\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Auto-start"}),": Enabled via ",(0,s.jsx)(r.code,{children:"systemctl --user enable mercury.service"})]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Crash recovery"}),": ",(0,s.jsx)(r.code,{children:"Restart=on-failure"})," with 5s delay"]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"No sudo needed"}),": User-level service"]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Boot without login"}),": Run ",(0,s.jsx)(r.code,{children:"sudo loginctl enable-linger $USER"})," once"]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Logs"}),": ",(0,s.jsx)(r.code,{children:"~/.mercury/daemon.log"})," or ",(0,s.jsx)(r.code,{children:"journalctl --user -u mercury"})]}),"\n"]}),(0,s.jsx)(r.h3,{id:"manual-management-1",children:"Manual management"}),(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-bash",children:"systemctl --user start mercury\nsystemctl --user status mercury\nsystemctl --user stop mercury\n"})})]}),(0,s.jsxs)(L,{value:"windows",label:"Windows",children:[(0,s.jsxs)(r.p,{children:[(0,s.jsx)(r.code,{children:"mercury service install"})," creates a Windows Task Scheduler task named ",(0,s.jsx)(r.code,{children:"MercuryAgent"}),"."]}),(0,s.jsxs)(r.ul,{children:["\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Auto-start"}),": Triggers on user logon via ",(0,s.jsx)(r.code,{children:"schtasks"})]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Crash recovery"}),": Built-in watchdog with exponential backoff"]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"No admin needed"}),": Runs with limited privileges (",(0,s.jsx)(r.code,{children:"/rl limited"}),")"]}),"\n",(0,s.jsxs)(r.li,{children:[(0,s.jsx)(r.strong,{children:"Logs"}),": ",(0,s.jsx)(r.code,{children:"%USERPROFILE%\\.mercury\\daemon.log"})]}),"\n"]}),(0,s.jsx)(r.h3,{id:"manual-management-2",children:"Manual management"}),(0,s.jsx)(r.pre,{children:(0,s.jsx)(r.code,{className:"language-bash",children:'schtasks /query /tn "MercuryAgent" /fo list\nschtasks /run /tn "MercuryAgent"\nschtasks /delete /tn "MercuryAgent" /f\n'})})]})]}),"\n",(0,s.jsx)(r.h2,{id:"docker-status",children:"Docker Status"}),"\n",(0,s.jsxs)(r.p,{children:["Mercury does not currently ship first-party Docker assets in this repository (no ",(0,s.jsx)(r.code,{children:"Dockerfile"})," or ",(0,s.jsx)(r.code,{children:"docker-compose.yml"})," by default)."]}),"\n",(0,s.jsx)(r.p,{children:"If you run Mercury in a container, treat it as an advanced/custom deployment:"}),"\n",(0,s.jsxs)(r.ul,{children:["\n",(0,s.jsxs)(r.li,{children:["Prefer foreground mode (",(0,s.jsx)(r.code,{children:"mercury start --foreground"}),") inside the container"]}),"\n",(0,s.jsx)(r.li,{children:"Let the container runtime handle restart policy"}),"\n",(0,s.jsxs)(r.li,{children:["Mount ",(0,s.jsx)(r.code,{children:"~/.mercury"})," as persistent storage"]}),"\n",(0,s.jsx)(r.li,{children:"Validate terminal/TTY behavior separately for interactive CLI usage"}),"\n"]})]})}function E(e={}){let{wrapper:r}={...(0,a.R)(),...e.components};return r?(0,s.jsx)(r,{...e,children:(0,s.jsx)(M,{...e})}):M(e)}},28453(e,r,n){n.d(r,{R:()=>l,x:()=>i});var t=n(96540);let s={},a=t.createContext(s);function l(e){let r=t.useContext(a);return t.useMemo(function(){return"function"==typeof e?e(r):{...r,...e}},[r,e])}function i(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),t.createElement(a.Provider,{value:r},e.children)}}}]);