camelagi 0.5.39 → 0.5.41
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.
- package/README.md +58 -17
- package/dashboard/_next/static/chunks/172-a2787ae03f0db2b4.js +12 -0
- package/dashboard/_next/static/chunks/239-49a9ac3789f8c41c.js +1 -0
- package/dashboard/_next/static/chunks/255-102f2e5b2e3dc2ef.js +1 -0
- package/dashboard/_next/static/chunks/413-89d8e4554f461999.js +1 -0
- package/dashboard/_next/static/chunks/4bd1b696-c023c6e3521b1417.js +1 -0
- package/dashboard/_next/static/chunks/619-ba102abea3e3d0e4.js +1 -0
- package/dashboard/_next/static/chunks/909-aed3aa549e59d0fb.js +1 -0
- package/dashboard/_next/static/chunks/app/_not-found/page-121b856ce9a0ddcd.js +1 -0
- package/dashboard/_next/static/chunks/app/dashboard/agents/page-aa6e6fb2a1df7d63.js +1 -0
- package/dashboard/_next/static/chunks/app/dashboard/chat/page-feeb17fdc08b91e5.js +1 -0
- package/dashboard/_next/static/chunks/app/dashboard/config/page-afad9f4da82a343e.js +1 -0
- package/dashboard/_next/static/chunks/app/dashboard/layout-853ce5dfe3461735.js +1 -0
- package/dashboard/_next/static/chunks/app/dashboard/monitor/page-1b3d112c49b3a383.js +1 -0
- package/dashboard/_next/static/chunks/app/dashboard/page-b15605f3b21f7467.js +1 -0
- package/dashboard/_next/static/chunks/app/dashboard/sessions/page-e11d3f3e6ad99067.js +1 -0
- package/dashboard/_next/static/chunks/app/docs/[slug]/page-baf0632d98082d10.js +1 -0
- package/dashboard/_next/static/chunks/app/docs/page-5933496f46ff00ec.js +1 -0
- package/dashboard/_next/static/chunks/app/download/page-da533b5f543dfd66.js +1 -0
- package/dashboard/_next/static/chunks/app/layout-1112267c08c875b5.js +1 -0
- package/dashboard/_next/static/chunks/app/page-d69c17b39431e2c5.js +1 -0
- package/dashboard/_next/static/chunks/framework-de98b93a850cfc71.js +1 -0
- package/dashboard/_next/static/chunks/main-8d9a106db393efcf.js +1 -0
- package/dashboard/_next/static/chunks/main-app-e38cb42677e65e59.js +1 -0
- package/dashboard/_next/static/chunks/pages/_app-7d307437aca18ad4.js +1 -0
- package/dashboard/_next/static/chunks/pages/_error-cb2a52f75f2162e2.js +1 -0
- package/dashboard/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dashboard/_next/static/chunks/webpack-b2507a6fba7be451.js +1 -0
- package/dashboard/_next/static/css/c60b60dc84892a8b.css +5 -0
- package/dashboard/_next/static/css/d4ea3c83e49eb5e1.css +4 -0
- package/dashboard/_next/static/jjqY4ybx1hNTX-bnJfS2f/_buildManifest.js +1 -0
- package/dashboard/_next/static/jjqY4ybx1hNTX-bnJfS2f/_ssgManifest.js +1 -0
- package/dashboard/_next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- package/dashboard/_next/static/media/4da3161b738b07dd-s.woff2 +0 -0
- package/dashboard/_next/static/media/8d697b304b401681-s.woff2 +0 -0
- package/dashboard/_next/static/media/af4bf8399d1aacdf-s.p.woff2 +0 -0
- package/dashboard/_next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- package/dashboard/_next/static/media/fb526027db1fc1ae-s.woff2 +0 -0
- package/dashboard/agents/index.html +1 -0
- package/dashboard/agents/index.txt +28 -0
- package/dashboard/chat/index.html +1 -0
- package/dashboard/chat/index.txt +28 -0
- package/dashboard/config/index.html +1 -0
- package/dashboard/config/index.txt +28 -0
- package/dashboard/index.html +1 -0
- package/dashboard/index.txt +28 -0
- package/dashboard/monitor/index.html +1 -0
- package/dashboard/monitor/index.txt +28 -0
- package/dashboard/sessions/index.html +1 -0
- package/dashboard/sessions/index.txt +28 -0
- package/dist/agent/agent-sdk.js +66 -56
- package/dist/agent/agent-sdk.js.map +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/bootstrap.js.map +1 -1
- package/dist/cli/cmd-config.js +1 -1
- package/dist/cli/cmd-config.js.map +1 -1
- package/dist/cli/cmd-pairing.js +1 -1
- package/dist/cli/cmd-pairing.js.map +1 -1
- package/dist/core/config.js +29 -48
- package/dist/core/config.js.map +1 -1
- package/dist/core/constants.js +2 -0
- package/dist/core/constants.js.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/extensions/bot-approval.js +63 -0
- package/dist/extensions/bot-approval.js.map +1 -0
- package/dist/extensions/pairing.js +138 -0
- package/dist/extensions/pairing.js.map +1 -0
- package/dist/gateway/csrf.js +1 -1
- package/dist/gateway/csrf.js.map +1 -1
- package/dist/gateway/routes.js +31 -92
- package/dist/gateway/routes.js.map +1 -1
- package/dist/gateway/ws-handler.js +191 -167
- package/dist/gateway/ws-handler.js.map +1 -1
- package/dist/gateway-entry.js +8 -2
- package/dist/gateway-entry.js.map +1 -1
- package/dist/model.js +5 -4
- package/dist/model.js.map +1 -1
- package/dist/serve.js +20 -3
- package/dist/serve.js.map +1 -1
- package/dist/setup.js +17 -2
- package/dist/setup.js.map +1 -1
- package/dist/telegram/admin-agents.js +498 -0
- package/dist/telegram/admin-agents.js.map +1 -0
- package/dist/telegram/admin-bot.js +13 -934
- package/dist/telegram/admin-bot.js.map +1 -1
- package/dist/telegram/admin-commands.js +403 -0
- package/dist/telegram/admin-commands.js.map +1 -0
- package/dist/telegram/agent-bot.js +45 -1338
- package/dist/telegram/agent-bot.js.map +1 -1
- package/dist/telegram/agent-claude-code.js +555 -0
- package/dist/telegram/agent-claude-code.js.map +1 -0
- package/dist/telegram/agent-commands.js +396 -0
- package/dist/telegram/agent-commands.js.map +1 -0
- package/dist/telegram/agent-context.js +136 -0
- package/dist/telegram/agent-context.js.map +1 -0
- package/dist/telegram/agent-messages.js +249 -0
- package/dist/telegram/agent-messages.js.map +1 -0
- package/dist/telegram/resolve.js +15 -28
- package/dist/telegram/resolve.js.map +1 -1
- package/dist/telegram/terminal.js +75 -2
- package/dist/telegram/terminal.js.map +1 -1
- package/dist/telegram/wizards.js +1 -1
- package/dist/telegram/wizards.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[480],{1544:(e,t,s)=>{"use strict";s.d(t,{_:()=>o,G:()=>l});var a=s(5155),n=s(2115);class r{headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization="Bearer ".concat(this.token)),e}async health(){return(await fetch("".concat(this.baseUrl,"/health"),{headers:this.headers()})).json()}async sessions(){return(await fetch("".concat(this.baseUrl,"/sessions"),{headers:this.headers()})).json()}async sessionMessages(e){return(await fetch("".concat(this.baseUrl,"/sessions/").concat(e,"/messages"),{headers:this.headers()})).json()}async deleteSession(e){await fetch("".concat(this.baseUrl,"/sessions/").concat(e),{method:"DELETE",headers:this.headers()})}async agents(){return(await fetch("".concat(this.baseUrl,"/agents"),{headers:this.headers()})).json()}async createAgent(e){return(await fetch("".concat(this.baseUrl,"/agents"),{method:"POST",headers:this.headers(),body:JSON.stringify(e)})).json()}async deleteAgent(e){await fetch("".concat(this.baseUrl,"/agents/").concat(e),{method:"DELETE",headers:this.headers()})}async getAgentSoul(e){var t;let s=await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{headers:this.headers()});return null!=(t=(await s.json()).content)?t:""}async updateAgentSoul(e,t){await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{method:"PUT",headers:this.headers(),body:JSON.stringify({content:t})})}async getConfig(){return(await fetch("".concat(this.baseUrl,"/config"),{headers:this.headers()})).json()}async updateConfig(e){await fetch("".concat(this.baseUrl,"/config"),{method:"PATCH",headers:this.headers(),body:JSON.stringify(e)})}async chat(e,t){return(await fetch("".concat(this.baseUrl,"/chat"),{method:"POST",headers:this.headers(),body:JSON.stringify({message:e,session:t})})).json()}constructor(e,t){this.baseUrl=e,this.token=t}}class c{connect(){var e;if((null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN)return;let t=this.token?"".concat(this.url,"?token=").concat(this.token):this.url;this.ws=new WebSocket(t),this.ws.onopen=()=>this.emit("connected",{}),this.ws.onclose=()=>{this.emit("disconnected",{}),this.reconnectTimer=setTimeout(()=>this.connect(),3e3)},this.ws.onerror=()=>this.emit("error",{message:"WebSocket error"}),this.ws.onmessage=e=>{try{let t=JSON.parse(e.data);this.emit(t.type,t)}catch(e){}}}disconnect(){var e;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,null==(e=this.ws)||e.close(),this.ws=null}send(e){var t;(null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}sendChat(e,t,s){this.send({type:"chat",message:e,session:t,...s?{sdkSessionId:s}:{}})}switchModel(e,t,s){this.send({type:"model.switch",model:e,...t?{thinking:t}:{},...s?{effort:s}:{}})}abort(){this.send({type:"abort"})}requestSessions(){this.send({type:"sessions.list"})}requestHistory(e){this.send({type:"sessions.history",session:e})}deleteSession(e){this.send({type:"sessions.delete",id:e})}requestStatus(e){this.send({type:"status",session:e})}compact(e){this.send({type:"compact",session:e})}enterWatchMode(){this.send({type:"watch"})}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>{var s;return null==(s=this.handlers.get(e))?void 0:s.delete(t)}}emit(e,t){var s,a;null==(s=this.handlers.get(e))||s.forEach(e=>e(t)),null==(a=this.handlers.get("*"))||a.forEach(s=>s({...t,_event:e}))}get connected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}constructor(e,t){this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.url=e.replace(/^http/,"ws"),this.token=t}}let i=(0,n.createContext)({url:"",token:"",setConnection:()=>{},api:null,ws:null,connected:!1,connecting:!1,error:null});function l(){return(0,n.useContext)(i)}function o(e){let{children:t}=e,[s,l]=(0,n.useState)(""),[o,d]=(0,n.useState)(""),[h,u]=(0,n.useState)(null),[m,g]=(0,n.useState)(null),[f,x]=(0,n.useState)(!1),[p,b]=(0,n.useState)(!1),[y,w]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;let s=null!=(e=localStorage.getItem("camelagi_gateway_url"))?e:"",a=null!=(t=localStorage.getItem("camelagi_gateway_token"))?t:"";s&&(l(s),d(a))},[]),(0,n.useEffect)(()=>{if(!s)return;b(!0),w(null);let e=new r(s,o||void 0),t=new c(s,o||void 0);e.health().then(()=>{u(e),g(t),t.connect(),b(!1)}).catch(e=>{var t;w(null!=(t=e.message)?t:"Connection failed"),b(!1)});let a=t.on("connected",()=>x(!0)),n=t.on("disconnected",()=>x(!1));return()=>{a(),n(),t.disconnect()}},[s,o]);let j=(0,n.useCallback)((e,t)=>{localStorage.setItem("camelagi_gateway_url",e),localStorage.setItem("camelagi_gateway_token",t),l(e),d(t)},[]);return(0,a.jsx)(i.Provider,{value:{url:s,token:o,setConnection:j,api:h,ws:m,connected:f,connecting:p,error:y},children:t})}},3209:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>l,ZB:()=>i,Zp:()=>r,aR:()=>c});var a=s(5155);s(2115);var n=s(5016);function r(e){let{className:t,size:s="default",...r}=e;return(0,a.jsx)("div",{"data-slot":"card","data-size":s,className:(0,n.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...r})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...s})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,n.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...s})}function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-4 group-data-[size=sm]/card:px-3",t),...s})}},5016:(e,t,s)=>{"use strict";s.d(t,{cn:()=>r});var a=s(2821),n=s(5889);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.QP)((0,a.$)(t))}},5748:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var a=s(5155),n=s(2115),r=s(1544),c=s(3209);function i(){let{api:e}=(0,r.G)(),[t,s]=(0,n.useState)([]);return((0,n.useEffect)(()=>{e&&e.agents().then(s).catch(()=>{})},[e]),e)?(0,a.jsxs)("div",{className:"p-6 space-y-6",children:[(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsx)("h1",{className:"text-2xl font-bold text-[#fafafa]",children:"Agents"})}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(e=>{var t;return(0,a.jsxs)(c.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsxs)(c.aR,{className:"flex flex-row items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"h-3 w-3 rounded-full ".concat(e.running?"bg-emerald-500":"bg-[#52525b]")}),(0,a.jsx)(c.ZB,{className:"text-base text-[#fafafa]",children:e.name})]}),e.admin&&(0,a.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-[#EC9639]/10 text-[#EC9639]",children:"admin"})]}),(0,a.jsx)(c.Wu,{children:(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-[#71717a]",children:"ID"}),(0,a.jsx)("span",{className:"text-[#a1a1aa] font-mono text-xs",children:e.id})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-[#71717a]",children:"Model"}),(0,a.jsx)("span",{className:"text-[#a1a1aa]",children:e.model})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-[#71717a]",children:"Mode"}),(0,a.jsx)("span",{className:"text-[#a1a1aa]",children:null!=(t=e.mode)?t:"llm"})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-[#71717a]",children:"Telegram"}),(0,a.jsx)("span",{className:e.telegram?"text-emerald-500":"text-[#52525b]",children:e.telegram?"Connected":"No"})]})]})})]},e.id)})})]}):(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-[#71717a]",children:"Connecting..."})}},9616:(e,t,s)=>{Promise.resolve().then(s.bind(s,5748))}},e=>{e.O(0,[909,441,255,358],()=>e(e.s=9616)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[512],{1544:(e,t,s)=>{"use strict";s.d(t,{_:()=>h,G:()=>o});var n=s(5155),a=s(2115);class r{headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization="Bearer ".concat(this.token)),e}async health(){return(await fetch("".concat(this.baseUrl,"/health"),{headers:this.headers()})).json()}async sessions(){return(await fetch("".concat(this.baseUrl,"/sessions"),{headers:this.headers()})).json()}async sessionMessages(e){return(await fetch("".concat(this.baseUrl,"/sessions/").concat(e,"/messages"),{headers:this.headers()})).json()}async deleteSession(e){await fetch("".concat(this.baseUrl,"/sessions/").concat(e),{method:"DELETE",headers:this.headers()})}async agents(){return(await fetch("".concat(this.baseUrl,"/agents"),{headers:this.headers()})).json()}async createAgent(e){return(await fetch("".concat(this.baseUrl,"/agents"),{method:"POST",headers:this.headers(),body:JSON.stringify(e)})).json()}async deleteAgent(e){await fetch("".concat(this.baseUrl,"/agents/").concat(e),{method:"DELETE",headers:this.headers()})}async getAgentSoul(e){var t;let s=await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{headers:this.headers()});return null!=(t=(await s.json()).content)?t:""}async updateAgentSoul(e,t){await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{method:"PUT",headers:this.headers(),body:JSON.stringify({content:t})})}async getConfig(){return(await fetch("".concat(this.baseUrl,"/config"),{headers:this.headers()})).json()}async updateConfig(e){await fetch("".concat(this.baseUrl,"/config"),{method:"PATCH",headers:this.headers(),body:JSON.stringify(e)})}async chat(e,t){return(await fetch("".concat(this.baseUrl,"/chat"),{method:"POST",headers:this.headers(),body:JSON.stringify({message:e,session:t})})).json()}constructor(e,t){this.baseUrl=e,this.token=t}}class i{connect(){var e;if((null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN)return;let t=this.token?"".concat(this.url,"?token=").concat(this.token):this.url;this.ws=new WebSocket(t),this.ws.onopen=()=>this.emit("connected",{}),this.ws.onclose=()=>{this.emit("disconnected",{}),this.reconnectTimer=setTimeout(()=>this.connect(),3e3)},this.ws.onerror=()=>this.emit("error",{message:"WebSocket error"}),this.ws.onmessage=e=>{try{let t=JSON.parse(e.data);this.emit(t.type,t)}catch(e){}}}disconnect(){var e;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,null==(e=this.ws)||e.close(),this.ws=null}send(e){var t;(null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}sendChat(e,t,s){this.send({type:"chat",message:e,session:t,...s?{sdkSessionId:s}:{}})}switchModel(e,t,s){this.send({type:"model.switch",model:e,...t?{thinking:t}:{},...s?{effort:s}:{}})}abort(){this.send({type:"abort"})}requestSessions(){this.send({type:"sessions.list"})}requestHistory(e){this.send({type:"sessions.history",session:e})}deleteSession(e){this.send({type:"sessions.delete",id:e})}requestStatus(e){this.send({type:"status",session:e})}compact(e){this.send({type:"compact",session:e})}enterWatchMode(){this.send({type:"watch"})}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>{var s;return null==(s=this.handlers.get(e))?void 0:s.delete(t)}}emit(e,t){var s,n;null==(s=this.handlers.get(e))||s.forEach(e=>e(t)),null==(n=this.handlers.get("*"))||n.forEach(s=>s({...t,_event:e}))}get connected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}constructor(e,t){this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.url=e.replace(/^http/,"ws"),this.token=t}}let c=(0,a.createContext)({url:"",token:"",setConnection:()=>{},api:null,ws:null,connected:!1,connecting:!1,error:null});function o(){return(0,a.useContext)(c)}function h(e){let{children:t}=e,[s,o]=(0,a.useState)(""),[h,l]=(0,a.useState)(""),[d,u]=(0,a.useState)(null),[m,f]=(0,a.useState)(null),[g,w]=(0,a.useState)(!1),[y,S]=(0,a.useState)(!1),[p,b]=(0,a.useState)(null);(0,a.useEffect)(()=>{var e,t;let s=null!=(e=localStorage.getItem("camelagi_gateway_url"))?e:"",n=null!=(t=localStorage.getItem("camelagi_gateway_token"))?t:"";s&&(o(s),l(n))},[]),(0,a.useEffect)(()=>{if(!s)return;S(!0),b(null);let e=new r(s,h||void 0),t=new i(s,h||void 0);e.health().then(()=>{u(e),f(t),t.connect(),S(!1)}).catch(e=>{var t;b(null!=(t=e.message)?t:"Connection failed"),S(!1)});let n=t.on("connected",()=>w(!0)),a=t.on("disconnected",()=>w(!1));return()=>{n(),a(),t.disconnect()}},[s,h]);let v=(0,a.useCallback)((e,t)=>{localStorage.setItem("camelagi_gateway_url",e),localStorage.setItem("camelagi_gateway_token",t),o(e),l(t)},[]);return(0,n.jsx)(c.Provider,{value:{url:s,token:h,setConnection:v,api:d,ws:m,connected:g,connecting:y,error:p},children:t})}},4294:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var n=s(2115);let a=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,n.forwardRef)((e,t)=>{let{color:s="currentColor",size:i=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:h="",children:l,iconNode:d,...u}=e;return(0,n.createElement)("svg",{ref:t,...r,width:i,height:i,stroke:s,strokeWidth:o?24*Number(c)/Number(i):c,className:a("lucide",h),...u},[...d.map(e=>{let[t,s]=e;return(0,n.createElement)(t,s)}),...Array.isArray(l)?l:[l]])}),c=(e,t)=>{let s=(0,n.forwardRef)((s,r)=>{let{className:c,...o}=s;return(0,n.createElement)(i,{ref:r,iconNode:t,className:a("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),c),...o})});return s.displayName="".concat(e),s}},5296:(e,t,s)=>{Promise.resolve().then(s.bind(s,7236))},7236:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var n=s(5155),a=s(1544),r=s(7500);function i(){let{api:e}=(0,a.G)();return e?(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsxs)("div",{className:"text-center space-y-3",children:[(0,n.jsx)(r.A,{className:"h-12 w-12 text-[#EC9639] mx-auto"}),(0,n.jsx)("h2",{className:"text-xl font-bold text-[#fafafa]",children:"Chat"}),(0,n.jsx)("p",{className:"text-sm text-[#71717a]",children:"Chat interface coming soon"})]})}):(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-[#71717a]",children:"Connecting..."})}},7500:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(4294).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])}},e=>{e.O(0,[441,255,358],()=>e(e.s=5296)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[800],{1544:(e,t,s)=>{"use strict";s.d(t,{_:()=>l,G:()=>o});var a=s(5155),n=s(2115);class r{headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization="Bearer ".concat(this.token)),e}async health(){return(await fetch("".concat(this.baseUrl,"/health"),{headers:this.headers()})).json()}async sessions(){return(await fetch("".concat(this.baseUrl,"/sessions"),{headers:this.headers()})).json()}async sessionMessages(e){return(await fetch("".concat(this.baseUrl,"/sessions/").concat(e,"/messages"),{headers:this.headers()})).json()}async deleteSession(e){await fetch("".concat(this.baseUrl,"/sessions/").concat(e),{method:"DELETE",headers:this.headers()})}async agents(){return(await fetch("".concat(this.baseUrl,"/agents"),{headers:this.headers()})).json()}async createAgent(e){return(await fetch("".concat(this.baseUrl,"/agents"),{method:"POST",headers:this.headers(),body:JSON.stringify(e)})).json()}async deleteAgent(e){await fetch("".concat(this.baseUrl,"/agents/").concat(e),{method:"DELETE",headers:this.headers()})}async getAgentSoul(e){var t;let s=await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{headers:this.headers()});return null!=(t=(await s.json()).content)?t:""}async updateAgentSoul(e,t){await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{method:"PUT",headers:this.headers(),body:JSON.stringify({content:t})})}async getConfig(){return(await fetch("".concat(this.baseUrl,"/config"),{headers:this.headers()})).json()}async updateConfig(e){await fetch("".concat(this.baseUrl,"/config"),{method:"PATCH",headers:this.headers(),body:JSON.stringify(e)})}async chat(e,t){return(await fetch("".concat(this.baseUrl,"/chat"),{method:"POST",headers:this.headers(),body:JSON.stringify({message:e,session:t})})).json()}constructor(e,t){this.baseUrl=e,this.token=t}}class i{connect(){var e;if((null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN)return;let t=this.token?"".concat(this.url,"?token=").concat(this.token):this.url;this.ws=new WebSocket(t),this.ws.onopen=()=>this.emit("connected",{}),this.ws.onclose=()=>{this.emit("disconnected",{}),this.reconnectTimer=setTimeout(()=>this.connect(),3e3)},this.ws.onerror=()=>this.emit("error",{message:"WebSocket error"}),this.ws.onmessage=e=>{try{let t=JSON.parse(e.data);this.emit(t.type,t)}catch(e){}}}disconnect(){var e;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,null==(e=this.ws)||e.close(),this.ws=null}send(e){var t;(null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}sendChat(e,t,s){this.send({type:"chat",message:e,session:t,...s?{sdkSessionId:s}:{}})}switchModel(e,t,s){this.send({type:"model.switch",model:e,...t?{thinking:t}:{},...s?{effort:s}:{}})}abort(){this.send({type:"abort"})}requestSessions(){this.send({type:"sessions.list"})}requestHistory(e){this.send({type:"sessions.history",session:e})}deleteSession(e){this.send({type:"sessions.delete",id:e})}requestStatus(e){this.send({type:"status",session:e})}compact(e){this.send({type:"compact",session:e})}enterWatchMode(){this.send({type:"watch"})}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>{var s;return null==(s=this.handlers.get(e))?void 0:s.delete(t)}}emit(e,t){var s,a;null==(s=this.handlers.get(e))||s.forEach(e=>e(t)),null==(a=this.handlers.get("*"))||a.forEach(s=>s({...t,_event:e}))}get connected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}constructor(e,t){this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.url=e.replace(/^http/,"ws"),this.token=t}}let c=(0,n.createContext)({url:"",token:"",setConnection:()=>{},api:null,ws:null,connected:!1,connecting:!1,error:null});function o(){return(0,n.useContext)(c)}function l(e){let{children:t}=e,[s,o]=(0,n.useState)(""),[l,h]=(0,n.useState)(""),[d,u]=(0,n.useState)(null),[g,f]=(0,n.useState)(null),[m,p]=(0,n.useState)(!1),[w,y]=(0,n.useState)(!1),[x,b]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;let s=null!=(e=localStorage.getItem("camelagi_gateway_url"))?e:"",a=null!=(t=localStorage.getItem("camelagi_gateway_token"))?t:"";s&&(o(s),h(a))},[]),(0,n.useEffect)(()=>{if(!s)return;y(!0),b(null);let e=new r(s,l||void 0),t=new i(s,l||void 0);e.health().then(()=>{u(e),f(t),t.connect(),y(!1)}).catch(e=>{var t;b(null!=(t=e.message)?t:"Connection failed"),y(!1)});let a=t.on("connected",()=>p(!0)),n=t.on("disconnected",()=>p(!1));return()=>{a(),n(),t.disconnect()}},[s,l]);let v=(0,n.useCallback)((e,t)=>{localStorage.setItem("camelagi_gateway_url",e),localStorage.setItem("camelagi_gateway_token",t),o(e),h(t)},[]);return(0,a.jsx)(c.Provider,{value:{url:s,token:l,setConnection:v,api:d,ws:g,connected:m,connecting:w,error:x},children:t})}},2452:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var a=s(5155),n=s(2115),r=s(1544),i=s(3209),c=s(3063);function o(){let{api:e}=(0,r.G)(),[t,s]=(0,n.useState)(null);return((0,n.useEffect)(()=>{e&&e.getConfig().then(s).catch(()=>{})},[e]),e)?(0,a.jsxs)("div",{className:"p-6 space-y-6",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-[#fafafa]",children:"Configuration"}),t&&(0,a.jsxs)(i.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsx)(i.aR,{children:(0,a.jsxs)(i.ZB,{className:"text-sm font-medium text-[#a1a1aa] flex items-center gap-2",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"})," Current Config"]})}),(0,a.jsx)(i.Wu,{children:(0,a.jsx)("pre",{className:"text-xs text-[#a1a1aa] font-mono whitespace-pre-wrap overflow-auto max-h-[600px]",children:JSON.stringify(t,null,2)})})]})]}):(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-[#71717a]",children:"Connecting..."})}},3063:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(4294).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},3209:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>o,ZB:()=>c,Zp:()=>r,aR:()=>i});var a=s(5155);s(2115);var n=s(5016);function r(e){let{className:t,size:s="default",...r}=e;return(0,a.jsx)("div",{"data-slot":"card","data-size":s,className:(0,n.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...r})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,n.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...s})}function o(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-4 group-data-[size=sm]/card:px-3",t),...s})}},3872:(e,t,s)=>{Promise.resolve().then(s.bind(s,2452))},4294:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var a=s(2115);let n=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:i=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:l="",children:h,iconNode:d,...u}=e;return(0,a.createElement)("svg",{ref:t,...r,width:i,height:i,stroke:s,strokeWidth:o?24*Number(c)/Number(i):c,className:n("lucide",l),...u},[...d.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(h)?h:[h]])}),c=(e,t)=>{let s=(0,a.forwardRef)((s,r)=>{let{className:c,...o}=s;return(0,a.createElement)(i,{ref:r,iconNode:t,className:n("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),c),...o})});return s.displayName="".concat(e),s}},5016:(e,t,s)=>{"use strict";s.d(t,{cn:()=>r});var a=s(2821),n=s(5889);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.QP)((0,a.$)(t))}}},e=>{e.O(0,[909,441,255,358],()=>e(e.s=3872)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[954],{1544:(e,t,a)=>{"use strict";a.d(t,{_:()=>l,G:()=>d});var s=a(5155),n=a(2115);class r{headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization="Bearer ".concat(this.token)),e}async health(){return(await fetch("".concat(this.baseUrl,"/health"),{headers:this.headers()})).json()}async sessions(){return(await fetch("".concat(this.baseUrl,"/sessions"),{headers:this.headers()})).json()}async sessionMessages(e){return(await fetch("".concat(this.baseUrl,"/sessions/").concat(e,"/messages"),{headers:this.headers()})).json()}async deleteSession(e){await fetch("".concat(this.baseUrl,"/sessions/").concat(e),{method:"DELETE",headers:this.headers()})}async agents(){return(await fetch("".concat(this.baseUrl,"/agents"),{headers:this.headers()})).json()}async createAgent(e){return(await fetch("".concat(this.baseUrl,"/agents"),{method:"POST",headers:this.headers(),body:JSON.stringify(e)})).json()}async deleteAgent(e){await fetch("".concat(this.baseUrl,"/agents/").concat(e),{method:"DELETE",headers:this.headers()})}async getAgentSoul(e){var t;let a=await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{headers:this.headers()});return null!=(t=(await a.json()).content)?t:""}async updateAgentSoul(e,t){await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{method:"PUT",headers:this.headers(),body:JSON.stringify({content:t})})}async getConfig(){return(await fetch("".concat(this.baseUrl,"/config"),{headers:this.headers()})).json()}async updateConfig(e){await fetch("".concat(this.baseUrl,"/config"),{method:"PATCH",headers:this.headers(),body:JSON.stringify(e)})}async chat(e,t){return(await fetch("".concat(this.baseUrl,"/chat"),{method:"POST",headers:this.headers(),body:JSON.stringify({message:e,session:t})})).json()}constructor(e,t){this.baseUrl=e,this.token=t}}class i{connect(){var e;if((null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN)return;let t=this.token?"".concat(this.url,"?token=").concat(this.token):this.url;this.ws=new WebSocket(t),this.ws.onopen=()=>this.emit("connected",{}),this.ws.onclose=()=>{this.emit("disconnected",{}),this.reconnectTimer=setTimeout(()=>this.connect(),3e3)},this.ws.onerror=()=>this.emit("error",{message:"WebSocket error"}),this.ws.onmessage=e=>{try{let t=JSON.parse(e.data);this.emit(t.type,t)}catch(e){}}}disconnect(){var e;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,null==(e=this.ws)||e.close(),this.ws=null}send(e){var t;(null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}sendChat(e,t,a){this.send({type:"chat",message:e,session:t,...a?{sdkSessionId:a}:{}})}switchModel(e,t,a){this.send({type:"model.switch",model:e,...t?{thinking:t}:{},...a?{effort:a}:{}})}abort(){this.send({type:"abort"})}requestSessions(){this.send({type:"sessions.list"})}requestHistory(e){this.send({type:"sessions.history",session:e})}deleteSession(e){this.send({type:"sessions.delete",id:e})}requestStatus(e){this.send({type:"status",session:e})}compact(e){this.send({type:"compact",session:e})}enterWatchMode(){this.send({type:"watch"})}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>{var a;return null==(a=this.handlers.get(e))?void 0:a.delete(t)}}emit(e,t){var a,s;null==(a=this.handlers.get(e))||a.forEach(e=>e(t)),null==(s=this.handlers.get("*"))||s.forEach(a=>a({...t,_event:e}))}get connected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}constructor(e,t){this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.url=e.replace(/^http/,"ws"),this.token=t}}let o=(0,n.createContext)({url:"",token:"",setConnection:()=>{},api:null,ws:null,connected:!1,connecting:!1,error:null});function d(){return(0,n.useContext)(o)}function l(e){let{children:t}=e,[a,d]=(0,n.useState)(""),[l,c]=(0,n.useState)(""),[h,u]=(0,n.useState)(null),[g,p]=(0,n.useState)(null),[f,b]=(0,n.useState)(!1),[m,x]=(0,n.useState)(!1),[v,y]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;let a=null!=(e=localStorage.getItem("camelagi_gateway_url"))?e:"",s=null!=(t=localStorage.getItem("camelagi_gateway_token"))?t:"";a&&(d(a),c(s))},[]),(0,n.useEffect)(()=>{if(!a)return;x(!0),y(null);let e=new r(a,l||void 0),t=new i(a,l||void 0);e.health().then(()=>{u(e),p(t),t.connect(),x(!1)}).catch(e=>{var t;y(null!=(t=e.message)?t:"Connection failed"),x(!1)});let s=t.on("connected",()=>b(!0)),n=t.on("disconnected",()=>b(!1));return()=>{s(),n(),t.disconnect()}},[a,l]);let w=(0,n.useCallback)((e,t)=>{localStorage.setItem("camelagi_gateway_url",e),localStorage.setItem("camelagi_gateway_token",t),d(e),c(t)},[]);return(0,s.jsx)(o.Provider,{value:{url:a,token:l,setConnection:w,api:h,ws:g,connected:f,connecting:m,error:v},children:t})}},5016:(e,t,a)=>{"use strict";a.d(t,{cn:()=>r});var s=a(2821),n=a(5889);function r(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,s.$)(t))}},6470:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>q});var s=a(5155),n=a(1544),r=a(2619),i=a.n(r),o=a(63),d=a(6802),l=a(7500),c=a(5418),h=a(9915),u=a(3063),g=a(1851),p=a(2996),f=a(644);let b=[{href:"/dashboard",label:"Overview",icon:d.A},{href:"/dashboard/chat",label:"Chat",icon:l.A},{href:"/dashboard/agents",label:"Agents",icon:c.A},{href:"/dashboard/sessions",label:"Sessions",icon:h.A},{href:"/dashboard/config",label:"Config",icon:u.A},{href:"/dashboard/monitor",label:"Monitor",icon:g.A}];function m(){let e=(0,o.usePathname)(),{connected:t,url:a}=(0,n.G)();return(0,s.jsxs)("aside",{className:"w-56 border-r border-[#27272a] bg-[#0a0a0b] flex flex-col",children:[(0,s.jsxs)("div",{className:"px-4 py-5 border-b border-[#27272a]",children:[(0,s.jsx)(i(),{href:"/dashboard",className:"flex items-center gap-2",children:(0,s.jsx)("span",{className:"text-lg font-bold text-[#EC9639]",children:"CamelAGI"})}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mt-2",children:[t?(0,s.jsx)(p.A,{className:"h-3 w-3 text-emerald-500"}):(0,s.jsx)(f.A,{className:"h-3 w-3 text-red-500"}),(0,s.jsx)("span",{className:"text-[10px] text-[#71717a] truncate",children:a?new URL(a).host:"Not connected"})]})]}),(0,s.jsx)("nav",{className:"flex-1 px-2 py-3 space-y-0.5",children:b.map(t=>{let{href:a,label:n,icon:r}=t,o=e===a||"/dashboard"!==a&&e.startsWith(a);return(0,s.jsxs)(i(),{href:a,className:"flex items-center gap-3 px-3 py-2 rounded-md text-sm transition-colors ".concat(o?"bg-[#EC9639]/10 text-[#EC9639] font-medium":"text-[#a1a1aa] hover:text-[#fafafa] hover:bg-[#27272a]/50"),children:[(0,s.jsx)(r,{className:"h-4 w-4"}),n]},a)})}),(0,s.jsx)("div",{className:"px-4 py-3 border-t border-[#27272a]",children:(0,s.jsx)("p",{className:"text-[10px] text-[#52525b]",children:"CamelAGI Dashboard"})})]})}var x=a(2115),v=a(1023),y=a(5949),w=a(4915),j=a(7961),N=a(8905),k=a(989),S=a(8893),C=a(5016),_=a(9574);let E=(0,a(3101).F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function A(e){let{className:t,variant:a="default",size:n="default",...r}=e;return(0,s.jsx)(_.$,{"data-slot":"button",className:(0,C.cn)(E({variant:a,size:n,className:t})),...r})}var z=a(6615);function U(e){let{...t}=e;return(0,s.jsx)(v.D,{"data-slot":"dialog",...t})}function T(e){let{...t}=e;return(0,s.jsx)(y.Z,{"data-slot":"dialog-portal",...t})}function O(e){let{className:t,...a}=e;return(0,s.jsx)(w.X,{"data-slot":"dialog-overlay",className:(0,C.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",t),...a})}function P(e){let{className:t,children:a,showCloseButton:n=!0,...r}=e;return(0,s.jsxs)(T,{children:[(0,s.jsx)(O,{}),(0,s.jsxs)(j.h,{"data-slot":"dialog-content",className:(0,C.cn)("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r,children:[a,n&&(0,s.jsxs)(N.H,{"data-slot":"dialog-close",render:(0,s.jsx)(A,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[(0,s.jsx)(z.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function G(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,C.cn)("flex flex-col gap-2",t),...a})}function I(e){let{className:t,...a}=e;return(0,s.jsx)(k.L,{"data-slot":"dialog-title",className:(0,C.cn)("font-heading text-base leading-none font-medium",t),...a})}function L(e){let{className:t,...a}=e;return(0,s.jsx)(S.r,{"data-slot":"dialog-description",className:(0,C.cn)("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",t),...a})}var W=a(8821);function J(e){let{className:t,type:a,...n}=e;return(0,s.jsx)(W.p,{type:a,"data-slot":"input",className:(0,C.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...n})}function M(e){let{className:t,...a}=e;return(0,s.jsx)("label",{"data-slot":"label",className:(0,C.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}function D(){let{api:e,connecting:t,error:a,setConnection:r}=(0,n.G)(),[i,o]=(0,x.useState)("http://127.0.0.1:18305"),[d,l]=(0,x.useState)("");return e?null:(0,s.jsx)(U,{open:!e,children:(0,s.jsxs)(P,{className:"bg-[#0a0a0b] border-[#27272a] text-[#fafafa] sm:max-w-md",children:[(0,s.jsxs)(G,{children:[(0,s.jsx)(I,{className:"text-[#EC9639]",children:"Connect to CamelAGI"}),(0,s.jsx)(L,{className:"text-[#71717a]",children:"Enter your gateway URL to connect the dashboard."})]}),(0,s.jsxs)("div",{className:"space-y-4 py-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M,{htmlFor:"url",className:"text-[#a1a1aa]",children:"Gateway URL"}),(0,s.jsx)(J,{id:"url",value:i,onChange:e=>o(e.target.value),placeholder:"http://127.0.0.1:18305",className:"bg-[#18181b] border-[#27272a] text-[#fafafa] placeholder:text-[#52525b]"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(M,{htmlFor:"token",className:"text-[#a1a1aa]",children:"Auth Token (optional)"}),(0,s.jsx)(J,{id:"token",type:"password",value:d,onChange:e=>l(e.target.value),placeholder:"Leave empty if no token configured",className:"bg-[#18181b] border-[#27272a] text-[#fafafa] placeholder:text-[#52525b]"})]}),a&&(0,s.jsx)("p",{className:"text-sm text-red-500",children:a}),(0,s.jsx)(A,{onClick:()=>r(i,d),disabled:t||!i,className:"w-full bg-[#EC9639] text-white hover:bg-[#d07a20]",children:t?"Connecting...":"Connect"})]})]})})}function q(e){let{children:t}=e;return(0,s.jsx)(n._,{children:(0,s.jsxs)("div",{className:"flex h-screen bg-[#09090b] text-[#fafafa]",children:[(0,s.jsx)(m,{}),(0,s.jsx)("main",{className:"flex-1 overflow-auto",children:t}),(0,s.jsx)(D,{})]})})}},6563:(e,t,a)=>{Promise.resolve().then(a.bind(a,6470))}},e=>{e.O(0,[909,619,413,172,441,255,358],()=>e(e.s=6563)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[928],{264:(e,t,s)=>{Promise.resolve().then(s.bind(s,4476))},1544:(e,t,s)=>{"use strict";s.d(t,{_:()=>l,G:()=>o});var a=s(5155),n=s(2115);class r{headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization="Bearer ".concat(this.token)),e}async health(){return(await fetch("".concat(this.baseUrl,"/health"),{headers:this.headers()})).json()}async sessions(){return(await fetch("".concat(this.baseUrl,"/sessions"),{headers:this.headers()})).json()}async sessionMessages(e){return(await fetch("".concat(this.baseUrl,"/sessions/").concat(e,"/messages"),{headers:this.headers()})).json()}async deleteSession(e){await fetch("".concat(this.baseUrl,"/sessions/").concat(e),{method:"DELETE",headers:this.headers()})}async agents(){return(await fetch("".concat(this.baseUrl,"/agents"),{headers:this.headers()})).json()}async createAgent(e){return(await fetch("".concat(this.baseUrl,"/agents"),{method:"POST",headers:this.headers(),body:JSON.stringify(e)})).json()}async deleteAgent(e){await fetch("".concat(this.baseUrl,"/agents/").concat(e),{method:"DELETE",headers:this.headers()})}async getAgentSoul(e){var t;let s=await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{headers:this.headers()});return null!=(t=(await s.json()).content)?t:""}async updateAgentSoul(e,t){await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{method:"PUT",headers:this.headers(),body:JSON.stringify({content:t})})}async getConfig(){return(await fetch("".concat(this.baseUrl,"/config"),{headers:this.headers()})).json()}async updateConfig(e){await fetch("".concat(this.baseUrl,"/config"),{method:"PATCH",headers:this.headers(),body:JSON.stringify(e)})}async chat(e,t){return(await fetch("".concat(this.baseUrl,"/chat"),{method:"POST",headers:this.headers(),body:JSON.stringify({message:e,session:t})})).json()}constructor(e,t){this.baseUrl=e,this.token=t}}class i{connect(){var e;if((null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN)return;let t=this.token?"".concat(this.url,"?token=").concat(this.token):this.url;this.ws=new WebSocket(t),this.ws.onopen=()=>this.emit("connected",{}),this.ws.onclose=()=>{this.emit("disconnected",{}),this.reconnectTimer=setTimeout(()=>this.connect(),3e3)},this.ws.onerror=()=>this.emit("error",{message:"WebSocket error"}),this.ws.onmessage=e=>{try{let t=JSON.parse(e.data);this.emit(t.type,t)}catch(e){}}}disconnect(){var e;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,null==(e=this.ws)||e.close(),this.ws=null}send(e){var t;(null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}sendChat(e,t,s){this.send({type:"chat",message:e,session:t,...s?{sdkSessionId:s}:{}})}switchModel(e,t,s){this.send({type:"model.switch",model:e,...t?{thinking:t}:{},...s?{effort:s}:{}})}abort(){this.send({type:"abort"})}requestSessions(){this.send({type:"sessions.list"})}requestHistory(e){this.send({type:"sessions.history",session:e})}deleteSession(e){this.send({type:"sessions.delete",id:e})}requestStatus(e){this.send({type:"status",session:e})}compact(e){this.send({type:"compact",session:e})}enterWatchMode(){this.send({type:"watch"})}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>{var s;return null==(s=this.handlers.get(e))?void 0:s.delete(t)}}emit(e,t){var s,a;null==(s=this.handlers.get(e))||s.forEach(e=>e(t)),null==(a=this.handlers.get("*"))||a.forEach(s=>s({...t,_event:e}))}get connected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}constructor(e,t){this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.url=e.replace(/^http/,"ws"),this.token=t}}let c=(0,n.createContext)({url:"",token:"",setConnection:()=>{},api:null,ws:null,connected:!1,connecting:!1,error:null});function o(){return(0,n.useContext)(c)}function l(e){let{children:t}=e,[s,o]=(0,n.useState)(""),[l,d]=(0,n.useState)(""),[h,u]=(0,n.useState)(null),[m,g]=(0,n.useState)(null),[f,p]=(0,n.useState)(!1),[x,w]=(0,n.useState)(!1),[y,v]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;let s=null!=(e=localStorage.getItem("camelagi_gateway_url"))?e:"",a=null!=(t=localStorage.getItem("camelagi_gateway_token"))?t:"";s&&(o(s),d(a))},[]),(0,n.useEffect)(()=>{if(!s)return;w(!0),v(null);let e=new r(s,l||void 0),t=new i(s,l||void 0);e.health().then(()=>{u(e),g(t),t.connect(),w(!1)}).catch(e=>{var t;v(null!=(t=e.message)?t:"Connection failed"),w(!1)});let a=t.on("connected",()=>p(!0)),n=t.on("disconnected",()=>p(!1));return()=>{a(),n(),t.disconnect()}},[s,l]);let b=(0,n.useCallback)((e,t)=>{localStorage.setItem("camelagi_gateway_url",e),localStorage.setItem("camelagi_gateway_token",t),o(e),d(t)},[]);return(0,a.jsx)(c.Provider,{value:{url:s,token:l,setConnection:b,api:h,ws:m,connected:f,connecting:x,error:y},children:t})}},1851:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(4294).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},3209:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>o,ZB:()=>c,Zp:()=>r,aR:()=>i});var a=s(5155);s(2115);var n=s(5016);function r(e){let{className:t,size:s="default",...r}=e;return(0,a.jsx)("div",{"data-slot":"card","data-size":s,className:(0,n.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...r})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,n.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...s})}function o(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-4 group-data-[size=sm]/card:px-3",t),...s})}},4294:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var a=s(2115);let n=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:i=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:l="",children:d,iconNode:h,...u}=e;return(0,a.createElement)("svg",{ref:t,...r,width:i,height:i,stroke:s,strokeWidth:o?24*Number(c)/Number(i):c,className:n("lucide",l),...u},[...h.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(d)?d:[d]])}),c=(e,t)=>{let s=(0,a.forwardRef)((s,r)=>{let{className:c,...o}=s;return(0,a.createElement)(i,{ref:r,iconNode:t,className:n("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),c),...o})});return s.displayName="".concat(e),s}},4476:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var a=s(5155),n=s(2115),r=s(1544),i=s(3209),c=s(1851);function o(){let{ws:e}=(0,r.G)(),[t,s]=(0,n.useState)([]),[o,l]=(0,n.useState)(null);return((0,n.useEffect)(()=>{if(!e)return;e.enterWatchMode();let t=e.on("watch.snapshot",e=>l(e)),a=e.on("*",e=>{var t;(null==(t=e._event)?void 0:t.startsWith("watch."))&&"watch.snapshot"!==e._event&&s(t=>[{...e,type:e._event,ts:Date.now()},...t].slice(0,100))});return()=>{t(),a()}},[e]),e)?(0,a.jsxs)("div",{className:"p-6 space-y-6",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-[#fafafa]",children:"Live Monitor"}),o&&(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Clients",value:o.clients},{label:"Watchers",value:o.watchers},{label:"Active Runs",value:o.activeRuns},{label:"Model",value:o.model}].map(e=>{let{label:t,value:s}=e;return(0,a.jsx)(i.Zp,{className:"bg-[#18181b] border-[#27272a]",children:(0,a.jsxs)(i.Wu,{className:"pt-4",children:[(0,a.jsx)("p",{className:"text-xs text-[#71717a]",children:t}),(0,a.jsx)("p",{className:"text-lg font-bold text-[#fafafa]",children:String(null!=s?s:"—")})]})},t)})}),(0,a.jsxs)(i.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsx)(i.aR,{children:(0,a.jsxs)(i.ZB,{className:"text-sm font-medium text-[#a1a1aa] flex items-center gap-2",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"})," Event Feed"]})}),(0,a.jsx)(i.Wu,{children:(0,a.jsxs)("div",{className:"space-y-1 max-h-[500px] overflow-auto font-mono text-xs",children:[0===t.length&&(0,a.jsx)("p",{className:"text-[#52525b] text-center py-8",children:"Waiting for events..."}),t.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-start gap-3 px-2 py-1.5 rounded hover:bg-[#0a0a0b]",children:[(0,a.jsx)("span",{className:"text-[#52525b] shrink-0",children:new Date(e.ts).toLocaleTimeString()}),(0,a.jsx)("span",{className:"text-[#EC9639] shrink-0",children:e.type}),(0,a.jsx)("span",{className:"text-[#71717a] truncate",children:JSON.stringify(e)})]},t))]})})]})]}):(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-[#71717a]",children:"Connecting..."})}},5016:(e,t,s)=>{"use strict";s.d(t,{cn:()=>r});var a=s(2821),n=s(5889);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.QP)((0,a.$)(t))}}},e=>{e.O(0,[909,441,255,358],()=>e(e.s=264)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[105],{1544:(e,t,s)=>{"use strict";s.d(t,{_:()=>d,G:()=>i});var a=s(5155),n=s(2115);class r{headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization="Bearer ".concat(this.token)),e}async health(){return(await fetch("".concat(this.baseUrl,"/health"),{headers:this.headers()})).json()}async sessions(){return(await fetch("".concat(this.baseUrl,"/sessions"),{headers:this.headers()})).json()}async sessionMessages(e){return(await fetch("".concat(this.baseUrl,"/sessions/").concat(e,"/messages"),{headers:this.headers()})).json()}async deleteSession(e){await fetch("".concat(this.baseUrl,"/sessions/").concat(e),{method:"DELETE",headers:this.headers()})}async agents(){return(await fetch("".concat(this.baseUrl,"/agents"),{headers:this.headers()})).json()}async createAgent(e){return(await fetch("".concat(this.baseUrl,"/agents"),{method:"POST",headers:this.headers(),body:JSON.stringify(e)})).json()}async deleteAgent(e){await fetch("".concat(this.baseUrl,"/agents/").concat(e),{method:"DELETE",headers:this.headers()})}async getAgentSoul(e){var t;let s=await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{headers:this.headers()});return null!=(t=(await s.json()).content)?t:""}async updateAgentSoul(e,t){await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{method:"PUT",headers:this.headers(),body:JSON.stringify({content:t})})}async getConfig(){return(await fetch("".concat(this.baseUrl,"/config"),{headers:this.headers()})).json()}async updateConfig(e){await fetch("".concat(this.baseUrl,"/config"),{method:"PATCH",headers:this.headers(),body:JSON.stringify(e)})}async chat(e,t){return(await fetch("".concat(this.baseUrl,"/chat"),{method:"POST",headers:this.headers(),body:JSON.stringify({message:e,session:t})})).json()}constructor(e,t){this.baseUrl=e,this.token=t}}class l{connect(){var e;if((null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN)return;let t=this.token?"".concat(this.url,"?token=").concat(this.token):this.url;this.ws=new WebSocket(t),this.ws.onopen=()=>this.emit("connected",{}),this.ws.onclose=()=>{this.emit("disconnected",{}),this.reconnectTimer=setTimeout(()=>this.connect(),3e3)},this.ws.onerror=()=>this.emit("error",{message:"WebSocket error"}),this.ws.onmessage=e=>{try{let t=JSON.parse(e.data);this.emit(t.type,t)}catch(e){}}}disconnect(){var e;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,null==(e=this.ws)||e.close(),this.ws=null}send(e){var t;(null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}sendChat(e,t,s){this.send({type:"chat",message:e,session:t,...s?{sdkSessionId:s}:{}})}switchModel(e,t,s){this.send({type:"model.switch",model:e,...t?{thinking:t}:{},...s?{effort:s}:{}})}abort(){this.send({type:"abort"})}requestSessions(){this.send({type:"sessions.list"})}requestHistory(e){this.send({type:"sessions.history",session:e})}deleteSession(e){this.send({type:"sessions.delete",id:e})}requestStatus(e){this.send({type:"status",session:e})}compact(e){this.send({type:"compact",session:e})}enterWatchMode(){this.send({type:"watch"})}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>{var s;return null==(s=this.handlers.get(e))?void 0:s.delete(t)}}emit(e,t){var s,a;null==(s=this.handlers.get(e))||s.forEach(e=>e(t)),null==(a=this.handlers.get("*"))||a.forEach(s=>s({...t,_event:e}))}get connected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}constructor(e,t){this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.url=e.replace(/^http/,"ws"),this.token=t}}let c=(0,n.createContext)({url:"",token:"",setConnection:()=>{},api:null,ws:null,connected:!1,connecting:!1,error:null});function i(){return(0,n.useContext)(c)}function d(e){let{children:t}=e,[s,i]=(0,n.useState)(""),[d,o]=(0,n.useState)(""),[h,u]=(0,n.useState)(null),[x,m]=(0,n.useState)(null),[f,g]=(0,n.useState)(!1),[p,b]=(0,n.useState)(!1),[y,j]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;let s=null!=(e=localStorage.getItem("camelagi_gateway_url"))?e:"",a=null!=(t=localStorage.getItem("camelagi_gateway_token"))?t:"";s&&(i(s),o(a))},[]),(0,n.useEffect)(()=>{if(!s)return;b(!0),j(null);let e=new r(s,d||void 0),t=new l(s,d||void 0);e.health().then(()=>{u(e),m(t),t.connect(),b(!1)}).catch(e=>{var t;j(null!=(t=e.message)?t:"Connection failed"),b(!1)});let a=t.on("connected",()=>g(!0)),n=t.on("disconnected",()=>g(!1));return()=>{a(),n(),t.disconnect()}},[s,d]);let v=(0,n.useCallback)((e,t)=>{localStorage.setItem("camelagi_gateway_url",e),localStorage.setItem("camelagi_gateway_token",t),i(e),o(t)},[]);return(0,a.jsx)(c.Provider,{value:{url:s,token:d,setConnection:v,api:h,ws:x,connected:f,connecting:p,error:y},children:t})}},1851:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(4294).A)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},3209:(e,t,s)=>{"use strict";s.d(t,{Wu:()=>i,ZB:()=>c,Zp:()=>r,aR:()=>l});var a=s(5155);s(2115);var n=s(5016);function r(e){let{className:t,size:s="default",...r}=e;return(0,a.jsx)("div",{"data-slot":"card","data-size":s,className:(0,n.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...r})}function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,n.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,n.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...s})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-4 group-data-[size=sm]/card:px-3",t),...s})}},4294:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var a=s(2115);let n=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:i,className:d="",children:o,iconNode:h,...u}=e;return(0,a.createElement)("svg",{ref:t,...r,width:l,height:l,stroke:s,strokeWidth:i?24*Number(c)/Number(l):c,className:n("lucide",d),...u},[...h.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(o)?o:[o]])}),c=(e,t)=>{let s=(0,a.forwardRef)((s,r)=>{let{className:c,...i}=s;return(0,a.createElement)(l,{ref:r,iconNode:t,className:n("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),c),...i})});return s.displayName="".concat(e),s}},4849:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var a=s(5155),n=s(2115),r=s(1544),l=s(3209),c=s(4294);let i=(0,c.A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);var d=s(1851),o=s(5418),h=s(7500);let u=(0,c.A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);function x(){var e;let{api:t}=(0,r.G)(),[s,c]=(0,n.useState)(null),[x,m]=(0,n.useState)([]),[f,g]=(0,n.useState)([]);return((0,n.useEffect)(()=>{if(!t)return;let e=async()=>{try{let[e,s,a]=await Promise.all([t.health(),t.sessions(),t.agents()]);c(e),m(s),g(a)}catch(e){}};e();let s=setInterval(e,1e4);return()=>clearInterval(s)},[t]),t)?(0,a.jsxs)("div",{className:"p-6 space-y-6",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-[#fafafa]",children:"Dashboard"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,a.jsxs)(l.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsxs)(l.aR,{className:"flex flex-row items-center justify-between pb-2",children:[(0,a.jsx)(l.ZB,{className:"text-sm font-medium text-[#a1a1aa]",children:"Uptime"}),(0,a.jsx)(i,{className:"h-4 w-4 text-[#EC9639]"})]}),(0,a.jsx)(l.Wu,{children:(0,a.jsx)("div",{className:"text-2xl font-bold text-[#fafafa]",children:s?function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?"".concat(t,"h ").concat(s,"m"):"".concat(s,"m")}(s.uptime):"—"})})]}),(0,a.jsxs)(l.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsxs)(l.aR,{className:"flex flex-row items-center justify-between pb-2",children:[(0,a.jsx)(l.ZB,{className:"text-sm font-medium text-[#a1a1aa]",children:"Active Runs"}),(0,a.jsx)(d.A,{className:"h-4 w-4 text-emerald-500"})]}),(0,a.jsx)(l.Wu,{children:(0,a.jsx)("div",{className:"text-2xl font-bold text-[#fafafa]",children:null!=(e=null==s?void 0:s.activeRuns)?e:0})})]}),(0,a.jsxs)(l.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsxs)(l.aR,{className:"flex flex-row items-center justify-between pb-2",children:[(0,a.jsx)(l.ZB,{className:"text-sm font-medium text-[#a1a1aa]",children:"Agents"}),(0,a.jsx)(o.A,{className:"h-4 w-4 text-blue-500"})]}),(0,a.jsxs)(l.Wu,{children:[(0,a.jsx)("div",{className:"text-2xl font-bold text-[#fafafa]",children:f.length}),(0,a.jsxs)("p",{className:"text-xs text-[#71717a]",children:[f.filter(e=>e.running).length," running"]})]})]}),(0,a.jsxs)(l.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsxs)(l.aR,{className:"flex flex-row items-center justify-between pb-2",children:[(0,a.jsx)(l.ZB,{className:"text-sm font-medium text-[#a1a1aa]",children:"Sessions"}),(0,a.jsx)(h.A,{className:"h-4 w-4 text-purple-500"})]}),(0,a.jsx)(l.Wu,{children:(0,a.jsx)("div",{className:"text-2xl font-bold text-[#fafafa]",children:x.length})})]})]}),(null==s?void 0:s.lanes)&&(0,a.jsxs)(l.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsx)(l.aR,{children:(0,a.jsxs)(l.ZB,{className:"text-sm font-medium text-[#a1a1aa] flex items-center gap-2",children:[(0,a.jsx)(u,{className:"h-4 w-4"})," Concurrency Lanes"]})}),(0,a.jsx)(l.Wu,{children:(0,a.jsx)("div",{className:"grid grid-cols-3 gap-4",children:Object.entries(s.lanes).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,a.jsx)("span",{className:"text-[#a1a1aa] capitalize",children:t}),(0,a.jsxs)("span",{className:"text-[#71717a]",children:[s.active,"/",s.limit]})]}),(0,a.jsx)("div",{className:"h-2 bg-[#27272a] rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-[#EC9639] rounded-full transition-all",style:{width:"".concat(s.active/s.limit*100,"%")}})})]},t)})})})]}),(0,a.jsxs)(l.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsx)(l.aR,{children:(0,a.jsxs)(l.ZB,{className:"text-sm font-medium text-[#a1a1aa] flex items-center gap-2",children:[(0,a.jsx)(o.A,{className:"h-4 w-4"})," Agents"]})}),(0,a.jsx)(l.Wu,{children:(0,a.jsxs)("div",{className:"space-y-2",children:[f.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-md bg-[#0a0a0b]",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(e.running?"bg-emerald-500":"bg-[#52525b]")}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-[#fafafa]",children:e.name}),(0,a.jsxs)("p",{className:"text-xs text-[#71717a]",children:[e.model,e.admin?" \xb7 admin":""]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[e.telegram&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[#2AABEE]/10 text-[#2AABEE]",children:"TG"}),"claude-code"===e.mode&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[#EC9639]/10 text-[#EC9639]",children:"CC"})]})]},e.id)),0===f.length&&(0,a.jsx)("p",{className:"text-sm text-[#52525b] text-center py-4",children:"No agents configured"})]})})]}),(0,a.jsxs)(l.Zp,{className:"bg-[#18181b] border-[#27272a]",children:[(0,a.jsx)(l.aR,{children:(0,a.jsxs)(l.ZB,{className:"text-sm font-medium text-[#a1a1aa] flex items-center gap-2",children:[(0,a.jsx)(h.A,{className:"h-4 w-4"})," Recent Sessions"]})}),(0,a.jsx)(l.Wu,{children:(0,a.jsxs)("div",{className:"space-y-1",children:[x.slice(0,5).map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-md hover:bg-[#0a0a0b] transition-colors",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-[#fafafa]",children:null!=(t=e.label)?t:e.id}),(0,a.jsx)("p",{className:"text-xs text-[#71717a]",children:e.model})]}),(0,a.jsx)("p",{className:"text-xs text-[#52525b]",children:new Date(e.createdAt).toLocaleDateString()})]},e.id)}),0===x.length&&(0,a.jsx)("p",{className:"text-sm text-[#52525b] text-center py-4",children:"No sessions yet"})]})})]})]}):(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-[#71717a]",children:"Connecting..."})}},5016:(e,t,s)=>{"use strict";s.d(t,{cn:()=>r});var a=s(2821),n=s(5889);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.QP)((0,a.$)(t))}},5418:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(4294).A)("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])},7500:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(4294).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},7561:(e,t,s)=>{Promise.resolve().then(s.bind(s,4849))}},e=>{e.O(0,[909,441,255,358],()=>e(e.s=7561)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[719],{1544:(e,t,s)=>{"use strict";s.d(t,{_:()=>l,G:()=>o});var a=s(5155),n=s(2115);class r{headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization="Bearer ".concat(this.token)),e}async health(){return(await fetch("".concat(this.baseUrl,"/health"),{headers:this.headers()})).json()}async sessions(){return(await fetch("".concat(this.baseUrl,"/sessions"),{headers:this.headers()})).json()}async sessionMessages(e){return(await fetch("".concat(this.baseUrl,"/sessions/").concat(e,"/messages"),{headers:this.headers()})).json()}async deleteSession(e){await fetch("".concat(this.baseUrl,"/sessions/").concat(e),{method:"DELETE",headers:this.headers()})}async agents(){return(await fetch("".concat(this.baseUrl,"/agents"),{headers:this.headers()})).json()}async createAgent(e){return(await fetch("".concat(this.baseUrl,"/agents"),{method:"POST",headers:this.headers(),body:JSON.stringify(e)})).json()}async deleteAgent(e){await fetch("".concat(this.baseUrl,"/agents/").concat(e),{method:"DELETE",headers:this.headers()})}async getAgentSoul(e){var t;let s=await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{headers:this.headers()});return null!=(t=(await s.json()).content)?t:""}async updateAgentSoul(e,t){await fetch("".concat(this.baseUrl,"/agents/").concat(e,"/soul"),{method:"PUT",headers:this.headers(),body:JSON.stringify({content:t})})}async getConfig(){return(await fetch("".concat(this.baseUrl,"/config"),{headers:this.headers()})).json()}async updateConfig(e){await fetch("".concat(this.baseUrl,"/config"),{method:"PATCH",headers:this.headers(),body:JSON.stringify(e)})}async chat(e,t){return(await fetch("".concat(this.baseUrl,"/chat"),{method:"POST",headers:this.headers(),body:JSON.stringify({message:e,session:t})})).json()}constructor(e,t){this.baseUrl=e,this.token=t}}class i{connect(){var e;if((null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN)return;let t=this.token?"".concat(this.url,"?token=").concat(this.token):this.url;this.ws=new WebSocket(t),this.ws.onopen=()=>this.emit("connected",{}),this.ws.onclose=()=>{this.emit("disconnected",{}),this.reconnectTimer=setTimeout(()=>this.connect(),3e3)},this.ws.onerror=()=>this.emit("error",{message:"WebSocket error"}),this.ws.onmessage=e=>{try{let t=JSON.parse(e.data);this.emit(t.type,t)}catch(e){}}}disconnect(){var e;this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,null==(e=this.ws)||e.close(),this.ws=null}send(e){var t;(null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}sendChat(e,t,s){this.send({type:"chat",message:e,session:t,...s?{sdkSessionId:s}:{}})}switchModel(e,t,s){this.send({type:"model.switch",model:e,...t?{thinking:t}:{},...s?{effort:s}:{}})}abort(){this.send({type:"abort"})}requestSessions(){this.send({type:"sessions.list"})}requestHistory(e){this.send({type:"sessions.history",session:e})}deleteSession(e){this.send({type:"sessions.delete",id:e})}requestStatus(e){this.send({type:"status",session:e})}compact(e){this.send({type:"compact",session:e})}enterWatchMode(){this.send({type:"watch"})}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>{var s;return null==(s=this.handlers.get(e))?void 0:s.delete(t)}}emit(e,t){var s,a;null==(s=this.handlers.get(e))||s.forEach(e=>e(t)),null==(a=this.handlers.get("*"))||a.forEach(s=>s({...t,_event:e}))}get connected(){var e;return(null==(e=this.ws)?void 0:e.readyState)===WebSocket.OPEN}constructor(e,t){this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.url=e.replace(/^http/,"ws"),this.token=t}}let c=(0,n.createContext)({url:"",token:"",setConnection:()=>{},api:null,ws:null,connected:!1,connecting:!1,error:null});function o(){return(0,n.useContext)(c)}function l(e){let{children:t}=e,[s,o]=(0,n.useState)(""),[l,h]=(0,n.useState)(""),[d,u]=(0,n.useState)(null),[m,y]=(0,n.useState)(null),[f,x]=(0,n.useState)(!1),[w,g]=(0,n.useState)(!1),[p,v]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;let s=null!=(e=localStorage.getItem("camelagi_gateway_url"))?e:"",a=null!=(t=localStorage.getItem("camelagi_gateway_token"))?t:"";s&&(o(s),h(a))},[]),(0,n.useEffect)(()=>{if(!s)return;g(!0),v(null);let e=new r(s,l||void 0),t=new i(s,l||void 0);e.health().then(()=>{u(e),y(t),t.connect(),g(!1)}).catch(e=>{var t;v(null!=(t=e.message)?t:"Connection failed"),g(!1)});let a=t.on("connected",()=>x(!0)),n=t.on("disconnected",()=>x(!1));return()=>{a(),n(),t.disconnect()}},[s,l]);let b=(0,n.useCallback)((e,t)=>{localStorage.setItem("camelagi_gateway_url",e),localStorage.setItem("camelagi_gateway_token",t),o(e),h(t)},[]);return(0,a.jsx)(c.Provider,{value:{url:s,token:l,setConnection:b,api:d,ws:m,connected:f,connecting:w,error:p},children:t})}},4294:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var a=s(2115);let n=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:i=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:l="",children:h,iconNode:d,...u}=e;return(0,a.createElement)("svg",{ref:t,...r,width:i,height:i,stroke:s,strokeWidth:o?24*Number(c)/Number(i):c,className:n("lucide",l),...u},[...d.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(h)?h:[h]])}),c=(e,t)=>{let s=(0,a.forwardRef)((s,r)=>{let{className:c,...o}=s;return(0,a.createElement)(i,{ref:r,iconNode:t,className:n("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),c),...o})});return s.displayName="".concat(e),s}},4413:(e,t,s)=>{Promise.resolve().then(s.bind(s,5416))},5416:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var a=s(5155),n=s(2115),r=s(1544);let i=(0,s(4294).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var c=s(9915);function o(){let{api:e}=(0,r.G)(),[t,s]=(0,n.useState)([]),[o,l]=(0,n.useState)(null),[h,d]=(0,n.useState)([]);(0,n.useEffect)(()=>{e&&e.sessions().then(s).catch(()=>{})},[e]);let u=async t=>{e&&(l(t),d(await e.sessionMessages(t)))},m=async t=>{e&&(await e.deleteSession(t),s(e=>e.filter(e=>e.id!==t)),o===t&&(l(null),d([])))};return e?(0,a.jsxs)("div",{className:"flex h-full",children:[(0,a.jsxs)("div",{className:"w-72 border-r border-[#27272a] overflow-auto",children:[(0,a.jsx)("div",{className:"p-4 border-b border-[#27272a]",children:(0,a.jsxs)("h2",{className:"text-sm font-medium text-[#a1a1aa]",children:["Sessions (",t.length,")"]})}),(0,a.jsx)("div",{className:"p-2 space-y-0.5",children:t.map(e=>{var t;return(0,a.jsxs)("div",{onClick:()=>u(e.id),className:"flex items-center justify-between px-3 py-2 rounded-md cursor-pointer transition-colors ".concat(o===e.id?"bg-[#EC9639]/10 text-[#EC9639]":"text-[#a1a1aa] hover:bg-[#27272a]/50"),children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm truncate",children:null!=(t=e.label)?t:e.id}),(0,a.jsxs)("p",{className:"text-[10px] text-[#52525b]",children:[e.model," \xb7 ",new Date(e.createdAt).toLocaleDateString()]})]}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),m(e.id)},className:"p-1 rounded hover:bg-red-500/10 text-[#52525b] hover:text-red-500",children:(0,a.jsx)(i,{className:"h-3 w-3"})})]},e.id)})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto p-6",children:o?(0,a.jsx)("div",{className:"space-y-3 max-w-3xl mx-auto",children:h.map((e,t)=>(0,a.jsx)("div",{className:"flex ".concat("user"===e.role?"justify-end":"justify-start"),children:(0,a.jsx)("div",{className:"max-w-[80%] px-4 py-2.5 rounded-2xl text-sm ".concat("user"===e.role?"bg-[#EC9639] text-white rounded-br-sm":"tool"===e.role?"bg-[#1a1a2e] text-[#a1a1aa] font-mono text-xs border border-[#27272a]":"bg-[#18181b] text-[#e4e4e7] rounded-bl-sm"),children:(0,a.jsx)("pre",{className:"whitespace-pre-wrap font-sans",children:e.content})})},t))}):(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsxs)("div",{className:"text-center space-y-3",children:[(0,a.jsx)(c.A,{className:"h-12 w-12 text-[#52525b] mx-auto"}),(0,a.jsx)("p",{className:"text-sm text-[#71717a]",children:"Select a session to view history"})]})})})]}):(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-[#71717a]",children:"Connecting..."})}},9915:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(4294).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])}},e=>{e.O(0,[441,255,358],()=>e(e.s=4413)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[508],{1561:(e,t,n)=>{"use strict";n.d(t,{DocsSidebar:()=>c});var l=n(5155),a=n(2619),r=n.n(a);function s(e){let{docs:t,activeSlug:n}=e,a=new Map;for(let e of t){var s;let t=null!=(s=a.get(e.category))?s:[];t.push(e),a.set(e.category,t)}return(0,l.jsx)(l.Fragment,{children:[...a.entries()].map(e=>{let[t,a]=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wider text-dark-400 mb-2",children:t}),(0,l.jsx)("ul",{className:"space-y-1",children:a.map(e=>(0,l.jsx)("li",{children:(0,l.jsx)(r(),{href:"/docs/".concat(e.slug),className:"block px-3 py-1.5 rounded-md text-sm transition-colors ".concat(e.slug===n?"bg-accent-500/10 text-accent-500 font-medium":"text-dark-300 hover:text-dark-100 hover:bg-dark-800/50"),children:e.title})},e.slug))})]},t)})})}function c(e){var t,n,a,c;let{guideDocs:o,devDocs:i,activeSlug:d,activeSection:u}=e;return(0,l.jsxs)("nav",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex rounded-lg bg-dark-800/30 p-1",children:[(0,l.jsx)(r(),{href:"/docs/".concat(null!=(a=null==(t=o[0])?void 0:t.slug)?a:"guide-install"),className:"flex-1 text-center text-xs font-medium py-1.5 rounded-md transition-colors ".concat("guide"===u?"bg-accent-500/15 text-accent-500":"text-dark-400 hover:text-dark-200"),children:"Guide"}),(0,l.jsx)(r(),{href:"/docs/".concat(null!=(c=null==(n=i[0])?void 0:n.slug)?c:"getting-started"),className:"flex-1 text-center text-xs font-medium py-1.5 rounded-md transition-colors ".concat("developer"===u?"bg-accent-500/15 text-accent-500":"text-dark-400 hover:text-dark-200"),children:"Developer"})]}),(0,l.jsx)(s,{docs:"guide"===u?o:i,activeSlug:d})]})}},5930:(e,t,n)=>{"use strict";n.d(t,{DocsContent:()=>i});var l=n(5155),a=n(2115);let r=new Set(["language-bash","language-sh","language-shell"]),s=new Set(["language-yaml","language-json"]),c='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';function o(e,t){let n=document.createElement("button");n.className="copy-btn",n.innerHTML="".concat(c,"<span>Copy</span>"),n.addEventListener("click",()=>{navigator.clipboard.writeText(t().trim());let e=n.querySelector("span");e&&(e.textContent="Copied!",setTimeout(()=>{e.textContent="Copy"},2e3))}),e.appendChild(n)}function i(e){let{html:t}=e,n=(0,a.useRef)(null),[i,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{d(!0)},[]),(0,a.useEffect)(()=>{i&&n.current&&function(e){for(let n of Array.from(e.querySelectorAll("pre"))){if(n.closest(".code-block"))continue;let e=n.querySelector("code"),l=function(e){if(!e)return null;for(let t of e.classList)if(t.startsWith("language-"))return t;return null}(e),a=n.parentNode;if(a)if(l&&r.has(l)){var t;let l=(null!=(t=null==e?void 0:e.textContent)?t:"").split("\n").filter(e=>e.trim()&&!e.trim().startsWith("#")),r=document.createElement("div");r.className="code-block code-terminal";let s=document.createElement("div");if(s.className="terminal-header",s.innerHTML='<div class="terminal-dots"><span></span><span></span><span></span></div><span class="terminal-title">Terminal</span>',r.appendChild(s),l.length<=1)a.insertBefore(r,n),r.appendChild(n),1===l.length&&o(r,()=>l[0]);else{let e=document.createElement("div");for(let t of(e.className="terminal-body",l)){let n=document.createElement("div");n.className="terminal-row";let l=document.createElement("code");l.className="terminal-cmd",l.textContent=t;let a=document.createElement("button");a.className="terminal-copy",a.innerHTML=c,a.title="Copy",a.addEventListener("click",()=>{navigator.clipboard.writeText(t.trim()),a.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#28c840" stroke-width="2"><path d="M20 6L9 17l-5-5"/></svg>',setTimeout(()=>{a.innerHTML=c},1500)}),n.appendChild(l),n.appendChild(a),e.appendChild(n)}r.appendChild(e),a.insertBefore(r,n),n.remove()}}else if(l&&s.has(l)){let t=document.createElement("div");t.className="code-block code-copyable",a.insertBefore(t,n),t.appendChild(n),o(t,()=>{var t;return null!=(t=null==e?void 0:e.textContent)?t:""})}else{let e=document.createElement("div");e.className="code-block code-output",a.insertBefore(e,n),e.appendChild(n)}}}(n.current)},[i,t]),(0,l.jsx)("article",{ref:n,className:"prose-docs",dangerouslySetInnerHTML:{__html:t}})}},7835:(e,t,n)=>{Promise.resolve().then(n.bind(n,5930)),Promise.resolve().then(n.bind(n,1561))}},e=>{e.O(0,[619,441,255,358],()=>e(e.s=7835)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[40],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[351],{3587:(e,t,n)=>{Promise.resolve().then(n.bind(n,9799))},9799:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});var s=n(5155),i=n(2115);function r(){return(0,i.useEffect)(()=>{window.location.href="https://github.com/inawafalm/CamelAGI"},[]),(0,s.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-dark-900 text-dark-50",children:(0,s.jsx)("p",{children:"Redirecting to download..."})})}}},e=>{e.O(0,[441,255,358],()=>e(e.s=3587)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{127:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_188709",variable:"__variable_188709"}},1290:()=>{},1725:(e,t,a)=>{"use strict";a.d(t,{Header:()=>l});var n=a(5155),o=a(5239),s=a(2115),r=a(5508);function l(){let{locale:e,setLocale:t,t:a}=(0,r.o)(),[l,i]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=()=>i(window.scrollY>10);return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]),(0,n.jsx)("header",{className:["fixed top-0 left-0 right-0 z-50 flex items-center justify-center px-4 sm:px-6 md:px-8 transition-all duration-200",l?"pt-4 pb-4":"h-16"].join(" "),children:(0,n.jsxs)("nav",{className:["mx-auto flex w-full max-w-6xl items-center justify-between gap-2 px-4 py-2 sm:px-6 md:px-8 transition-all duration-300",l?"rounded-2xl bg-dark-900/80 backdrop-blur-xl shadow-xl shadow-black/10 ring-1 ring-dark-500/10":""].join(" "),children:[(0,n.jsx)("a",{href:"/",className:"flex items-center gap-2 sm:gap-3 shrink-0 no-underline",children:(0,n.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[(0,n.jsx)(o.default,{src:"/logo.png?v=3",alt:"",width:24,height:24,className:"rounded-lg shrink-0 object-contain sm:rounded-xl h-6 w-6 sm:h-7 sm:w-7",priority:!0}),(0,n.jsx)("span",{className:"text-base font-semibold truncate sm:text-lg",children:a.brand})]})}),(0,n.jsx)("div",{className:"min-w-0 flex-1"}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2 shrink-0",children:[(0,n.jsx)("a",{href:"/docs/guide-install",className:"rounded-full px-3 py-1.5 text-sm font-medium text-dark-300 hover:text-dark-100 transition-colors sm:px-4 sm:py-2",children:a.nav.docs}),(0,n.jsxs)("a",{href:"https://github.com/inawafalm/CamelAGI",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full bg-accent-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-accent-400 transition-colors sm:gap-2 sm:px-4 sm:py-2",children:[(0,n.jsx)("svg",{viewBox:"0 0 16 16",className:"h-4 w-4 fill-current","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),a.nav.download]})]})]})})}},3143:e=>{e.exports={style:{fontFamily:"'Fraunces', 'Fraunces Fallback'",fontStyle:"normal"},className:"__className_acf54a",variable:"__variable_acf54a"}},5508:(e,t,a)=>{"use strict";a.d(t,{LanguageProvider:()=>l,o:()=>i});var n=a(5155),o=a(2115);let s={en:{brand:"CamelAGI",nav:{docs:"Docs",download:"GitHub"},hero:{badge:"Open Source",title:"Your Personal AI Agent",titleAccent:"powered by Claude Agent SDK",descLead:"Your Personal AI Agent ",descLeadAccent:"powered by Claude Agent SDK",descSub:"Set it up once, manage everything from Telegram.",descSub2:"Self-hosted AI assistant with admin bot, multi-agent support, and two-tier memory.\nClaude Agent SDK with a Telegram control plane.",ctaDownload:"GitHub",ctaDemo:"View on GitHub"},features:{title:"Why CamelAGI",noVps:"Claude Agent SDK",noVpsDesc:"Same runtime that powers Claude Code — native tool use, thinking, subagents",noTerminal:"Telegram Admin Bot",noTerminalDesc:"Create agents, configure server, approve tools — all from your phone",local:"Two-Tier Memory",localDesc:"Curated MEMORY.md + daily auto-journaling with recency-boosted search",llm:"Multi-Provider",llmDesc:"Anthropic, OpenAI, OpenRouter, Ollama — any OpenAI-compatible endpoint"},steps:{title:"Three steps",download:"Install",downloadDesc:"npm install -g camelagi",connect:"Setup",connectDesc:"camel setup",chat:"Manage from Telegram",chatDesc:"Create agents, configure AI"},manageAgents:{titlePrefix:"Manage your AI agents\nfrom ",titleAccent:"Telegram",desc:"Full control — create agents, switch models, approve tools, manage config. No terminal needed."},howItWorks:{badge:"How it works",title:"Four channels, one agent runtime.",whatItMeans:"Terminal, Telegram, Discord, or Claude Code — same agent, same tools, same memory.",cards:[{title:"Claude Code via Telegram",desc:"Run Claude Code on your local machine, controlled from Telegram. /claudecode to start — browse directories, switch models, manage sessions. Your local CLI, remote-controlled from your phone."},{title:"camel chat — Terminal UI",desc:"Full TUI with streaming, slash commands, model switching, session management, tool output, and markdown rendering."},{title:"Telegram — Admin Bot",desc:"Your @BotFather for AI agents. Create, configure, and manage agents entirely from Telegram — instant commands, zero tokens burned."},{title:"Telegram — Agent Bots",desc:"Each agent gets its own Telegram bot. Message it like any chat — it runs tools, reads files, remembers context. Full Claude Agent SDK capabilities from your phone."},{title:"Discord Bots",desc:"Per-agent Discord bots with mention-only mode, role filtering, and channel restrictions. Same agent runtime, tools, and memory."},{title:"Agent Memory",desc:"Each agent gets isolated two-tier memory — curated MEMORY.md + daily auto-journaling with recency-boosted search. Powered by Claude Agent SDK."},{title:"Voice Transcription",desc:"Send voice messages to agent bots — transcribed via Groq, OpenAI, or Deepgram and processed as text."},{title:"MCP Servers",desc:"Connect external tool servers (stdio, HTTP, SSE). Global or per-agent. Add/remove from Telegram with /mcp."},{title:"Brief Mode",desc:"Toggle short text-message-style replies per chat or per agent — ideal for Telegram conversations."},{title:"Usage Tracking",desc:"Per-agent token usage and cost breakdown — input, output, cache reads, API calls."},{title:"Agent Cloning",desc:"Clone an existing agent with all its config, personality, memory, and MCP servers."},{title:"Extended Thinking",desc:"Claude reasons step by step before answering. Configure depth: off, low, medium, high."},{title:"Cron Jobs",desc:"Schedule AI tasks — daily summaries, monitoring, automations. Intervals, cron expressions, or one-shot timers."},{title:"Tool Approvals",desc:"Human-in-the-loop safety. Approve dangerous operations from Telegram with inline buttons — even headless."},{title:"Multi-Provider",desc:"Anthropic, OpenAI, OpenRouter, Ollama — any OpenAI-compatible endpoint. Zero vendor lock-in."},{title:"Secure Pairing",desc:"OTP-based user verification. No hardcoded IDs — pairing code + 5-digit OTP from Telegram."},{title:"Skills & Hooks",desc:"Teach agents skills via markdown. Run shell/JS hooks before and after tool calls."},{title:"Auto Compaction",desc:"Summarizes old turns at 80% capacity. Flushes facts to memory first — nothing is lost."},{title:"Same Engine",desc:"All three channels run the same agent loop, same 10 tools, same two-tier memory. Switch freely between them."}]},getStarted:{badge:"Get started",title:"Up and running in under a minute",steps:["npm i -g camelagi","camel setup","Create agents from Telegram"],tagline:"Open source. Self-hosted. Your data stays yours."},integrations:{badge:"Integrations",title:"Connect your apps",desc:"Telegram available now \xb7 REST API \xb7 WebSocket \xb7 Terminal UI",available:"Available",soon:"Soon"},pricing:{badge:"Open Source",title:"Free forever",desc:"MIT licensed \xb7 Self-hosted \xb7 Bring your own API key",monthly:"",monthlyByok:"",perMonth:"",discount:"FREE",creditsLabel:"",creditsNote:"",promoPrefix:"",promoSuffix:"",approximate:"",plans:[]},comingSoon:{badge:"Roadmap",title:"What's next for CamelAGI",desc:"We're building CamelAGI to be the most capable open-source AI platform — for individuals and businesses alike.",cards:[{icon:"\uD83D\uDCE1",title:"More Channels",desc:"WhatsApp, Slack — connect your AI agents to every platform your team already uses."},{icon:"\uD83E\uDDE9",title:"ClawHub Skills",desc:"Browse and install community skills from clawhub.io — one command to add new capabilities to any agent."},{icon:"\uD83C\uDFE2",title:"Business Ready",desc:"Deploy CamelAGI for your business — finance, accounting, operations, customer support. AI agents that understand your workflows."}]},cta:{title:"Ready to run your own AI agent?",desc:"Open source. One command to start.",download:"Get Started",talk:"View on GitHub"},footer:{tagline:"Personal AI agent powered by Claude Agent SDK.",byline:"Open source \xb7 MIT License \xb7 \xa9 2026 Nawaf Almutairi & Brickell Lab, Kuwait"},lang:{en:"English",ar:"عربي"},mock:{clickToOpen:"Click to open",clickToConnect:"Click to connect",gatewayStopped:"Server is stopped",startGateway:"Start Server",replay:"Replay",easyAsThis:["As easy as this … to run your own AI agent","using CamelAGI"]}}},r=(0,o.createContext)(null);function l(e){let{children:t}=e,a=s.en;return(0,n.jsx)(r.Provider,{value:{locale:"en",setLocale:()=>{},t:a,isTransitioning:!1},children:t})}function i(){let e=(0,o.useContext)(r);if(!e)throw Error("useLanguage must be used within LanguageProvider");return e}},8171:(e,t,a)=>{Promise.resolve().then(a.bind(a,1725)),Promise.resolve().then(a.bind(a,5508)),Promise.resolve().then(a.t.bind(a,3143,23)),Promise.resolve().then(a.t.bind(a,127,23)),Promise.resolve().then(a.t.bind(a,1290,23))}},e=>{e.O(0,[138,741,239,441,255,358],()=>e(e.s=8171)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{2936:(e,t,s)=>{Promise.resolve().then(s.bind(s,3381))},3381:(e,t,s)=>{"use strict";s.d(t,{HomeContent:()=>v});var a=s(5155),r=s(2115),l=s(5239),n=s(1083),o=s(9881),i=s(3101),d=s(5016);let c=(0,i.F)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function x(e){var t;let{className:s,variant:a="default",render:r,...l}=e;return t={defaultTagName:"span",props:(0,n.v6)({className:(0,d.cn)(c({variant:a}),s)},l),render:r,state:{slot:"badge",variant:a}},(0,o.o)(t.defaultTagName??"div",t,t)}var m=s(5508);function h(e){let{steps:t,tagline:s,title:l}=e,n=(0,r.useRef)(null),[o,i]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=n.current;if(!e)return;let s=[],a=new IntersectionObserver(e=>{let[a]=e;a.isIntersecting?function e(){i(0),s=[];let a=[0,3e3,6e3];for(let e=0;e<t.length;e++){var r;s.push(setTimeout(()=>i(t=>Math.max(t,e+1)),null!=(r=a[e])?r:1500*e))}s.push(setTimeout(e,8e3))}():(s.forEach(e=>clearTimeout(e)),s=[],i(0))},{threshold:.2});return a.observe(e),()=>{a.disconnect(),s.forEach(e=>clearTimeout(e))}},[t.length]),(0,a.jsx)("div",{ref:n,className:"space-y-6 min-w-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:gap-12 min-w-0",children:[(0,a.jsxs)("div",{className:"order-2 flex-1 lg:order-1",children:[(0,a.jsx)("h3",{className:"font-display text-xl font-bold text-dark-50",children:l}),(0,a.jsx)("div",{className:"mt-6 space-y-4",children:t.map((e,t)=>{let s=t<o;return(0,a.jsxs)("div",{className:"flex items-start gap-3 transition-all duration-500",style:{opacity:s?1:.4,transform:s?"translateX(0)":"translateX(-12px)"},children:[(0,a.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-semibold transition-all duration-300 ".concat(s?"bg-accent-500 text-white":"bg-dark-600 text-dark-400"),children:t+1}),(0,a.jsx)("span",{className:"pt-1 text-base text-dark-200 font-mono",children:e})]},t)})}),(0,a.jsx)("p",{className:"mt-6 text-sm font-medium text-accent-600",children:s})]}),(0,a.jsx)("div",{className:"order-1 w-full max-w-[560px] lg:order-2 lg:flex-1 lg:shrink-0",children:(0,a.jsx)(p,{step:o})})]})})}function p(e){let{step:t}=e;return(0,a.jsxs)("div",{className:"w-full max-w-[560px] overflow-hidden rounded-xl border border-dark-600 bg-dark-900/80 shadow-xl",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-dark-600 bg-dark-800/80 px-4 py-3",children:[(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-dark-500"}),(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-dark-500"}),(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-dark-500"}),(0,a.jsx)("span",{className:"ml-2 text-xs text-dark-500",children:"Terminal"})]}),(0,a.jsxs)("div",{className:"min-h-[200px] h-[260px] p-4 sm:p-6 transition-all duration-500 font-mono text-sm",children:[t<1&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-dark-500",children:[(0,a.jsx)("span",{className:"text-4xl",children:"↓"}),(0,a.jsx)("p",{className:"mt-2 text-sm font-sans",children:"Scroll to begin"})]}),t>=1&&t<2&&(0,a.jsxs)("div",{className:"animate-fade-in space-y-2",children:[(0,a.jsxs)("p",{className:"text-dark-500",children:["$ ",(0,a.jsx)("span",{className:"text-accent-400",children:"npm i -g camelagi"})]}),(0,a.jsx)("p",{className:"text-dark-400",children:"Installing CamelAGI..."}),(0,a.jsx)("p",{className:"text-green-400 mt-2",children:"✔ camelagi installed"})]}),t>=2&&t<3&&(0,a.jsxs)("div",{className:"animate-fade-in space-y-2",children:[(0,a.jsxs)("p",{className:"text-dark-500",children:["$ ",(0,a.jsx)("span",{className:"text-accent-400",children:"camel setup"})]}),(0,a.jsx)("p",{className:"text-dark-300 mt-2",children:" CamelAGI Bootstrap"}),(0,a.jsx)("p",{className:"text-green-400",children:" ✔ Bot valid: @MyBot"}),(0,a.jsx)("p",{className:"text-green-400",children:" ✔ Server running"}),(0,a.jsx)("p",{className:"text-green-400",children:" ✔ @you verified!"})]}),t>=3&&(0,a.jsxs)("div",{className:"animate-fade-in space-y-2",children:[(0,a.jsxs)("p",{className:"text-dark-500",children:["Telegram: ",(0,a.jsx)("span",{className:"text-accent-400",children:"@MyBot"})]}),(0,a.jsx)("p",{className:"text-dark-300 mt-2",children:"You: /newagent"}),(0,a.jsx)("p",{className:"text-dark-300",children:"Bot: What should I call this agent?"}),(0,a.jsx)("p",{className:"text-dark-300",children:"You: Coder"}),(0,a.jsx)("p",{className:"text-green-400 mt-1",children:'✅ Agent "Coder" created and live!'})]})]})]})}let u=[{text:"$ camel setup",style:"cmd",delay:0},{text:"",style:"blank",delay:600},{text:" CamelAGI setup",style:"title",delay:800},{text:"",style:"blank",delay:1200},{text:" How do you want to use CamelAGI?",style:"step",delay:1500},{text:" ○ Terminal (TUI)",style:"option",delay:2200},{text:" ○ Telegram",style:"option",delay:2600},{text:" › Both",style:"selected",delay:3400},{text:"",style:"blank",delay:4200},{text:" Provider",style:"step",delay:4600},{text:" ○ OpenAI",style:"option",delay:5200},{text:" ○ OpenRouter",style:"option",delay:5500},{text:" › Anthropic",style:"selected",delay:6200},{text:" Model",style:"step",delay:7600},{text:" › claude-opus-4-6",style:"selected",delay:8400},{text:" ✔ anthropic / claude-opus-4-6",style:"success",delay:9200},{text:"",style:"blank",delay:1e4},{text:" Telegram Admin Bot",style:"step",delay:10400},{text:" Create a bot via @BotFather → /newbot",style:"dim",delay:11e3},{text:" Bot token: ••••••:AAH••••••••••",style:"input",delay:12e3},{text:" ✔ Bot valid: @CamelAdmin",style:"success",delay:13e3},{text:" ✔ Admin bot running",style:"success",delay:13800},{text:"",style:"blank",delay:14400},{text:" ℹ Send any message to @CamelAdmin",style:"step",delay:14800},{text:" ✔ Request from @you",style:"success",delay:17e3},{text:" Approve @you? (Y/n): Y",style:"input",delay:18e3},{text:" ✔ @you approved!",style:"success",delay:19e3},{text:"",style:"blank",delay:19600},{text:" ✅ Setup complete!",style:"complete",delay:20200}],g=[{from:"you",text:"/newbot",delay:10800},{from:"bot",text:"Alright, a new bot.\nWhat name for your bot?",delay:11400},{from:"you",text:"CamelAdmin",delay:12200},{from:"bot",text:"Done! \uD83C\uDF89\nToken: 874••••:AAH••••",delay:12800}],b=[{from:"you",text:"/start",delay:16200},{from:"bot",text:"Access requested.\nWaiting for approval...",delay:16800},{from:"bot",text:"Access approved!\nYou are now the admin.",delay:19200},{from:"you",text:"/newagent",delay:21600},{from:"bot",text:"Agent name?",delay:22400},{from:"you",text:"Coder",delay:23400},{from:"bot",text:'✅ Agent "Coder" created!\n→ @CoderBot is live',delay:24400}];function f(){let e=(0,r.useRef)(null),t=(0,r.useRef)(null),[s,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(0),[d,c]=(0,r.useState)(0),[x,m]=(0,r.useState)("botfather"),[h,p]=(0,r.useState)(0),[f,y]=(0,r.useState)(!1),[v,j]=(0,r.useState)("term"),w=(0,r.useRef)(null);(0,r.useEffect)(()=>{let t=e.current;if(!t)return;let s=new IntersectionObserver(e=>{let[t]=e;t.isIntersecting&&y(!0)},{threshold:.2});return s.observe(t),()=>s.disconnect()},[]),(0,r.useEffect)(()=>{let e=w.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[o,d]),(0,r.useEffect)(()=>{if(!f)return;let e=[];n(0),i(0),c(0),m("botfather");for(let t=0;t<u.length;t++)e.push(setTimeout(()=>n(t+1),u[t].delay));for(let t=0;t<g.length;t++)e.push(setTimeout(()=>i(t+1),g[t].delay));e.push(setTimeout(()=>m("admin"),15400));for(let t=0;t<b.length;t++)e.push(setTimeout(()=>c(t+1),b[t].delay));return j("term"),e.push(setTimeout(()=>j("phone"),10600)),e.push(setTimeout(()=>j("term"),13400)),e.push(setTimeout(()=>j("phone"),15400)),e.push(setTimeout(()=>j("term"),17e3)),e.push(setTimeout(()=>j("phone"),19200)),e.push(setTimeout(()=>j("term"),20200)),e.push(setTimeout(()=>j("phone"),21600)),e.push(setTimeout(()=>j("both"),25e3)),e.push(setTimeout(()=>p(e=>e+1),28e3)),()=>e.forEach(e=>clearTimeout(e))},[h,f]);let N={cmd:"text-accent-400",title:"text-cyan-400 font-semibold",step:"text-cyan-400",success:"text-green-400",dim:"text-dark-500",option:"text-dark-500",selected:"text-cyan-300 font-semibold",input:"text-dark-200",box:"text-cyan-500/60","box-highlight":"text-yellow-400 font-bold",complete:"text-cyan-400 font-semibold",blank:""};return(0,a.jsxs)("div",{ref:e,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_340px] gap-6 mb-2",children:[(0,a.jsx)("div",{className:"flex items-center justify-center lg:justify-center gap-2",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2.5 rounded-full bg-dark-800/80 border border-dark-500/40 px-5 py-2.5 text-[15px] font-bold text-dark-100 shadow-lg shadow-black/10",children:[(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-green-400 shadow-[0_0_8px_rgba(74,222,128,0.5)]"}),"Your Server / Mac"]})}),(0,a.jsx)("div",{className:"hidden lg:flex items-center justify-center gap-2",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2.5 rounded-full bg-[#2AABEE]/10 border border-[#2AABEE]/30 px-5 py-2.5 text-[15px] font-bold text-[#2AABEE] shadow-lg shadow-[#2AABEE]/5",children:[(0,a.jsx)("svg",{viewBox:"0 0 24 24",className:"h-[18px] w-[18px] fill-current","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_340px] gap-6 items-stretch",children:[(0,a.jsxs)("div",{className:"w-full overflow-hidden rounded-2xl border border-dark-600 bg-[#1a1a2e] shadow-2xl shadow-black/30 transition-opacity duration-500 ".concat("phone"===v?"opacity-40":"opacity-100"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-dark-600/50 bg-[#16162a] px-4 py-2.5",children:[(0,a.jsx)("span",{className:"h-3 w-3 rounded-full bg-[#ff5f57]"}),(0,a.jsx)("span",{className:"h-3 w-3 rounded-full bg-[#febc2e]"}),(0,a.jsx)("span",{className:"h-3 w-3 rounded-full bg-[#28c840]"}),(0,a.jsx)("span",{className:"ml-3 text-xs text-dark-500 font-mono",children:"camel — setup"})]}),(0,a.jsxs)("div",{ref:t,className:"min-h-[520px] h-[520px] p-5 font-mono text-[13px] leading-[1.8] space-y-0 overflow-hidden pointer-events-none",children:[u.map((e,t)=>{var r;return(0,a.jsx)("div",{className:"transition-all duration-300 ".concat(null!=(r=N[e.style])?r:"text-dark-300"),style:{opacity:+(t<s),transform:t<s?"translateY(0)":"translateY(6px)"},children:e.text||"\xa0"},"".concat(h,"-t-").concat(t))}),(0,a.jsx)("span",{className:"inline-block w-2 h-4 bg-dark-400 animate-pulse"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsx)("div",{className:"lg:hidden flex items-center justify-center gap-2 mb-4",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2.5 rounded-full bg-[#2AABEE]/10 border border-[#2AABEE]/30 px-5 py-2.5 text-[15px] font-bold text-[#2AABEE] shadow-lg shadow-[#2AABEE]/5",children:[(0,a.jsx)("svg",{viewBox:"0 0 24 24",className:"h-[18px] w-[18px] fill-current",children:(0,a.jsx)("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]})}),(0,a.jsx)("div",{className:"w-[300px] shrink-0 transition-opacity duration-500 ".concat("term"===v?"opacity-40":"opacity-100"),children:(0,a.jsx)("div",{className:"relative rounded-[3rem] bg-[#1a1a1a] p-[3px] shadow-[0_0_60px_rgba(0,0,0,0.5),0_0_0_1px_rgba(255,255,255,0.05)]",children:(0,a.jsx)("div",{className:"rounded-[2.85rem] bg-gradient-to-b from-[#3a3a3a] to-[#2a2a2a] p-[2px]",children:(0,a.jsxs)("div",{className:"rounded-[2.7rem] bg-black overflow-hidden h-[620px] flex flex-col",children:[(0,a.jsxs)("div",{className:"relative bg-[#17212b] px-6 pt-3 pb-0 flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold text-white",children:"9:41"}),(0,a.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 top-2 h-[22px] w-[90px] rounded-full bg-black"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsxs)("svg",{viewBox:"0 0 17 10",className:"w-4 h-2.5 fill-white",children:[(0,a.jsx)("rect",{x:"0",y:"6",width:"3",height:"4",rx:"0.5"}),(0,a.jsx)("rect",{x:"4.5",y:"4",width:"3",height:"6",rx:"0.5"}),(0,a.jsx)("rect",{x:"9",y:"1.5",width:"3",height:"8.5",rx:"0.5"}),(0,a.jsx)("rect",{x:"13.5",y:"0",width:"3",height:"10",rx:"0.5"})]}),(0,a.jsx)("svg",{viewBox:"0 0 15 12",className:"w-3.5 h-3 fill-white",children:(0,a.jsx)("path",{d:"M7.5 9.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-3.5-3a5 5 0 0 1 7 0 .75.75 0 0 1-1 1 3.5 3.5 0 0 0-5 0 .75.75 0 0 1-1-1zm-3-3a8.5 8.5 0 0 1 13 0 .75.75 0 0 1-1 1 7 7 0 0 0-11 0 .75.75 0 0 1-1-1z"})}),(0,a.jsxs)("svg",{viewBox:"0 0 25 12",className:"w-6 h-3",children:[(0,a.jsx)("rect",{x:"0",y:"0",width:"22",height:"12",rx:"2.5",stroke:"white",strokeWidth:"1",fill:"none"}),(0,a.jsx)("rect",{x:"2",y:"2",width:"16",height:"8",rx:"1",fill:"#30D158"}),(0,a.jsx)("path",{d:"M23 4v4a2 2 0 0 0 0-4z",fill:"white",opacity:"0.4"})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5 bg-[#17212b] px-3 py-2.5 border-b border-[#0e1621]",children:[(0,a.jsx)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 text-[#6ab2f2] shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,a.jsx)("path",{d:"M15 19l-7-7 7-7"})}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(l.default,{src:"/logo.png?v=3",alt:"",width:36,height:36,className:"h-9 w-9 rounded-full object-cover"}),(0,a.jsx)("div",{className:"absolute -bottom-0.5 -right-0.5 h-3 w-3 rounded-full bg-[#4dcd5e] border-2 border-[#17212b]"})]}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-white truncate",children:"botfather"===x?"BotFather":"CamelAdmin"}),(0,a.jsx)("p",{className:"text-[12px] text-[#6ab2f2]",children:"botfather"===x?"bot":"online"})]}),(0,a.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 text-[#6ab2f2] shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,a.jsx)("path",{d:"m20 20-3.5-3.5"})]}),(0,a.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 text-[#6ab2f2] shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,a.jsx)("circle",{cx:"12",cy:"5",r:"1"}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"1"}),(0,a.jsx)("circle",{cx:"12",cy:"19",r:"1"})]})]}),(0,a.jsx)("div",{ref:w,className:"bg-[#0c1118] bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMjAiIGN5PSIyMCIgcj0iMC41IiBmaWxsPSIjMWEyNTM1Ii8+PC9zdmc+')] h-[440px] flex-1 overflow-y-auto px-2.5 py-3 space-y-1.5 scrollbar-hide",children:("botfather"===x?g:b).map((e,t)=>{if(t>=("botfather"===x?o:d))return null;let s="you"===e.from;return(0,a.jsx)("div",{className:"flex ".concat(s?"justify-end":"justify-start"," animate-fade-in"),children:(0,a.jsxs)("div",{className:"relative max-w-[80%] px-2.5 py-1.5 whitespace-pre-line ".concat(s?"bg-[#2b5278] text-white rounded-[16px] rounded-br-[4px]":"bg-[#182533] text-[#f5f5f5] rounded-[16px] rounded-bl-[4px]"),children:[(0,a.jsx)("p",{className:"text-[13px] leading-[1.45]",children:e.text}),(0,a.jsxs)("div",{className:"flex items-center gap-1 justify-end mt-0.5 ".concat(s?"text-[#6ab3e3]":"text-[#5d7d90]"),children:[(0,a.jsxs)("span",{className:"text-[10px]",children:[Math.floor(9+.3*t),":",String(Math.floor(41+3*t)%60).padStart(2,"0")]}),s&&(0,a.jsxs)("svg",{viewBox:"0 0 16 10",className:"w-3.5 h-2 fill-current",children:[(0,a.jsx)("path",{d:"M1 5l3 3L14 1",strokeWidth:"0"}),(0,a.jsx)("path",{d:"M4 5l3 3L14 1",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),(0,a.jsx)("path",{d:"M1 5l3 3",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]})]})]})},"".concat(h,"-").concat(x,"-").concat(t))})}),(0,a.jsxs)("div",{className:"bg-[#17212b] border-t border-[#0e1621] px-2 py-1.5 flex items-end gap-1",children:[(0,a.jsx)("button",{type:"button",className:"p-2 text-[#6ab2f2]",children:(0,a.jsx)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,a.jsx)("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),(0,a.jsx)("div",{className:"flex-1 rounded-[20px] bg-[#242f3d] px-3 py-2 min-h-[36px] flex items-center",children:(0,a.jsx)("span",{className:"text-[14px] text-[#6b7c8a]",children:"Message"})}),(0,a.jsx)("button",{type:"button",className:"p-2 text-[#6ab2f2]",children:(0,a.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),(0,a.jsx)("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),(0,a.jsx)("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})}),(0,a.jsx)("button",{type:"button",className:"p-2 text-[#6ab2f2]",children:(0,a.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[(0,a.jsx)("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),(0,a.jsx)("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),(0,a.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"23"})]})})]}),(0,a.jsx)("div",{className:"flex justify-center py-1.5 bg-[#17212b]",children:(0,a.jsx)("div",{className:"h-[5px] w-[120px] rounded-full bg-white/20"})})]})})})})]})]})]})}function y(e){let{text:t,className:s}=e,l=(0,r.useRef)(null),[n,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=l.current;if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;return t.isIntersecting&&o(!0)},{threshold:.3});return t.observe(e),()=>t.disconnect()},[]);let i=Array.from(t);return(0,a.jsx)("span",{ref:l,className:s,children:i.map((e,t)=>(0,a.jsx)("span",{className:"inline-block",style:{opacity:+!!n,transform:n?"translateY(0)":"translateY(0.5em)",transition:"opacity 0.3s ease ".concat(.05*t,"s, transform 0.3s ease ").concat(.05*t,"s")},children:e},t))})}function v(){let{t:e,locale:t}=(0,m.o)();return(0,a.jsxs)("div",{className:"relative min-h-screen bg-dark-900 text-dark-50",children:[(0,a.jsx)("div",{className:"noise"}),(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-hero-glow"}),(0,a.jsx)("section",{className:"relative z-10 mx-auto max-w-6xl px-4 pt-6 pb-8 sm:px-6 sm:pt-8",children:(0,a.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 w-full",children:[(0,a.jsxs)("div",{className:"w-full flex flex-col items-center gap-2",children:[(0,a.jsx)("span",{dir:"ltr",className:"inline-flex items-center justify-center rounded-full bg-accent-500/25 text-accent-700 border border-accent-500/50 px-3 py-1.5 text-[10px] font-semibold tracking-wider uppercase shadow-[0_0_20px_rgba(139,90,60,0.2)]",children:e.hero.badge}),(0,a.jsx)("span",{className:"inline-flex items-center rounded-full bg-[#f97316]/15 border border-[#f97316]/30 px-3 py-1 text-[10px] font-medium text-black",children:"OpenClaw Alternative"})]}),(0,a.jsx)(l.default,{src:"/logo.png?v=3",alt:"",width:280,height:280,className:"rounded-2xl object-contain w-[180px] h-[180px] sm:w-[240px] sm:h-[240px] md:w-[280px] md:h-[280px]"})]}),(0,a.jsxs)("div",{className:"mt-4 w-full max-w-2xl mx-auto",children:[(0,a.jsxs)("h1",{className:"font-display text-xl font-bold leading-snug sm:text-2xl md:text-3xl text-center",children:[e.hero.descLead,(0,a.jsx)("span",{className:"text-accent-500",children:e.hero.descLeadAccent})]}),(0,a.jsx)("p",{className:"mt-2 text-sm sm:text-base text-dark-400 whitespace-pre-line",children:e.hero.descSub2})]}),(0,a.jsx)("div",{className:"mt-5 flex flex-col sm:flex-row flex-wrap gap-3 justify-center",children:(0,a.jsxs)("a",{href:"https://github.com/inawafalm/CamelAGI",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 rounded-full font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-500 focus-visible:ring-offset-2 focus-visible:ring-offset-dark-900 bg-accent-500 text-white hover:bg-accent-400 shadow-glow hover:shadow-glow-lg transition-all duration-300 h-12 px-7 text-base w-full sm:w-auto",children:[(0,a.jsx)("svg",{viewBox:"0 0 16 16",className:"h-5 w-5 fill-current","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),e.hero.ctaDownload]})})]})}),(0,a.jsx)("section",{className:"relative z-10 border-t border-dark-700 bg-dark-800/20",children:(0,a.jsxs)("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6 sm:py-16",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-8 lg:flex-row lg:items-start lg:gap-12",children:[(0,a.jsxs)("div",{className:"flex-1 text-center lg:text-start",children:[(0,a.jsxs)("h2",{className:"font-display text-2xl font-bold sm:text-3xl text-dark-50 whitespace-pre-line",children:[e.manageAgents.titlePrefix,(0,a.jsx)(y,{text:e.manageAgents.titleAccent,className:"text-accent-500"})]}),(0,a.jsx)("p",{className:"mt-4 text-base sm:text-lg text-dark-300",children:e.manageAgents.desc})]}),(0,a.jsx)("div",{className:"flex-1"})]}),(0,a.jsx)("div",{className:"mt-12",children:(0,a.jsx)(f,{})})]})}),(0,a.jsx)("section",{id:"how-it-works",className:"relative z-10 border-t border-dark-700 bg-dark-800/20 scroll-mt-24",children:(0,a.jsxs)("div",{className:"mx-auto max-w-5xl px-4 py-12 sm:px-6 sm:py-16",children:[(0,a.jsx)(x,{variant:"outline",className:"mb-6 block w-fit mx-auto text-base sm:text-lg px-4 py-2",children:e.howItWorks.badge}),(0,a.jsx)("h2",{className:"font-display text-2xl font-bold sm:text-3xl text-dark-50 text-center",children:e.howItWorks.title}),(0,a.jsx)("p",{className:"mt-3 text-base text-dark-400 text-center",children:e.howItWorks.whatItMeans}),(0,a.jsx)("div",{className:"mt-10 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-5",children:e.howItWorks.cards.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-2xl border p-6 transition-all hover:scale-[1.02] hover:shadow-xl ".concat(["border-[#d97706]/30 bg-[#d97706]/5","border-cyan-500/30 bg-cyan-500/5","border-[#2AABEE]/30 bg-[#2AABEE]/5","border-accent-500/30 bg-accent-500/5","border-[#5865F2]/30 bg-[#5865F2]/5","border-purple-500/30 bg-purple-500/5","border-pink-500/30 bg-pink-500/5","border-teal-500/30 bg-teal-500/5","border-yellow-500/30 bg-yellow-500/5","border-emerald-500/30 bg-emerald-500/5","border-violet-500/30 bg-violet-500/5","border-indigo-500/30 bg-indigo-500/5","border-orange-500/30 bg-orange-500/5","border-red-500/30 bg-red-500/5","border-sky-500/30 bg-sky-500/5","border-rose-500/30 bg-rose-500/5","border-amber-500/30 bg-amber-500/5","border-blue-500/30 bg-blue-500/5","border-green-500/30 bg-green-500/5"][t]),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,a.jsx)("span",{className:"text-2xl",children:["\uD83D\uDCBB","⌨️","\uD83E\uDD16","\uD83D\uDCAC","\uD83C\uDFAE","\uD83E\uDDE0","\uD83C\uDF99️","\uD83D\uDD0C","\uD83D\uDCCB","\uD83D\uDCCA","\uD83E\uDDEC","\uD83D\uDCAD","⏰","\uD83D\uDEE1️","\uD83D\uDD01","\uD83D\uDD10","\uD83E\uDE9D","\uD83D\uDD04","⚙️"][t]}),(0,a.jsx)("h4",{className:"text-lg font-bold text-dark-50",children:e.title})]}),(0,a.jsx)("p",{className:"text-sm leading-relaxed text-dark-300",children:e.desc})]},t))}),(0,a.jsxs)("div",{className:"mt-10 mx-auto max-w-lg rounded-2xl border border-dark-600 bg-dark-900/60 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 border-b border-dark-600/50 bg-dark-800/60 px-4 py-2.5",children:[(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-dark-500"}),(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-dark-500"}),(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-dark-500"}),(0,a.jsx)("span",{className:"ml-2 text-xs text-dark-500 font-mono",children:"Agent Memory Structure"})]}),(0,a.jsxs)("pre",{className:"p-5 text-[13px] leading-relaxed font-mono text-dark-300 overflow-x-auto",children:["~/.camelagi/\n├── agents/\n│ ├── ",(0,a.jsx)("span",{className:"text-green-400",children:"coder/"}),"\n│ │ ├── SOUL.md ",(0,a.jsx)("span",{className:"text-cyan-400",children:"← personality"}),"\n│ │ ├── MEMORY.md ",(0,a.jsx)("span",{className:"text-cyan-400",children:"← curated knowledge"}),"\n│ │ └── memory/\n│ │ └── 2026-03-14.md ",(0,a.jsx)("span",{className:"text-cyan-400",children:"← daily auto-journal"}),"\n│ └── ",(0,a.jsx)("span",{className:"text-green-400",children:"researcher/"}),"\n│ ├── SOUL.md ",(0,a.jsx)("span",{className:"text-cyan-400",children:"← personality"}),"\n│ ├── MEMORY.md ",(0,a.jsx)("span",{className:"text-cyan-400",children:"← curated knowledge"}),"\n│ └── memory/\n│ └── 2026-03-14.md ",(0,a.jsx)("span",{className:"text-cyan-400",children:"← daily auto-journal"}),"\n└── config.yaml"]})]})]})}),(0,a.jsx)("section",{className:"relative z-10 border-t border-dark-700 bg-dark-800/20",children:(0,a.jsxs)("div",{className:"mx-auto max-w-4xl px-4 py-12 sm:px-6 sm:py-16",children:[(0,a.jsx)(x,{variant:"outline",className:"mb-4 block w-fit mx-auto text-base sm:text-lg px-4 py-2",children:"Comparison"}),(0,a.jsx)("h2",{className:"font-display text-2xl font-bold sm:text-3xl text-dark-50 text-center",children:"Claude Agent SDK vs pi-agent"}),(0,a.jsxs)("p",{className:"mt-3 text-center text-base text-dark-400",children:["CamelAGI uses ",(0,a.jsx)("strong",{className:"text-dark-200",children:"Claude Agent SDK"}),". OpenClaw uses ",(0,a.jsx)("strong",{className:"text-dark-200",children:"pi-agent-core"}),"."]}),(0,a.jsx)("div",{className:"mt-10 overflow-hidden rounded-2xl border border-dark-600",children:(0,a.jsxs)("table",{className:"w-full text-base",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"bg-dark-800/80 border-b border-dark-600",children:[(0,a.jsx)("th",{className:"px-5 py-4 text-start text-dark-400 font-bold text-lg"}),(0,a.jsx)("th",{className:"px-5 py-4 text-start text-accent-400 font-bold text-lg",children:"Claude Agent SDK"}),(0,a.jsx)("th",{className:"px-5 py-4 text-start text-dark-400 font-bold text-lg",children:"pi-agent-core"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-dark-700",children:[["Built by","Anthropic","Third-party"],["Tool use","Native function calling","Custom protocol"],["Thinking","Extended thinking built-in","Not available"],["Subagents","Native agent spawning","Custom implementation"],["Prompt caching","Built-in, automatic","Manual"],["Memory","Two-tier + recency boost","Vector DB (LanceDB)"],["Streaming","Native SSE streaming","Custom streaming"],["Upgrades","npm update","Manual maintenance"]].map(e=>{let[t,s,r]=e;return(0,a.jsxs)("tr",{className:"bg-dark-900/40 hover:bg-dark-800/40 transition-colors",children:[(0,a.jsx)("td",{className:"px-5 py-4 font-semibold text-dark-200",children:t}),(0,a.jsx)("td",{className:"px-5 py-4 text-dark-100",children:s}),(0,a.jsx)("td",{className:"px-5 py-4 text-dark-500",children:r})]},t)})})]})}),(0,a.jsx)("p",{className:"mt-6 text-center text-sm text-dark-400 max-w-2xl mx-auto",children:"Claude Agent SDK is Anthropic's own runtime. When Anthropic ships improvements to tool use, thinking, or context handling, CamelAGI gets them automatically."})]})}),(0,a.jsx)("section",{id:"get-started",className:"relative z-10 overflow-x-hidden border-t border-dark-700 bg-dark-800/20 scroll-mt-24",children:(0,a.jsxs)("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6 sm:py-16",children:[(0,a.jsx)(x,{variant:"outline",className:"mb-6 block w-fit mx-auto text-base sm:text-lg px-4 py-2",children:e.getStarted.badge}),(0,a.jsx)(h,{title:e.getStarted.title,steps:e.getStarted.steps,tagline:e.getStarted.tagline})]})}),(0,a.jsx)("footer",{className:"relative z-10 border-t border-dark-700",children:(0,a.jsx)("div",{className:"mx-auto max-w-6xl px-4 py-6 sm:px-6",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.default,{src:"/logo.png?v=3",alt:"",width:28,height:28,className:"rounded object-contain"}),(0,a.jsx)("span",{className:"text-sm text-dark-400",children:e.brand})]}),(0,a.jsx)("p",{className:"text-xs text-dark-500",children:e.footer.tagline}),(0,a.jsx)("p",{className:"text-xs text-dark-600",children:e.footer.byline}),(0,a.jsx)("div",{className:"flex items-center gap-3 mt-1",children:(0,a.jsxs)("a",{href:"https://x.com/inawafalm",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-dark-500 hover:text-dark-200 transition-colors",children:[(0,a.jsx)("svg",{viewBox:"0 0 24 24",className:"h-3.5 w-3.5 fill-current","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.746l7.73-8.835L1.254 2.25H8.08l4.253 5.622 5.911-5.622zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"@inawafalm"]})}),(0,a.jsx)("p",{className:"text-xs text-dark-600",children:"Made with ❤️ in Kuwait"})]})})})]})}},5016:(e,t,s)=>{"use strict";s.d(t,{cn:()=>l});var a=s(2821),r=s(5889);function l(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.QP)((0,a.$)(t))}},5508:(e,t,s)=>{"use strict";s.d(t,{LanguageProvider:()=>o,o:()=>i});var a=s(5155),r=s(2115);let l={en:{brand:"CamelAGI",nav:{docs:"Docs",download:"GitHub"},hero:{badge:"Open Source",title:"Your Personal AI Agent",titleAccent:"powered by Claude Agent SDK",descLead:"Your Personal AI Agent ",descLeadAccent:"powered by Claude Agent SDK",descSub:"Set it up once, manage everything from Telegram.",descSub2:"Self-hosted AI assistant with admin bot, multi-agent support, and two-tier memory.\nClaude Agent SDK with a Telegram control plane.",ctaDownload:"GitHub",ctaDemo:"View on GitHub"},features:{title:"Why CamelAGI",noVps:"Claude Agent SDK",noVpsDesc:"Same runtime that powers Claude Code — native tool use, thinking, subagents",noTerminal:"Telegram Admin Bot",noTerminalDesc:"Create agents, configure server, approve tools — all from your phone",local:"Two-Tier Memory",localDesc:"Curated MEMORY.md + daily auto-journaling with recency-boosted search",llm:"Multi-Provider",llmDesc:"Anthropic, OpenAI, OpenRouter, Ollama — any OpenAI-compatible endpoint"},steps:{title:"Three steps",download:"Install",downloadDesc:"npm install -g camelagi",connect:"Setup",connectDesc:"camel setup",chat:"Manage from Telegram",chatDesc:"Create agents, configure AI"},manageAgents:{titlePrefix:"Manage your AI agents\nfrom ",titleAccent:"Telegram",desc:"Full control — create agents, switch models, approve tools, manage config. No terminal needed."},howItWorks:{badge:"How it works",title:"Four channels, one agent runtime.",whatItMeans:"Terminal, Telegram, Discord, or Claude Code — same agent, same tools, same memory.",cards:[{title:"Claude Code via Telegram",desc:"Run Claude Code on your local machine, controlled from Telegram. /claudecode to start — browse directories, switch models, manage sessions. Your local CLI, remote-controlled from your phone."},{title:"camel chat — Terminal UI",desc:"Full TUI with streaming, slash commands, model switching, session management, tool output, and markdown rendering."},{title:"Telegram — Admin Bot",desc:"Your @BotFather for AI agents. Create, configure, and manage agents entirely from Telegram — instant commands, zero tokens burned."},{title:"Telegram — Agent Bots",desc:"Each agent gets its own Telegram bot. Message it like any chat — it runs tools, reads files, remembers context. Full Claude Agent SDK capabilities from your phone."},{title:"Discord Bots",desc:"Per-agent Discord bots with mention-only mode, role filtering, and channel restrictions. Same agent runtime, tools, and memory."},{title:"Agent Memory",desc:"Each agent gets isolated two-tier memory — curated MEMORY.md + daily auto-journaling with recency-boosted search. Powered by Claude Agent SDK."},{title:"Voice Transcription",desc:"Send voice messages to agent bots — transcribed via Groq, OpenAI, or Deepgram and processed as text."},{title:"MCP Servers",desc:"Connect external tool servers (stdio, HTTP, SSE). Global or per-agent. Add/remove from Telegram with /mcp."},{title:"Brief Mode",desc:"Toggle short text-message-style replies per chat or per agent — ideal for Telegram conversations."},{title:"Usage Tracking",desc:"Per-agent token usage and cost breakdown — input, output, cache reads, API calls."},{title:"Agent Cloning",desc:"Clone an existing agent with all its config, personality, memory, and MCP servers."},{title:"Extended Thinking",desc:"Claude reasons step by step before answering. Configure depth: off, low, medium, high."},{title:"Cron Jobs",desc:"Schedule AI tasks — daily summaries, monitoring, automations. Intervals, cron expressions, or one-shot timers."},{title:"Tool Approvals",desc:"Human-in-the-loop safety. Approve dangerous operations from Telegram with inline buttons — even headless."},{title:"Multi-Provider",desc:"Anthropic, OpenAI, OpenRouter, Ollama — any OpenAI-compatible endpoint. Zero vendor lock-in."},{title:"Secure Pairing",desc:"OTP-based user verification. No hardcoded IDs — pairing code + 5-digit OTP from Telegram."},{title:"Skills & Hooks",desc:"Teach agents skills via markdown. Run shell/JS hooks before and after tool calls."},{title:"Auto Compaction",desc:"Summarizes old turns at 80% capacity. Flushes facts to memory first — nothing is lost."},{title:"Same Engine",desc:"All three channels run the same agent loop, same 10 tools, same two-tier memory. Switch freely between them."}]},getStarted:{badge:"Get started",title:"Up and running in under a minute",steps:["npm i -g camelagi","camel setup","Create agents from Telegram"],tagline:"Open source. Self-hosted. Your data stays yours."},integrations:{badge:"Integrations",title:"Connect your apps",desc:"Telegram available now \xb7 REST API \xb7 WebSocket \xb7 Terminal UI",available:"Available",soon:"Soon"},pricing:{badge:"Open Source",title:"Free forever",desc:"MIT licensed \xb7 Self-hosted \xb7 Bring your own API key",monthly:"",monthlyByok:"",perMonth:"",discount:"FREE",creditsLabel:"",creditsNote:"",promoPrefix:"",promoSuffix:"",approximate:"",plans:[]},comingSoon:{badge:"Roadmap",title:"What's next for CamelAGI",desc:"We're building CamelAGI to be the most capable open-source AI platform — for individuals and businesses alike.",cards:[{icon:"\uD83D\uDCE1",title:"More Channels",desc:"WhatsApp, Slack — connect your AI agents to every platform your team already uses."},{icon:"\uD83E\uDDE9",title:"ClawHub Skills",desc:"Browse and install community skills from clawhub.io — one command to add new capabilities to any agent."},{icon:"\uD83C\uDFE2",title:"Business Ready",desc:"Deploy CamelAGI for your business — finance, accounting, operations, customer support. AI agents that understand your workflows."}]},cta:{title:"Ready to run your own AI agent?",desc:"Open source. One command to start.",download:"Get Started",talk:"View on GitHub"},footer:{tagline:"Personal AI agent powered by Claude Agent SDK.",byline:"Open source \xb7 MIT License \xb7 \xa9 2026 Nawaf Almutairi & Brickell Lab, Kuwait"},lang:{en:"English",ar:"عربي"},mock:{clickToOpen:"Click to open",clickToConnect:"Click to connect",gatewayStopped:"Server is stopped",startGateway:"Start Server",replay:"Replay",easyAsThis:["As easy as this … to run your own AI agent","using CamelAGI"]}}},n=(0,r.createContext)(null);function o(e){let{children:t}=e,s=l.en;return(0,a.jsx)(n.Provider,{value:{locale:"en",setLocale:()=>{},t:s,isTransitioning:!1},children:t})}function i(){let e=(0,r.useContext)(n);if(!e)throw Error("useLanguage must be used within LanguageProvider");return e}}},e=>{e.O(0,[909,239,413,441,255,358],()=>e(e.s=2936)),_N_E=e.O()}]);
|