diff --git a/frontend/components/store.tsx b/frontend/components/store.tsx index 16d7152..bc155c9 100644 --- a/frontend/components/store.tsx +++ b/frontend/components/store.tsx @@ -216,6 +216,10 @@ export function DashboardProvider({ const [events, setEvents] = useState([]); const eventsRef = useRef([]); eventsRef.current = events; + /* Bumped on every selectRun: an in-flight loadRun that resolves after the user picked + * a different run must drop its writes, or run A's checkmark/log/events land on run + * B's panel (the 5s tick keeps polls in flight constantly). */ + const runGenRef = useRef(0); const [approvals, setApprovals] = useState([]); const [hosts, setHosts] = useState([]); const [commands, setCommands] = useState([]); @@ -275,12 +279,15 @@ export function DashboardProvider({ const loadRun = useCallback(async (projectId: string, name: string) => { const path = `/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(name)}`; + const gen = runGenRef.current; + const stale = () => gen !== runGenRef.current; try { const cm = await clientRef.current.api(`${path}/checkmark`); + if (stale()) return; setCheckmark(cm); setCheckmarkMissing(false); } catch (e) { - if (e instanceof AuthError) return; + if (e instanceof AuthError || stale()) return; if ((e as ApiError).status === 404) { setCheckmark(null); setCheckmarkMissing(true); @@ -290,9 +297,10 @@ export function DashboardProvider({ const entries = await clientRef.current.api( `${path}/log?limit=${LOG_LIMIT}&offset=${logOffsetRef.current}`, ); + if (stale()) return; setLog(entries); } catch (e) { - swallow(e); + if (!stale()) swallow(e); } try { // Cursor poll: only events newer than what we already hold come back. @@ -301,9 +309,16 @@ export function DashboardProvider({ const fresh = await clientRef.current.api( `${path}/events?after_id=${after}&limit=500`, ); - if (fresh.length) setEvents((prev) => [...prev, ...fresh]); + if (stale() || fresh.length === 0) return; + // Dedup by id at append time: overlapping polls for the same run can both fetch + // from the same cursor; only genuinely-new rows may append. + setEvents((prev) => { + const last = prev.length ? prev[prev.length - 1].id : 0; + const add = fresh.filter((e) => e.id > last); + return add.length ? [...prev, ...add] : prev; + }); } catch (e) { - swallow(e); + if (!stale()) swallow(e); } }, []); @@ -424,6 +439,7 @@ export function DashboardProvider({ const selectRun = useCallback( (projectId: string, name: string) => { + runGenRef.current += 1; // invalidate any in-flight loadRun for the previous run setSelectedRun({ projectId, name }); setLogOffset(0); logOffsetRef.current = 0; diff --git a/src/handler/api/routes/login.py b/src/handler/api/routes/login.py index fbec472..297e832 100644 --- a/src/handler/api/routes/login.py +++ b/src/handler/api/routes/login.py @@ -50,7 +50,7 @@ def enqueue_login_submit(body: LoginSubmitIn, conn: Connection = Depends(db_conn nothing to paste into. No prior login_start leaves the pin empty (single-worker deployments behave exactly as before). """ - started = repo.get_latest_finished_command(conn, "login_start") + started = repo.get_latest_claimed_command(conn, "login_start") return repo.enqueue_command( conn, "login_submit", diff --git a/src/handler/api/static/404.html b/src/handler/api/static/404.html index a96cf3b..bbf8e4e 100644 --- a/src/handler/api/static/404.html +++ b/src/handler/api/static/404.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/404/index.html b/src/handler/api/static/404/index.html index a96cf3b..bbf8e4e 100644 --- a/src/handler/api/static/404/index.html +++ b/src/handler/api/static/404/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/171-699dc657f6a6678f.js b/src/handler/api/static/_next/static/chunks/171-699dc657f6a6678f.js deleted file mode 100644 index 60d0fb7..0000000 --- a/src/handler/api/static/_next/static/chunks/171-699dc657f6a6678f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[171],{171:function(t,e,r){r.d(e,{_:function(){return l},Q:function(){return u}});var a,n=r(7437),s=r(2265);let o=null!==(a=r(257).env.NEXT_PUBLIC_API_BASE)&&void 0!==a?a:"";class c extends Error{constructor(t="unauthorized"){super(t),this.name="AuthError"}}let i=(0,s.createContext)(null);function u(){let t=(0,s.useContext)(i);if(!t)throw Error("useDashboard outside provider");return t}function l(t){let{token:e,onUnauthorized:r,initialSection:a="runs",children:u}=t,l=(0,s.useMemo)(()=>(function(t,e){async function r(r,a){var n;let s=(null==a?void 0:a.body)!==void 0&&(null==a?void 0:a.body)!==null,i=await fetch(o+r,{method:null!==(n=null==a?void 0:a.method)&&void 0!==n?n:s?"POST":"GET",headers:{Authorization:"Bearer ".concat(t),...s?{"Content-Type":"application/json"}:{}},body:s?JSON.stringify(a.body):void 0});if(401===i.status)throw e(),new c;if(!i.ok){let t=i.statusText;try{let e=await i.json();e&&void 0!==e.detail&&(t="string"==typeof e.detail?e.detail:JSON.stringify(e.detail))}catch(t){}let e=Error(t);throw e.status=i.status,e}if(204===i.status)return;let u=await i.text();return u?JSON.parse(u):void 0}async function a(t,e){var a,n;let s=null!==(a=null==e?void 0:e.attempts)&&void 0!==a?a:60,o=null!==(n=null==e?void 0:e.intervalMs)&&void 0!==n?n:500;for(let e=0;esetTimeout(t,o))}return null}return{api:r,trackCommand:a}})(e,r),[e,r]),d=(0,s.useRef)(l);d.current=l;let[m,y]=(0,s.useState)(a),[p,h]=(0,s.useState)([]),[g,b]=(0,s.useState)([]),[w,f]=(0,s.useState)(""),[k,v]=(0,s.useState)(null),[C,_]=(0,s.useState)(null),[x,S]=(0,s.useState)(!1),[I,R]=(0,s.useState)([]),[j,E]=(0,s.useState)(0),[U,T]=(0,s.useState)([]),P=(0,s.useRef)([]);P.current=U;let[A,O]=(0,s.useState)([]),[N,L]=(0,s.useState)([]),[D,z]=(0,s.useState)([]),[J,B]=(0,s.useState)([]),[H,M]=(0,s.useState)({log:[],context:[]}),[q,F]=(0,s.useState)({text:"",error:!1,busy:!1}),[G,Q]=(0,s.useState)(""),[X,K]=(0,s.useState)(!0),[V,W]=(0,s.useState)({status:"idle",url:"",message:""}),Y=(0,s.useRef)(m);Y.current=m;let Z=(0,s.useRef)(w);Z.current=w;let $=(0,s.useRef)(k);$.current=k;let tt=(0,s.useRef)(j);tt.current=j;let te=t=>{t instanceof c||Q(t.message)},tr=(0,s.useCallback)(async()=>{try{let t=await d.current.api("/projects");h(t),Q(""),f(e=>{var r,a;return e||(null!==(a=null===(r=t[0])||void 0===r?void 0:r.id)&&void 0!==a?a:"")})}catch(t){te(t)}},[]),ta=(0,s.useCallback)(async t=>{try{let e=await Promise.all(t.map(t=>d.current.api("/projects/".concat(encodeURIComponent(t.id),"/agents")).catch(()=>[])));b(e.flat())}catch(t){te(t)}},[]),tn=(0,s.useCallback)(async(t,e)=>{let r="/projects/".concat(encodeURIComponent(t),"/agents/").concat(encodeURIComponent(e));try{let t=await d.current.api("".concat(r,"/checkmark"));_(t),S(!1)}catch(t){if(t instanceof c)return;404===t.status?(_(null),S(!0)):te(t)}try{let t=await d.current.api("".concat(r,"/log?limit=").concat(100,"&offset=").concat(tt.current));R(t)}catch(t){te(t)}try{let t=P.current,e=t.length?t[t.length-1].id:0,a=await d.current.api("".concat(r,"/events?after_id=").concat(e,"&limit=500"));a.length&&T(t=>[...t,...a])}catch(t){te(t)}},[]),ts=(0,s.useCallback)(async t=>{if(!t){O([]);return}try{O(await d.current.api("/projects/".concat(encodeURIComponent(t),"/approvals")))}catch(t){te(t)}},[]),to=(0,s.useCallback)(async()=>{try{L(await d.current.api("/hosts"))}catch(t){te(t)}},[]),tc=(0,s.useCallback)(async()=>{try{z(await d.current.api("/commands?limit=50"))}catch(t){te(t)}},[]),ti=(0,s.useCallback)(async()=>{try{B(await d.current.api("/schedules"))}catch(t){te(t)}},[]),tu=(0,s.useCallback)(async()=>{try{let[t,e]=await Promise.all([d.current.api("/shared/log"),d.current.api("/shared/context")]);M({log:t,context:e})}catch(t){te(t)}},[]),tl=(0,s.useCallback)(async()=>{let t=await d.current.api("/projects").catch(t=>(te(t),null));t&&(h(t),f(e=>{var r,a;return e||(null!==(a=null===(r=t[0])||void 0===r?void 0:r.id)&&void 0!==a?a:"")}),await ta(t));let e=Y.current,r=$.current;r&&await tn(r.projectId,r.name),"approvals"===e&&await ts(Z.current),"servers"===e&&await to(),"activity"===e&&await tc(),"schedules"===e&&await ti(),"shared"===e&&await tu()},[ta,tn,ts,to,tc,ti,tu]);(0,s.useEffect)(()=>{let t=!0;(async()=>{K(!0),await tl(),t&&K(!1)})();let e=setInterval(()=>{document.hidden||tl()},5e3);return()=>{t=!1,clearInterval(e)}},[tl]);let td=(0,s.useCallback)(t=>{y(t),F({text:"",error:!1,busy:!1}),"approvals"===t&&ts(Z.current),"servers"===t&&to(),"activity"===t&&tc(),"schedules"===t&&ti(),"shared"===t&&tu()},[ts,to,tc,ti,tu]),tm=(0,s.useCallback)(t=>{f(t),"approvals"===Y.current&&ts(t)},[ts]),ty=(0,s.useCallback)((t,e)=>{v({projectId:t,name:e}),E(0),tt.current=0,_(null),S(!1),R([]),T([]),P.current=[],tn(t,e)},[tn]),tp=(0,s.useCallback)(t=>{let e=Math.max(0,j+100*t);if(e===j)return;E(e),tt.current=e;let r=$.current;r&&tn(r.projectId,r.name)},[j,tn]),th=(0,s.useCallback)(()=>{tl()},[tl]),tg=(0,s.useCallback)(async(t,e,r)=>{F({text:"".concat(r,": queued…"),error:!1,busy:!0});try{let a=await d.current.api(t,{method:"POST",body:e}),n=await d.current.trackCommand(a.id);if(!n)return F({text:"".concat(r,": still running (see Activity). Is the worker up?"),error:!1,busy:!1}),null;let s="done"===n.status,o=n.error||(n.result?JSON.stringify(n.result):"");return F({text:"".concat(r," ").concat(s?"done":"failed").concat(o?" — "+o:""),error:!s,busy:!1}),n}catch(t){if(t instanceof c)return null;return F({text:"".concat(r," failed: ").concat(t.message),error:!0,busy:!1}),null}},[]),tb=(0,s.useCallback)(async t=>{let e={name:t.name.trim(),role:t.role||null,task:t.task.trim()||null};"worktree"===t.placement&&t.worktree.trim()&&(e.worktree=t.worktree.trim()),"subdir"===t.placement&&t.subdir.trim()&&(e.subdir=t.subdir.trim());let r=encodeURIComponent(Z.current),a=await tg("/projects/".concat(r,"/agents/spawn"),e,"spawn ".concat(e.name));return await ta(p),(null==a?void 0:a.status)==="done"},[tg,ta,p]),tw=(0,s.useCallback)(async(t,e)=>{let r=encodeURIComponent(t);await tg("/projects/".concat(r,"/agents/").concat(encodeURIComponent(e),"/kill"),void 0,"kill ".concat(e)),await ta(p)},[tg,ta,p]),tf=(0,s.useCallback)(async(t,e)=>{let r=encodeURIComponent(t);try{var a;await d.current.api("/projects/".concat(r,"/agents/").concat(encodeURIComponent(e)),{method:"DELETE"}),F({text:"agent '".concat(e,"' row deleted"),error:!1,busy:!1}),(null===(a=$.current)||void 0===a?void 0:a.name)===e&&v(null),await ta(p)}catch(t){if(t instanceof c)return;F({text:t.message,error:!0,busy:!1})}},[ta,p]),tk=(0,s.useCallback)(async(t,e)=>{let r=$.current;if(!r)return!1;let a="/projects/".concat(encodeURIComponent(r.projectId),"/agents/").concat(encodeURIComponent(r.name));try{return await d.current.api("".concat(a,"/answer"),{method:"POST",body:{answer:t}}),e?await tg("".concat(a,"/resume"),{answer:t},"resume"):F({text:"Answer saved (agent still paused).",error:!1,busy:!1}),await ta(p),await tn(r.projectId,r.name),!0}catch(t){if(t instanceof c)return!1;return F({text:t.message,error:!0,busy:!1}),!1}},[tg,ta,tn,p]),tv=(0,s.useCallback)(async t=>{try{var e,r;let a="server"===t.mode?{git_server:t.git_server,repo:t.repo.trim(),id:t.id.trim()||null,credential_ref:t.credential_ref.trim()||null,init_mise:t.init_mise}:{id:t.id.trim(),root_dir:t.root_dir.trim(),git_remote:t.git_remote.trim()||null,credential_ref:t.credential_ref.trim()||null,init_mise:t.init_mise},n=await d.current.api("/projects",{method:"POST",body:a});if(await tr(),null!=n.sync_command_id){F({text:"repository '".concat(n.id,"': cloning…"),error:!1,busy:!0});let t=await d.current.trackCommand(n.sync_command_id);t?"done"===t.status?F({text:"repository '".concat(n.id,"' registered and cloned"),error:!1,busy:!1}):F({text:"repository '".concat(n.id,"' registered but the clone failed — ").concat(null!==(e=t.error)&&void 0!==e?e:""),error:!0,busy:!1}):F({text:"repository '".concat(n.id,"' registered; clone still running (see Activity). Is the worker up?"),error:!1,busy:!1})}else F({text:"repository '".concat(n.id,"' registered"),error:!1,busy:!1});if(null!=n.mise_init_command_id){F({text:"repository '".concat(n.id,"': launching a mise-init agent to create .mise.toml…"),error:!1,busy:!0});let t=await d.current.trackCommand(n.mise_init_command_id);t?"done"===t.status?F({text:"repository '".concat(n.id,"' registered; a mise-init agent is now writing, committing, and pushing .mise.toml (watch it in Runs)."),error:!1,busy:!1}):F({text:"repository '".concat(n.id,"' registered but the mise-init agent failed to launch — ").concat(null!==(r=t.error)&&void 0!==r?r:""),error:!0,busy:!1}):F({text:"repository '".concat(n.id,"' registered; mise-init still starting (see Activity). Is the worker up?"),error:!1,busy:!1})}return!0}catch(t){if(t instanceof c)return!1;return F({text:t.message,error:!0,busy:!1}),!1}},[tr]),tC=(0,s.useCallback)(async t=>{await tg("/projects/".concat(encodeURIComponent(t),"/sync"),void 0,"pull ".concat(t))},[tg]),t_=(0,s.useCallback)(async(t,e)=>{try{return await d.current.api("/projects/".concat(encodeURIComponent(t)),{method:"PATCH",body:{root_dir:e.root_dir.trim(),git_remote:e.git_remote.trim()||null,credential_ref:e.credential_ref.trim()||null}}),F({text:"repository '".concat(t,"' updated"),error:!1,busy:!1}),await tr(),!0}catch(t){if(t instanceof c)return!1;return F({text:t.message,error:!0,busy:!1}),!1}},[tr]),tx=(0,s.useCallback)(async t=>{try{await d.current.api("/projects/".concat(encodeURIComponent(t)),{method:"DELETE"}),F({text:"repository '".concat(t,"' removed"),error:!1,busy:!1}),f(e=>e===t?"":e),await tr()}catch(t){if(t instanceof c)return;F({text:t.message,error:!0,busy:!1})}},[tr]),tS=(0,s.useCallback)(async t=>{let e=encodeURIComponent(Z.current);await tg("/projects/".concat(e,"/approvals"),{branch:t.branch.trim(),status:t.status,agent_name:t.agent_name.trim()||null,sha:t.sha.trim()||null,note:t.note.trim()||null},"".concat(t.status," ").concat(t.branch)),await ts(Z.current)},[tg,ts]),tI=(0,s.useCallback)(async t=>{try{return await d.current.api("/hosts",{method:"POST",body:{hostname:t.hostname.trim(),forge_type:t.forge_type,token_env_var:t.token_env_var.trim()||null,base_url:t.base_url.trim()||null,token:t.token.trim()||null,generate_ssh_key:t.generate_ssh_key}}),F({text:"git server '".concat(t.hostname,"' added"),error:!1,busy:!1}),await to(),!0}catch(t){if(t instanceof c)return!1;return F({text:t.message,error:!0,busy:!1}),!1}},[to]),tR=(0,s.useCallback)(async(t,e)=>{try{let r={forge_type:e.forge_type,token_env_var:e.token_env_var.trim()||null,base_url:e.base_url.trim()||null};return e.token.trim()&&(r.token=e.token.trim()),e.generate_ssh_key&&(r.regenerate_ssh_key=!0),await d.current.api("/hosts/".concat(encodeURIComponent(t)),{method:"PATCH",body:r}),F({text:"git server '".concat(t,"' updated"),error:!1,busy:!1}),await to(),!0}catch(t){if(t instanceof c)return!1;return F({text:t.message,error:!0,busy:!1}),!1}},[to]),tj=(0,s.useCallback)(async(t,e)=>{try{return await d.current.api("/projects/".concat(encodeURIComponent(t),"/schedules"),{method:"POST",body:{name_prefix:e.name_prefix.trim(),task:e.task.trim(),interval_seconds:e.interval_seconds,role:e.role||null}}),F({text:"schedule '".concat(e.name_prefix,"' created — first run on the worker's next pass"),error:!1,busy:!1}),await ti(),!0}catch(t){if(t instanceof c)return!1;return F({text:t.message,error:!0,busy:!1}),!1}},[ti]),tE=(0,s.useCallback)(async(t,e)=>{try{return await d.current.api("/schedules/".concat(t),{method:"PATCH",body:e}),await ti(),!0}catch(t){if(t instanceof c)return!1;return F({text:t.message,error:!0,busy:!1}),!1}},[ti]),tU=(0,s.useCallback)(async t=>{try{await d.current.api("/schedules/".concat(t),{method:"DELETE"}),F({text:"schedule ".concat(t," removed"),error:!1,busy:!1}),await ti()}catch(t){if(t instanceof c)return;F({text:t.message,error:!0,busy:!1})}},[ti]),tT=(0,s.useCallback)(async t=>{try{await d.current.api("/hosts/".concat(encodeURIComponent(t)),{method:"DELETE"}),F({text:"git server '".concat(t,"' removed"),error:!1,busy:!1}),await to()}catch(t){if(t instanceof c)return;F({text:t.message,error:!0,busy:!1})}},[to]),tP=(0,s.useCallback)(async()=>{await tg("/poll-ci",void 0,"poll-ci (all projects)"),await tc()},[tg,tc]),tA=(0,s.useCallback)(async()=>{W({status:"starting",url:"",message:"Opening `claude /login` in the control container and selecting the subscription account…"});try{let t=await d.current.api("/login/start",{method:"POST"}),e=await d.current.trackCommand(t.id,{attempts:180});if(!e){W({status:"error",url:"",message:"Still starting (see Activity). Is the control worker running?"});return}if("done"!==e.status){W({status:"error",url:"",message:e.error||"Failed to start login."});return}let r=e.result&&"string"==typeof e.result.url?e.result.url:"";if(!r){W({status:"error",url:"",message:"No login URL was returned by claude."});return}W({status:"awaiting",url:r,message:"Authorize in the window below (or open it in a new tab), then paste the code claude gives you."})}catch(t){if(t instanceof c)return;W({status:"error",url:"",message:t.message})}},[]),tO=(0,s.useCallback)(async t=>{let e=t.trim();if(!e)return!1;W(t=>({...t,status:"submitting",message:"Submitting the authorization code…"}));try{let t=await d.current.api("/login/submit",{method:"POST",body:{code:e}}),r=await d.current.trackCommand(t.id,{attempts:60});if(!r)return W(t=>({...t,status:"awaiting",message:"Submit still running (see Activity). Is the control worker running?"})),!1;if("done"===r.status)return W({status:"done",url:"",message:"Claude Code is now logged in on the host — new agents will use this account."}),!0;return W(t=>({...t,status:"awaiting",message:r.error||"Login was not confirmed. Re-check the code, or restart the flow."})),!1}catch(t){if(t instanceof c)return!1;return W(e=>({...e,status:"awaiting",message:t.message})),!1}},[]),tN=(0,s.useCallback)(()=>{W({status:"idle",url:"",message:""})},[]),tL=(0,s.useCallback)(async(t,e)=>{try{return await d.current.api("/shared/context/".concat(encodeURIComponent(t)),{method:"PUT",body:{value:e}}),F({text:"shared context '".concat(t,"' set"),error:!1,busy:!1}),await tu(),!0}catch(t){if(t instanceof c)return!1;return F({text:t.message,error:!0,busy:!1}),!1}},[tu]);return(0,n.jsx)(i.Provider,{value:{section:m,setSection:td,projects:p,agents:g,selectedProjectId:w,selectProject:tm,selectedRun:k,selectRun:ty,checkmark:C,checkmarkMissing:x,log:I,logOffset:j,pageLog:tp,events:U,approvals:A,hosts:N,commands:D,schedules:J,shared:H,cmd:q,lastError:G,loading:X,refresh:th,spawnAgent:tb,killAgent:tw,deleteAgent:tf,submitAnswer:tk,createProject:tv,updateProject:t_,deleteProject:tx,syncProject:tC,submitApproval:tS,createHost:tI,updateHost:tR,deleteHost:tT,createSchedule:tj,updateSchedule:tE,deleteSchedule:tU,pollCi:tP,setSharedKey:tL,claudeLogin:V,startClaudeLogin:tA,submitClaudeCode:tO,resetClaudeLogin:tN},children:u})}}}]); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/171-ba6c418b542791c8.js b/src/handler/api/static/_next/static/chunks/171-ba6c418b542791c8.js new file mode 100644 index 0000000..319bb5a --- /dev/null +++ b/src/handler/api/static/_next/static/chunks/171-ba6c418b542791c8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[171],{171:function(t,e,r){r.d(e,{_:function(){return l},Q:function(){return u}});var a,n=r(7437),s=r(2265);let c=null!==(a=r(257).env.NEXT_PUBLIC_API_BASE)&&void 0!==a?a:"";class o extends Error{constructor(t="unauthorized"){super(t),this.name="AuthError"}}let i=(0,s.createContext)(null);function u(){let t=(0,s.useContext)(i);if(!t)throw Error("useDashboard outside provider");return t}function l(t){let{token:e,onUnauthorized:r,initialSection:a="runs",children:u}=t,l=(0,s.useMemo)(()=>(function(t,e){async function r(r,a){var n;let s=(null==a?void 0:a.body)!==void 0&&(null==a?void 0:a.body)!==null,i=await fetch(c+r,{method:null!==(n=null==a?void 0:a.method)&&void 0!==n?n:s?"POST":"GET",headers:{Authorization:"Bearer ".concat(t),...s?{"Content-Type":"application/json"}:{}},body:s?JSON.stringify(a.body):void 0});if(401===i.status)throw e(),new o;if(!i.ok){let t=i.statusText;try{let e=await i.json();e&&void 0!==e.detail&&(t="string"==typeof e.detail?e.detail:JSON.stringify(e.detail))}catch(t){}let e=Error(t);throw e.status=i.status,e}if(204===i.status)return;let u=await i.text();return u?JSON.parse(u):void 0}async function a(t,e){var a,n;let s=null!==(a=null==e?void 0:e.attempts)&&void 0!==a?a:60,c=null!==(n=null==e?void 0:e.intervalMs)&&void 0!==n?n:500;for(let e=0;esetTimeout(t,c))}return null}return{api:r,trackCommand:a}})(e,r),[e,r]),d=(0,s.useRef)(l);d.current=l;let[m,y]=(0,s.useState)(a),[p,h]=(0,s.useState)([]),[g,b]=(0,s.useState)([]),[w,f]=(0,s.useState)(""),[k,v]=(0,s.useState)(null),[C,_]=(0,s.useState)(null),[x,S]=(0,s.useState)(!1),[I,R]=(0,s.useState)([]),[j,E]=(0,s.useState)(0),[U,T]=(0,s.useState)([]),P=(0,s.useRef)([]);P.current=U;let A=(0,s.useRef)(0),[O,N]=(0,s.useState)([]),[L,D]=(0,s.useState)([]),[z,J]=(0,s.useState)([]),[B,H]=(0,s.useState)([]),[M,q]=(0,s.useState)({log:[],context:[]}),[F,G]=(0,s.useState)({text:"",error:!1,busy:!1}),[Q,X]=(0,s.useState)(""),[K,V]=(0,s.useState)(!0),[W,Y]=(0,s.useState)({status:"idle",url:"",message:""}),Z=(0,s.useRef)(m);Z.current=m;let $=(0,s.useRef)(w);$.current=w;let tt=(0,s.useRef)(k);tt.current=k;let te=(0,s.useRef)(j);te.current=j;let tr=t=>{t instanceof o||X(t.message)},ta=(0,s.useCallback)(async()=>{try{let t=await d.current.api("/projects");h(t),X(""),f(e=>{var r,a;return e||(null!==(a=null===(r=t[0])||void 0===r?void 0:r.id)&&void 0!==a?a:"")})}catch(t){tr(t)}},[]),tn=(0,s.useCallback)(async t=>{try{let e=await Promise.all(t.map(t=>d.current.api("/projects/".concat(encodeURIComponent(t.id),"/agents")).catch(()=>[])));b(e.flat())}catch(t){tr(t)}},[]),ts=(0,s.useCallback)(async(t,e)=>{let r="/projects/".concat(encodeURIComponent(t),"/agents/").concat(encodeURIComponent(e)),a=A.current;try{let t=await d.current.api("".concat(r,"/checkmark"));if(a!==A.current)return;_(t),S(!1)}catch(t){if(t instanceof o||a!==A.current)return;404===t.status?(_(null),S(!0)):tr(t)}try{let t=await d.current.api("".concat(r,"/log?limit=").concat(100,"&offset=").concat(te.current));if(a!==A.current)return;R(t)}catch(t){a!==A.current||tr(t)}try{let t=P.current,e=t.length?t[t.length-1].id:0,n=await d.current.api("".concat(r,"/events?after_id=").concat(e,"&limit=500"));if(a!==A.current||0===n.length)return;T(t=>{let e=t.length?t[t.length-1].id:0,r=n.filter(t=>t.id>e);return r.length?[...t,...r]:t})}catch(t){a!==A.current||tr(t)}},[]),tc=(0,s.useCallback)(async t=>{if(!t){N([]);return}try{N(await d.current.api("/projects/".concat(encodeURIComponent(t),"/approvals")))}catch(t){tr(t)}},[]),to=(0,s.useCallback)(async()=>{try{D(await d.current.api("/hosts"))}catch(t){tr(t)}},[]),ti=(0,s.useCallback)(async()=>{try{J(await d.current.api("/commands?limit=50"))}catch(t){tr(t)}},[]),tu=(0,s.useCallback)(async()=>{try{H(await d.current.api("/schedules"))}catch(t){tr(t)}},[]),tl=(0,s.useCallback)(async()=>{try{let[t,e]=await Promise.all([d.current.api("/shared/log"),d.current.api("/shared/context")]);q({log:t,context:e})}catch(t){tr(t)}},[]),td=(0,s.useCallback)(async()=>{let t=await d.current.api("/projects").catch(t=>(tr(t),null));t&&(h(t),f(e=>{var r,a;return e||(null!==(a=null===(r=t[0])||void 0===r?void 0:r.id)&&void 0!==a?a:"")}),await tn(t));let e=Z.current,r=tt.current;r&&await ts(r.projectId,r.name),"approvals"===e&&await tc($.current),"servers"===e&&await to(),"activity"===e&&await ti(),"schedules"===e&&await tu(),"shared"===e&&await tl()},[tn,ts,tc,to,ti,tu,tl]);(0,s.useEffect)(()=>{let t=!0;(async()=>{V(!0),await td(),t&&V(!1)})();let e=setInterval(()=>{document.hidden||td()},5e3);return()=>{t=!1,clearInterval(e)}},[td]);let tm=(0,s.useCallback)(t=>{y(t),G({text:"",error:!1,busy:!1}),"approvals"===t&&tc($.current),"servers"===t&&to(),"activity"===t&&ti(),"schedules"===t&&tu(),"shared"===t&&tl()},[tc,to,ti,tu,tl]),ty=(0,s.useCallback)(t=>{f(t),"approvals"===Z.current&&tc(t)},[tc]),tp=(0,s.useCallback)((t,e)=>{A.current+=1,v({projectId:t,name:e}),E(0),te.current=0,_(null),S(!1),R([]),T([]),P.current=[],ts(t,e)},[ts]),th=(0,s.useCallback)(t=>{let e=Math.max(0,j+100*t);if(e===j)return;E(e),te.current=e;let r=tt.current;r&&ts(r.projectId,r.name)},[j,ts]),tg=(0,s.useCallback)(()=>{td()},[td]),tb=(0,s.useCallback)(async(t,e,r)=>{G({text:"".concat(r,": queued…"),error:!1,busy:!0});try{let a=await d.current.api(t,{method:"POST",body:e}),n=await d.current.trackCommand(a.id);if(!n)return G({text:"".concat(r,": still running (see Activity). Is the worker up?"),error:!1,busy:!1}),null;let s="done"===n.status,c=n.error||(n.result?JSON.stringify(n.result):"");return G({text:"".concat(r," ").concat(s?"done":"failed").concat(c?" — "+c:""),error:!s,busy:!1}),n}catch(t){if(t instanceof o)return null;return G({text:"".concat(r," failed: ").concat(t.message),error:!0,busy:!1}),null}},[]),tw=(0,s.useCallback)(async t=>{let e={name:t.name.trim(),role:t.role||null,task:t.task.trim()||null};"worktree"===t.placement&&t.worktree.trim()&&(e.worktree=t.worktree.trim()),"subdir"===t.placement&&t.subdir.trim()&&(e.subdir=t.subdir.trim());let r=encodeURIComponent($.current),a=await tb("/projects/".concat(r,"/agents/spawn"),e,"spawn ".concat(e.name));return await tn(p),(null==a?void 0:a.status)==="done"},[tb,tn,p]),tf=(0,s.useCallback)(async(t,e)=>{let r=encodeURIComponent(t);await tb("/projects/".concat(r,"/agents/").concat(encodeURIComponent(e),"/kill"),void 0,"kill ".concat(e)),await tn(p)},[tb,tn,p]),tk=(0,s.useCallback)(async(t,e)=>{let r=encodeURIComponent(t);try{var a;await d.current.api("/projects/".concat(r,"/agents/").concat(encodeURIComponent(e)),{method:"DELETE"}),G({text:"agent '".concat(e,"' row deleted"),error:!1,busy:!1}),(null===(a=tt.current)||void 0===a?void 0:a.name)===e&&v(null),await tn(p)}catch(t){if(t instanceof o)return;G({text:t.message,error:!0,busy:!1})}},[tn,p]),tv=(0,s.useCallback)(async(t,e)=>{let r=tt.current;if(!r)return!1;let a="/projects/".concat(encodeURIComponent(r.projectId),"/agents/").concat(encodeURIComponent(r.name));try{return await d.current.api("".concat(a,"/answer"),{method:"POST",body:{answer:t}}),e?await tb("".concat(a,"/resume"),{answer:t},"resume"):G({text:"Answer saved (agent still paused).",error:!1,busy:!1}),await tn(p),await ts(r.projectId,r.name),!0}catch(t){if(t instanceof o)return!1;return G({text:t.message,error:!0,busy:!1}),!1}},[tb,tn,ts,p]),tC=(0,s.useCallback)(async t=>{try{var e,r;let a="server"===t.mode?{git_server:t.git_server,repo:t.repo.trim(),id:t.id.trim()||null,credential_ref:t.credential_ref.trim()||null,init_mise:t.init_mise}:{id:t.id.trim(),root_dir:t.root_dir.trim(),git_remote:t.git_remote.trim()||null,credential_ref:t.credential_ref.trim()||null,init_mise:t.init_mise},n=await d.current.api("/projects",{method:"POST",body:a});if(await ta(),null!=n.sync_command_id){G({text:"repository '".concat(n.id,"': cloning…"),error:!1,busy:!0});let t=await d.current.trackCommand(n.sync_command_id);t?"done"===t.status?G({text:"repository '".concat(n.id,"' registered and cloned"),error:!1,busy:!1}):G({text:"repository '".concat(n.id,"' registered but the clone failed — ").concat(null!==(e=t.error)&&void 0!==e?e:""),error:!0,busy:!1}):G({text:"repository '".concat(n.id,"' registered; clone still running (see Activity). Is the worker up?"),error:!1,busy:!1})}else G({text:"repository '".concat(n.id,"' registered"),error:!1,busy:!1});if(null!=n.mise_init_command_id){G({text:"repository '".concat(n.id,"': launching a mise-init agent to create .mise.toml…"),error:!1,busy:!0});let t=await d.current.trackCommand(n.mise_init_command_id);t?"done"===t.status?G({text:"repository '".concat(n.id,"' registered; a mise-init agent is now writing, committing, and pushing .mise.toml (watch it in Runs)."),error:!1,busy:!1}):G({text:"repository '".concat(n.id,"' registered but the mise-init agent failed to launch — ").concat(null!==(r=t.error)&&void 0!==r?r:""),error:!0,busy:!1}):G({text:"repository '".concat(n.id,"' registered; mise-init still starting (see Activity). Is the worker up?"),error:!1,busy:!1})}return!0}catch(t){if(t instanceof o)return!1;return G({text:t.message,error:!0,busy:!1}),!1}},[ta]),t_=(0,s.useCallback)(async t=>{await tb("/projects/".concat(encodeURIComponent(t),"/sync"),void 0,"pull ".concat(t))},[tb]),tx=(0,s.useCallback)(async(t,e)=>{try{return await d.current.api("/projects/".concat(encodeURIComponent(t)),{method:"PATCH",body:{root_dir:e.root_dir.trim(),git_remote:e.git_remote.trim()||null,credential_ref:e.credential_ref.trim()||null}}),G({text:"repository '".concat(t,"' updated"),error:!1,busy:!1}),await ta(),!0}catch(t){if(t instanceof o)return!1;return G({text:t.message,error:!0,busy:!1}),!1}},[ta]),tS=(0,s.useCallback)(async t=>{try{await d.current.api("/projects/".concat(encodeURIComponent(t)),{method:"DELETE"}),G({text:"repository '".concat(t,"' removed"),error:!1,busy:!1}),f(e=>e===t?"":e),await ta()}catch(t){if(t instanceof o)return;G({text:t.message,error:!0,busy:!1})}},[ta]),tI=(0,s.useCallback)(async t=>{let e=encodeURIComponent($.current);await tb("/projects/".concat(e,"/approvals"),{branch:t.branch.trim(),status:t.status,agent_name:t.agent_name.trim()||null,sha:t.sha.trim()||null,note:t.note.trim()||null},"".concat(t.status," ").concat(t.branch)),await tc($.current)},[tb,tc]),tR=(0,s.useCallback)(async t=>{try{return await d.current.api("/hosts",{method:"POST",body:{hostname:t.hostname.trim(),forge_type:t.forge_type,token_env_var:t.token_env_var.trim()||null,base_url:t.base_url.trim()||null,token:t.token.trim()||null,generate_ssh_key:t.generate_ssh_key}}),G({text:"git server '".concat(t.hostname,"' added"),error:!1,busy:!1}),await to(),!0}catch(t){if(t instanceof o)return!1;return G({text:t.message,error:!0,busy:!1}),!1}},[to]),tj=(0,s.useCallback)(async(t,e)=>{try{let r={forge_type:e.forge_type,token_env_var:e.token_env_var.trim()||null,base_url:e.base_url.trim()||null};return e.token.trim()&&(r.token=e.token.trim()),e.generate_ssh_key&&(r.regenerate_ssh_key=!0),await d.current.api("/hosts/".concat(encodeURIComponent(t)),{method:"PATCH",body:r}),G({text:"git server '".concat(t,"' updated"),error:!1,busy:!1}),await to(),!0}catch(t){if(t instanceof o)return!1;return G({text:t.message,error:!0,busy:!1}),!1}},[to]),tE=(0,s.useCallback)(async(t,e)=>{try{return await d.current.api("/projects/".concat(encodeURIComponent(t),"/schedules"),{method:"POST",body:{name_prefix:e.name_prefix.trim(),task:e.task.trim(),interval_seconds:e.interval_seconds,role:e.role||null}}),G({text:"schedule '".concat(e.name_prefix,"' created — first run on the worker's next pass"),error:!1,busy:!1}),await tu(),!0}catch(t){if(t instanceof o)return!1;return G({text:t.message,error:!0,busy:!1}),!1}},[tu]),tU=(0,s.useCallback)(async(t,e)=>{try{return await d.current.api("/schedules/".concat(t),{method:"PATCH",body:e}),await tu(),!0}catch(t){if(t instanceof o)return!1;return G({text:t.message,error:!0,busy:!1}),!1}},[tu]),tT=(0,s.useCallback)(async t=>{try{await d.current.api("/schedules/".concat(t),{method:"DELETE"}),G({text:"schedule ".concat(t," removed"),error:!1,busy:!1}),await tu()}catch(t){if(t instanceof o)return;G({text:t.message,error:!0,busy:!1})}},[tu]),tP=(0,s.useCallback)(async t=>{try{await d.current.api("/hosts/".concat(encodeURIComponent(t)),{method:"DELETE"}),G({text:"git server '".concat(t,"' removed"),error:!1,busy:!1}),await to()}catch(t){if(t instanceof o)return;G({text:t.message,error:!0,busy:!1})}},[to]),tA=(0,s.useCallback)(async()=>{await tb("/poll-ci",void 0,"poll-ci (all projects)"),await ti()},[tb,ti]),tO=(0,s.useCallback)(async()=>{Y({status:"starting",url:"",message:"Opening `claude /login` in the control container and selecting the subscription account…"});try{let t=await d.current.api("/login/start",{method:"POST"}),e=await d.current.trackCommand(t.id,{attempts:180});if(!e){Y({status:"error",url:"",message:"Still starting (see Activity). Is the control worker running?"});return}if("done"!==e.status){Y({status:"error",url:"",message:e.error||"Failed to start login."});return}let r=e.result&&"string"==typeof e.result.url?e.result.url:"";if(!r){Y({status:"error",url:"",message:"No login URL was returned by claude."});return}Y({status:"awaiting",url:r,message:"Authorize in the window below (or open it in a new tab), then paste the code claude gives you."})}catch(t){if(t instanceof o)return;Y({status:"error",url:"",message:t.message})}},[]),tN=(0,s.useCallback)(async t=>{let e=t.trim();if(!e)return!1;Y(t=>({...t,status:"submitting",message:"Submitting the authorization code…"}));try{let t=await d.current.api("/login/submit",{method:"POST",body:{code:e}}),r=await d.current.trackCommand(t.id,{attempts:60});if(!r)return Y(t=>({...t,status:"awaiting",message:"Submit still running (see Activity). Is the control worker running?"})),!1;if("done"===r.status)return Y({status:"done",url:"",message:"Claude Code is now logged in on the host — new agents will use this account."}),!0;return Y(t=>({...t,status:"awaiting",message:r.error||"Login was not confirmed. Re-check the code, or restart the flow."})),!1}catch(t){if(t instanceof o)return!1;return Y(e=>({...e,status:"awaiting",message:t.message})),!1}},[]),tL=(0,s.useCallback)(()=>{Y({status:"idle",url:"",message:""})},[]),tD=(0,s.useCallback)(async(t,e)=>{try{return await d.current.api("/shared/context/".concat(encodeURIComponent(t)),{method:"PUT",body:{value:e}}),G({text:"shared context '".concat(t,"' set"),error:!1,busy:!1}),await tl(),!0}catch(t){if(t instanceof o)return!1;return G({text:t.message,error:!0,busy:!1}),!1}},[tl]);return(0,n.jsx)(i.Provider,{value:{section:m,setSection:tm,projects:p,agents:g,selectedProjectId:w,selectProject:ty,selectedRun:k,selectRun:tp,checkmark:C,checkmarkMissing:x,log:I,logOffset:j,pageLog:th,events:U,approvals:O,hosts:L,commands:z,schedules:B,shared:M,cmd:F,lastError:Q,loading:K,refresh:tg,spawnAgent:tw,killAgent:tf,deleteAgent:tk,submitAnswer:tv,createProject:tC,updateProject:tx,deleteProject:tS,syncProject:t_,submitApproval:tI,createHost:tR,updateHost:tj,deleteHost:tP,createSchedule:tE,updateSchedule:tU,deleteSchedule:tT,pollCi:tA,setSharedKey:tD,claudeLogin:W,startClaudeLogin:tO,submitClaudeCode:tN,resetClaudeLogin:tL},children:u})}}}]); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/app/activity/page-7be158338498be57.js b/src/handler/api/static/_next/static/chunks/app/activity/page-7be158338498be57.js new file mode 100644 index 0000000..7ee8221 --- /dev/null +++ b/src/handler/api/static/_next/static/chunks/app/activity/page-7be158338498be57.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[263],{535:function(e,t,n){Promise.resolve().then(n.bind(n,7839))},7839:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o}});var r=n(7437),c=n(171),s=n(8280),a=n(6039);function i(){let e=(0,c.Q)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"section-head",children:(0,r.jsxs)("div",{className:"hstack",style:{justifyContent:"space-between"},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"section-title",children:"Activity"}),(0,r.jsx)("div",{className:"section-desc",children:"Control commands the worker drains from the queue."})]}),(0,r.jsx)(s.zx,{variant:"secondary",disabled:e.cmd.busy,onClick:()=>e.pollCi(),children:"Sweep CI now"})]})}),(0,r.jsx)("div",{className:"section-body",children:0===e.commands.length?(0,r.jsx)("div",{className:"empty",children:"No commands yet."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Type"}),(0,r.jsx)("th",{children:"Repository"}),(0,r.jsx)("th",{children:"Agent"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Result / Error"})]})}),(0,r.jsx)("tbody",{children:e.commands.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,a.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.type}),(0,r.jsx)("td",{className:"mono",children:e.project_id||"—"}),(0,r.jsx)("td",{className:"mono",children:e.agent_name||"—"}),(0,r.jsx)("td",{children:(0,r.jsx)(s.OE,{status:e.status})}),(0,r.jsx)("td",{className:"mono faint",style:{fontSize:"var(--text-xs)"},children:e.error||(e.result?JSON.stringify(e.result):"—")})]},e.id))})]})})})]})}function o(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(i,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return a},Ph:function(){return f},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return h},zx:function(){return o}});var r=n(7437),c=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:c=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[c&&(0,r.jsx)("span",{className:"dot"}),s]})}function a(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,c.FH)(t),children:(0,c.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:c,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:c,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function o(e){let{variant:t="secondary",size:n="md",onClick:c,disabled:s,type:a="button",children:i}=e;return(0,r.jsx)("button",{type:a,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:c,disabled:s,children:i})}function l(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:c,placeholder:s,type:a="text",disabled:i}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("input",{className:"input",type:a,value:n,placeholder:s,disabled:i,onChange:e=>c(e.target.value)})})}function d(e){let{label:t,value:n,onChange:c,placeholder:s,rows:a=3}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:a,placeholder:s,onChange:e=>c(e.target.value)})})}function f(e){let{label:t,value:n,onChange:c,options:s}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>c(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function h(e){let{tabs:t,value:n,onChange:c}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>c(e.value),children:e.label},e.value))})}function m(e){let{value:t,label:n,sub:c,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),c&&(0,r.jsx)("div",{className:"stat-sub",children:c})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function x(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return a},FH:function(){return r},Q6:function(){return i},Sy:function(){return o}});let c={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return c[n]?c[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function a(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function o(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let c=Math.floor(r/60);if(c<24)return"".concat(c,"h");let s=Math.floor(c/24);if(s<30)return"".concat(s,"d");let a=Math.floor(s/30);return a<12?"".concat(a,"mo"):"".concat(Math.floor(a/12),"y")}},257:function(e,t,n){"use strict";var r,c;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(c=n.g.process)?void 0:c.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,c=e.exports={};function s(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var o=[],l=!1,u=-1;function d(){l&&r&&(l=!1,r.length?o=r.concat(o):u=-1,o.length&&f())}function f(){if(!l){var e=i(d);l=!0;for(var t=o.length;t;){for(r=o,o=[];++u1)for(var n=1;ne.pollCi(),children:"Sweep CI now"})]})}),(0,r.jsx)("div",{className:"section-body",children:0===e.commands.length?(0,r.jsx)("div",{className:"empty",children:"No commands yet."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Type"}),(0,r.jsx)("th",{children:"Repository"}),(0,r.jsx)("th",{children:"Agent"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Result / Error"})]})}),(0,r.jsx)("tbody",{children:e.commands.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,a.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.type}),(0,r.jsx)("td",{className:"mono",children:e.project_id||"—"}),(0,r.jsx)("td",{className:"mono",children:e.agent_name||"—"}),(0,r.jsx)("td",{children:(0,r.jsx)(s.OE,{status:e.status})}),(0,r.jsx)("td",{className:"mono faint",style:{fontSize:"var(--text-xs)"},children:e.error||(e.result?JSON.stringify(e.result):"—")})]},e.id))})]})})})]})}function o(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(i,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return a},Ph:function(){return f},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return h},zx:function(){return o}});var r=n(7437),c=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:c=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[c&&(0,r.jsx)("span",{className:"dot"}),s]})}function a(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,c.FH)(t),children:(0,c.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:c,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:c,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function o(e){let{variant:t="secondary",size:n="md",onClick:c,disabled:s,type:a="button",children:i}=e;return(0,r.jsx)("button",{type:a,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:c,disabled:s,children:i})}function l(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:c,placeholder:s,type:a="text",disabled:i}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("input",{className:"input",type:a,value:n,placeholder:s,disabled:i,onChange:e=>c(e.target.value)})})}function d(e){let{label:t,value:n,onChange:c,placeholder:s,rows:a=3}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:a,placeholder:s,onChange:e=>c(e.target.value)})})}function f(e){let{label:t,value:n,onChange:c,options:s}=e;return(0,r.jsx)(l,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>c(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function h(e){let{tabs:t,value:n,onChange:c}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>c(e.value),children:e.label},e.value))})}function m(e){let{value:t,label:n,sub:c,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),c&&(0,r.jsx)("div",{className:"stat-sub",children:c})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function x(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return a},FH:function(){return r},Q6:function(){return i},Sy:function(){return o}});let c={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return c[n]?c[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function a(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function o(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let c=Math.floor(r/60);if(c<24)return"".concat(c,"h");let s=Math.floor(c/24);if(s<30)return"".concat(s,"d");let a=Math.floor(s/30);return a<12?"".concat(a,"mo"):"".concat(Math.floor(a/12),"y")}},257:function(e,t,n){"use strict";var r,c;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(c=n.g.process)?void 0:c.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,c=e.exports={};function s(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var o=[],l=!1,u=-1;function d(){l&&r&&(l=!1,r.length?o=r.concat(o):u=-1,o.length&&f())}function f(){if(!l){var e=i(d);l=!0;for(var t=o.length;t;){for(r=o,o=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),h=(0,a.useMemo)(()=>e.agents.filter(t=>t.project_id===e.selectedProjectId),[e.agents,e.selectedProjectId]),m=async()=>{await e.spawnAgent(t)&&n(u)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Agents"}),(0,r.jsx)("div",{className:"section-desc",children:"Spawn agents into a repository and manage running sessions."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(l.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:d})})}),(0,r.jsxs)(l.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Spawn an agent"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(l.II,{label:"Name",value:t.name,onChange:e=>n({...t,name:e}),placeholder:"junior"}),(0,r.jsx)(l.Ph,{label:"Role",value:t.role,onChange:e=>n({...t,role:e}),options:c}),(0,r.jsx)(l.Ph,{label:"Placement",value:t.placement,onChange:e=>n({...t,placement:e}),options:o}),"worktree"===t.placement?(0,r.jsx)(l.II,{label:"Branch",value:t.worktree,onChange:e=>n({...t,worktree:e}),placeholder:"feat/auth"}):(0,r.jsx)(l.II,{label:"Subdir",value:t.subdir,onChange:e=>n({...t,subdir:e}),placeholder:"api"})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(l.gx,{label:"Initial task",value:t.task,onChange:e=>n({...t,task:e}),rows:2,placeholder:"initial task / prompt (optional)"})}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(l.zx,{variant:"primary",disabled:e.cmd.busy||!t.name.trim(),onClick:m,children:"Spawn"})})]}),0===h.length?(0,r.jsx)("div",{className:"empty",children:"No agents in this repository."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Role"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Working dir"}),(0,r.jsx)("th",{children:"Created"}),(0,r.jsx)("th",{})]})}),(0,r.jsx)("tbody",{children:h.map(t=>{var n;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"mono",children:t.name}),(0,r.jsx)("td",{children:t.role?(0,r.jsx)(l.Ct,{tone:"info",children:t.role}):"—"}),(0,r.jsx)("td",{children:(0,r.jsx)(l.OE,{status:t.status})}),(0,r.jsx)("td",{className:"mono faint",children:t.working_dir}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(t.created_at)}),(0,r.jsx)("td",{className:"nowrap",children:(0,r.jsxs)("div",{className:"hstack",children:[(0,r.jsx)(l.zx,{size:"sm",variant:"ghost",onClick:()=>e.selectRun(t.project_id,t.name),children:"Open"}),(0,r.jsx)(l.zx,{size:"sm",variant:"secondary",onClick:()=>e.killAgent(t.project_id,t.name),children:"Kill"}),(0,r.jsx)(l.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteAgent(t.project_id,t.name),children:"Delete"})]})})]}),("working"===t.status||"crashed"===t.status)&&(null===(n=t.last_output)||void 0===n?void 0:n.trim())&&(0,r.jsx)("tr",{children:(0,r.jsxs)("td",{colSpan:6,style:{paddingTop:0},children:[(0,r.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-xs)",marginBottom:4},children:["crashed"===t.status?"last output before crash":"live output",t.output_at?" \xb7 ".concat((0,i.Sy)(t.output_at)):""]}),(0,r.jsx)("pre",{className:"mono",style:{margin:0,padding:"8px 10px",background:"var(--surface-2, rgba(0,0,0,0.25))",borderRadius:6,fontSize:"var(--text-xs)",lineHeight:1.4,maxHeight:220,overflow:"auto",whiteSpace:"pre"},children:t.last_output})]})})]},t.id)})})]})})]})})]})}function h(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(d,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return l},Ph:function(){return h},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return f},mQ:function(){return m},zx:function(){return c}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function l(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function c(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:l="button",children:i}=e;return(0,r.jsx)("button",{type:l,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:l="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:l,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:l=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:l,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function m(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function f(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function x(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return l},FH:function(){return r},Q6:function(){return i},Sy:function(){return c}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function l(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let l=Math.floor(s/30);return l<12?"".concat(l,"mo"):"".concat(Math.floor(l/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:l}catch(e){n=l}}();var c=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?c=r.concat(c):u=-1,c.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=c.length;t;){for(r=c,c=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),h=(0,a.useMemo)(()=>e.agents.filter(t=>t.project_id===e.selectedProjectId),[e.agents,e.selectedProjectId]),m=async()=>{await e.spawnAgent(t)&&n(u)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Agents"}),(0,r.jsx)("div",{className:"section-desc",children:"Spawn agents into a repository and manage running sessions."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(l.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:d})})}),(0,r.jsxs)(l.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Spawn an agent"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(l.II,{label:"Name",value:t.name,onChange:e=>n({...t,name:e}),placeholder:"junior"}),(0,r.jsx)(l.Ph,{label:"Role",value:t.role,onChange:e=>n({...t,role:e}),options:c}),(0,r.jsx)(l.Ph,{label:"Placement",value:t.placement,onChange:e=>n({...t,placement:e}),options:o}),"worktree"===t.placement?(0,r.jsx)(l.II,{label:"Branch",value:t.worktree,onChange:e=>n({...t,worktree:e}),placeholder:"feat/auth"}):(0,r.jsx)(l.II,{label:"Subdir",value:t.subdir,onChange:e=>n({...t,subdir:e}),placeholder:"api"})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(l.gx,{label:"Initial task",value:t.task,onChange:e=>n({...t,task:e}),rows:2,placeholder:"initial task / prompt (optional)"})}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(l.zx,{variant:"primary",disabled:e.cmd.busy||!t.name.trim(),onClick:m,children:"Spawn"})})]}),0===h.length?(0,r.jsx)("div",{className:"empty",children:"No agents in this repository."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Role"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Working dir"}),(0,r.jsx)("th",{children:"Created"}),(0,r.jsx)("th",{})]})}),(0,r.jsx)("tbody",{children:h.map(t=>{var n;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"mono",children:t.name}),(0,r.jsx)("td",{children:t.role?(0,r.jsx)(l.Ct,{tone:"info",children:t.role}):"—"}),(0,r.jsx)("td",{children:(0,r.jsx)(l.OE,{status:t.status})}),(0,r.jsx)("td",{className:"mono faint",children:t.working_dir}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(t.created_at)}),(0,r.jsx)("td",{className:"nowrap",children:(0,r.jsxs)("div",{className:"hstack",children:[(0,r.jsx)(l.zx,{size:"sm",variant:"ghost",onClick:()=>e.selectRun(t.project_id,t.name),children:"Open"}),(0,r.jsx)(l.zx,{size:"sm",variant:"secondary",onClick:()=>e.killAgent(t.project_id,t.name),children:"Kill"}),(0,r.jsx)(l.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteAgent(t.project_id,t.name),children:"Delete"})]})})]}),("working"===t.status||"crashed"===t.status)&&(null===(n=t.last_output)||void 0===n?void 0:n.trim())&&(0,r.jsx)("tr",{children:(0,r.jsxs)("td",{colSpan:6,style:{paddingTop:0},children:[(0,r.jsxs)("div",{className:"faint",style:{fontSize:"var(--text-xs)",marginBottom:4},children:["crashed"===t.status?"last output before crash":"live output",t.output_at?" \xb7 ".concat((0,i.Sy)(t.output_at)):""]}),(0,r.jsx)("pre",{className:"mono",style:{margin:0,padding:"8px 10px",background:"var(--surface-2, rgba(0,0,0,0.25))",borderRadius:6,fontSize:"var(--text-xs)",lineHeight:1.4,maxHeight:220,overflow:"auto",whiteSpace:"pre"},children:t.last_output})]})})]},t.id)})})]})})]})})]})}function h(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(d,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return l},Ph:function(){return h},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return f},mQ:function(){return m},zx:function(){return c}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function l(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function c(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:l="button",children:i}=e;return(0,r.jsx)("button",{type:l,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:l="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:l,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:l=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:l,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function m(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function f(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function x(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return l},FH:function(){return r},Q6:function(){return i},Sy:function(){return c}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function l(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let l=Math.floor(s/30);return l<12?"".concat(l,"mo"):"".concat(Math.floor(l/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:l}catch(e){n=l}}();var c=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?c=r.concat(c):u=-1,c.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=c.length;t;){for(r=c,c=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),d=async()=>{await e.submitApproval(t),n(o)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Approvals"}),(0,r.jsx)("div",{className:"section-desc",children:"A merge is denied unless a standing approval exists — made by a different agent, pinned to the reviewed commit."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(c.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:u})})}),(0,r.jsxs)(c.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Record a verdict"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(c.II,{label:"Branch",value:t.branch,onChange:e=>n({...t,branch:e}),placeholder:"feat/auth"}),(0,r.jsx)(c.Ph,{label:"Verdict",value:t.status,onChange:e=>n({...t,status:e}),options:l}),(0,r.jsx)(c.II,{label:"Agent",value:t.agent_name,onChange:e=>n({...t,agent_name:e}),placeholder:"reads its HEAD (optional)"}),(0,r.jsx)(c.II,{label:"SHA",value:t.sha,onChange:e=>n({...t,sha:e}),placeholder:"pins the approval (optional)"})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(c.II,{label:"Note",value:t.note,onChange:e=>n({...t,note:e}),placeholder:"optional"})}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(c.zx,{variant:"primary",disabled:e.cmd.busy||!t.branch.trim(),onClick:d,children:"Enqueue verdict"})})]}),0===e.approvals.length?(0,r.jsx)("div",{className:"empty",children:"No approvals recorded."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Branch"}),(0,r.jsx)("th",{children:"Verdict"}),(0,r.jsx)("th",{children:"By"}),(0,r.jsx)("th",{children:"SHA"}),(0,r.jsx)("th",{children:"Note"})]})}),(0,r.jsx)("tbody",{children:e.approvals.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.branch}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.status})}),(0,r.jsx)("td",{children:e.approved_by_agent_id?"agent ".concat(e.approved_by_agent_id):e.actor||"—"}),(0,r.jsx)("td",{className:"mono",children:(0,i.Q6)(e.approved_sha)}),(0,r.jsx)("td",{children:e.note||"—"})]},e.id))})]})})]})})]})}function d(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(u,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return c},Ph:function(){return h},UW:function(){return m},ZD:function(){return v},Zb:function(){return i},gx:function(){return d},kN:function(){return p},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function c(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:c="button",children:i}=e;return(0,r.jsx)("button",{type:c,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:c="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:c,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:c=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:c,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function m(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return c},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function c(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let c=Math.floor(s/30);return c<12?"".concat(c,"mo"):"".concat(Math.floor(c/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var l=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),d=async()=>{await e.submitApproval(t),n(o)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Approvals"}),(0,r.jsx)("div",{className:"section-desc",children:"A merge is denied unless a standing approval exists — made by a different agent, pinned to the reviewed commit."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(c.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:u})})}),(0,r.jsxs)(c.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Record a verdict"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(c.II,{label:"Branch",value:t.branch,onChange:e=>n({...t,branch:e}),placeholder:"feat/auth"}),(0,r.jsx)(c.Ph,{label:"Verdict",value:t.status,onChange:e=>n({...t,status:e}),options:l}),(0,r.jsx)(c.II,{label:"Agent",value:t.agent_name,onChange:e=>n({...t,agent_name:e}),placeholder:"reads its HEAD (optional)"}),(0,r.jsx)(c.II,{label:"SHA",value:t.sha,onChange:e=>n({...t,sha:e}),placeholder:"pins the approval (optional)"})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(c.II,{label:"Note",value:t.note,onChange:e=>n({...t,note:e}),placeholder:"optional"})}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(c.zx,{variant:"primary",disabled:e.cmd.busy||!t.branch.trim(),onClick:d,children:"Enqueue verdict"})})]}),0===e.approvals.length?(0,r.jsx)("div",{className:"empty",children:"No approvals recorded."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Branch"}),(0,r.jsx)("th",{children:"Verdict"}),(0,r.jsx)("th",{children:"By"}),(0,r.jsx)("th",{children:"SHA"}),(0,r.jsx)("th",{children:"Note"})]})}),(0,r.jsx)("tbody",{children:e.approvals.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.branch}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.status})}),(0,r.jsx)("td",{children:e.approved_by_agent_id?"agent ".concat(e.approved_by_agent_id):e.actor||"—"}),(0,r.jsx)("td",{className:"mono",children:(0,i.Q6)(e.approved_sha)}),(0,r.jsx)("td",{children:e.note||"—"})]},e.id))})]})})]})})]})}function d(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(u,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return c},Ph:function(){return h},UW:function(){return m},ZD:function(){return v},Zb:function(){return i},gx:function(){return d},kN:function(){return p},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function c(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:c="button",children:i}=e;return(0,r.jsx)("button",{type:c,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:c="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:c,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:c=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:c,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function m(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return c},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function c(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let c=Math.floor(s/30);return c<12?"".concat(c,"mo"):"".concat(Math.floor(c/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var l=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;ne.href===t))||void 0===n?void 0:n.key)&&void 0!==s?s:"runs"}let u={runs:{count:e=>e.agents.length,accent:e=>e.agents.some(e=>"paused_for_input"===e.status)},repositories:{count:e=>e.projects.length},agents:{count:e=>e.agents.length},schedules:{count:e=>e.schedules.length},approvals:{count:e=>e.approvals.length},servers:{count:e=>e.hosts.length},activity:{count:e=>e.commands.length},shared:{count:e=>e.shared.context.length},login:{count:()=>0,accent:e=>"done"!==e.claudeLogin.status}};function d(e){let{onSignOut:n,children:s}=e,d=(0,r.Q)(),h=c((0,l.usePathname)()),{setSection:m}=d;return(0,a.useEffect)(()=>{m(h)},[h,m]),(0,t.jsxs)("div",{className:"app",children:[(0,t.jsxs)("aside",{className:"sidebar",children:[(0,t.jsxs)("div",{className:"brand",children:[(0,t.jsx)("span",{className:"logo"}),"Claude Monitor"]}),i.map(e=>{var n,s,a;let l=u[e.key],r=null!==(s=null==l?void 0:l.count(d))&&void 0!==s?s:0,i=null!==(a=null==l?void 0:null===(n=l.accent)||void 0===n?void 0:n.call(l,d))&&void 0!==a&&a;return(0,t.jsxs)(o.default,{href:e.href,className:"nav-item".concat(h===e.key?" active":""),children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"count",style:i?{color:"var(--lw-warning-fg)"}:void 0,children:r||""})]},e.key)}),(0,t.jsx)("div",{className:"sidebar-spacer"}),(0,t.jsxs)("div",{className:"sidebar-foot",children:[(0,t.jsxs)("button",{className:"nav-item",onClick:d.refresh,title:"Refresh now",children:[(0,t.jsx)("span",{children:"Refresh"}),(0,t.jsx)("span",{className:"count",children:"↻"})]}),(0,t.jsx)("button",{className:"nav-item",onClick:n,title:"Sign out / change token",children:(0,t.jsx)("span",{children:"Sign out"})})]})]}),(0,t.jsxs)("main",{className:"main",children:[d.cmd.text&&(0,t.jsx)("p",{className:"banner ".concat(d.cmd.error?"err":"ok"),style:{marginTop:16},children:d.cmd.text}),d.lastError&&(0,t.jsx)("p",{className:"banner err",style:{marginTop:12},children:d.lastError}),s]})]})}function h(e){let{error:n,onSubmit:s}=e,[l,r]=(0,a.useState)("");return(0,t.jsx)("div",{className:"gate",children:(0,t.jsxs)("form",{className:"gate-card",onSubmit:e=>{e.preventDefault();let n=l.trim();n&&s(n)},children:[(0,t.jsxs)("div",{className:"gate-brand",children:[(0,t.jsx)("span",{className:"logo",style:{width:26,height:26,borderRadius:7}}),"Claude Monitor"]}),(0,t.jsx)("p",{className:"muted",style:{fontSize:"var(--text-sm)",margin:0},children:"Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token."}),(0,t.jsx)("input",{className:"input",type:"password",autoComplete:"current-password",placeholder:"API token",value:l,onChange:e=>r(e.target.value),autoFocus:!0}),n&&(0,t.jsx)("p",{className:"callout callout-danger",style:{margin:0},children:n}),(0,t.jsx)("button",{className:"btn btn-primary",type:"submit",children:"Continue"})]})})}let m="handler_token";function p(e){let{children:n}=e,[s,o]=(0,a.useState)(null),[i,u]=(0,a.useState)(""),p=(0,l.usePathname)();(0,a.useEffect)(()=>{let e=window.localStorage.getItem(m);e&&o(e)},[]);let v=(0,a.useCallback)(e=>{window.localStorage.setItem(m,e),u(""),o(e)},[]),g=(0,a.useCallback)(()=>{window.localStorage.removeItem(m),o(null)},[]),f=(0,a.useCallback)(()=>{window.localStorage.removeItem(m),o(null),u("Invalid token — please try again.")},[]);return s?(0,t.jsx)(r._,{token:s,onUnauthorized:f,initialSection:c(p),children:(0,t.jsx)(d,{onSignOut:g,children:n})}):(0,t.jsx)(h,{error:i,onSubmit:v})}},7960:function(){}},function(e){e.O(0,[587,258,171,971,117,744],function(){return e(e.s=3471)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{1072:function(e,n,s){Promise.resolve().then(s.t.bind(s,7960,23)),Promise.resolve().then(s.bind(s,5520))},5520:function(e,n,s){"use strict";s.d(n,{AppFrame:function(){return p}});var t=s(7437),a=s(2265),l=s(9376),r=s(171),o=s(7648);let i=[{key:"runs",href:"/",label:"Runs"},{key:"repositories",href:"/repositories",label:"Repositories"},{key:"agents",href:"/agents",label:"Agents"},{key:"schedules",href:"/schedules",label:"Schedules"},{key:"approvals",href:"/approvals",label:"Approvals"},{key:"servers",href:"/servers",label:"Git Servers"},{key:"activity",href:"/activity",label:"Activity"},{key:"shared",href:"/shared",label:"Shared"},{key:"login",href:"/login",label:"Claude Login"}];function c(e){var n,s;let t=e.replace(/\/+$/,"")||"/";return null!==(s=null===(n=i.find(e=>e.href===t))||void 0===n?void 0:n.key)&&void 0!==s?s:"runs"}let u={runs:{count:e=>e.agents.length,accent:e=>e.agents.some(e=>"paused_for_input"===e.status)},repositories:{count:e=>e.projects.length},agents:{count:e=>e.agents.length},schedules:{count:e=>e.schedules.length},approvals:{count:e=>e.approvals.length},servers:{count:e=>e.hosts.length},activity:{count:e=>e.commands.length},shared:{count:e=>e.shared.context.length},login:{count:()=>0,accent:e=>"done"!==e.claudeLogin.status}};function d(e){let{onSignOut:n,children:s}=e,d=(0,r.Q)(),h=c((0,l.usePathname)()),{setSection:m}=d;return(0,a.useEffect)(()=>{m(h)},[h,m]),(0,t.jsxs)("div",{className:"app",children:[(0,t.jsxs)("aside",{className:"sidebar",children:[(0,t.jsxs)("div",{className:"brand",children:[(0,t.jsx)("span",{className:"logo"}),"Claude Monitor"]}),i.map(e=>{var n,s,a;let l=u[e.key],r=null!==(s=null==l?void 0:l.count(d))&&void 0!==s?s:0,i=null!==(a=null==l?void 0:null===(n=l.accent)||void 0===n?void 0:n.call(l,d))&&void 0!==a&&a;return(0,t.jsxs)(o.default,{href:e.href,className:"nav-item".concat(h===e.key?" active":""),children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"count",style:i?{color:"var(--lw-warning-fg)"}:void 0,children:r||""})]},e.key)}),(0,t.jsx)("div",{className:"sidebar-spacer"}),(0,t.jsxs)("div",{className:"sidebar-foot",children:[(0,t.jsxs)("button",{className:"nav-item",onClick:d.refresh,title:"Refresh now",children:[(0,t.jsx)("span",{children:"Refresh"}),(0,t.jsx)("span",{className:"count",children:"↻"})]}),(0,t.jsx)("button",{className:"nav-item",onClick:n,title:"Sign out / change token",children:(0,t.jsx)("span",{children:"Sign out"})})]})]}),(0,t.jsxs)("main",{className:"main",children:[d.cmd.text&&(0,t.jsx)("p",{className:"banner ".concat(d.cmd.error?"err":"ok"),style:{marginTop:16},children:d.cmd.text}),d.lastError&&(0,t.jsx)("p",{className:"banner err",style:{marginTop:12},children:d.lastError}),s]})]})}function h(e){let{error:n,onSubmit:s}=e,[l,r]=(0,a.useState)("");return(0,t.jsx)("div",{className:"gate",children:(0,t.jsxs)("form",{className:"gate-card",onSubmit:e=>{e.preventDefault();let n=l.trim();n&&s(n)},children:[(0,t.jsxs)("div",{className:"gate-brand",children:[(0,t.jsx)("span",{className:"logo",style:{width:26,height:26,borderRadius:7}}),"Claude Monitor"]}),(0,t.jsx)("p",{className:"muted",style:{fontSize:"var(--text-sm)",margin:0},children:"Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token."}),(0,t.jsx)("input",{className:"input",type:"password",autoComplete:"current-password",placeholder:"API token",value:l,onChange:e=>r(e.target.value),autoFocus:!0}),n&&(0,t.jsx)("p",{className:"callout callout-danger",style:{margin:0},children:n}),(0,t.jsx)("button",{className:"btn btn-primary",type:"submit",children:"Continue"})]})})}let m="handler_token";function p(e){let{children:n}=e,[s,o]=(0,a.useState)(null),[i,u]=(0,a.useState)(""),p=(0,l.usePathname)();(0,a.useEffect)(()=>{let e=window.localStorage.getItem(m);e&&o(e)},[]);let v=(0,a.useCallback)(e=>{window.localStorage.setItem(m,e),u(""),o(e)},[]),g=(0,a.useCallback)(()=>{window.localStorage.removeItem(m),o(null)},[]),f=(0,a.useCallback)(()=>{window.localStorage.removeItem(m),o(null),u("Invalid token — please try again.")},[]);return s?(0,t.jsx)(r._,{token:s,onUnauthorized:f,initialSection:c(p),children:(0,t.jsx)(d,{onSignOut:g,children:n})}):(0,t.jsx)(h,{error:i,onSubmit:v})}},7960:function(){}},function(e){e.O(0,[587,258,171,971,117,744],function(){return e(e.s=1072)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/src/handler/api/static/_next/static/chunks/app/login/page-49e21c8c7c3a9dd8.js b/src/handler/api/static/_next/static/chunks/app/login/page-2f7fdd148631e2b5.js similarity index 98% rename from src/handler/api/static/_next/static/chunks/app/login/page-49e21c8c7c3a9dd8.js rename to src/handler/api/static/_next/static/chunks/app/login/page-2f7fdd148631e2b5.js index 90bc6ae..9254fd1 100644 --- a/src/handler/api/static/_next/static/chunks/app/login/page-49e21c8c7c3a9dd8.js +++ b/src/handler/api/static/_next/static/chunks/app/login/page-2f7fdd148631e2b5.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[626],{6258:function(e,n,t){Promise.resolve().then(t.bind(t,9347))},9347:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return l}});var r=t(7437),i=t(2265),a=t(171),c=t(8280);function o(e){let n=window.screenX+Math.max(0,(window.outerWidth-520)/2),t=window.screenY+Math.max(0,(window.outerHeight-760)/2);return window.open(e,"claude-login","popup=yes,width=".concat(520,",height=").concat(760,",left=").concat(Math.round(n),",top=").concat(Math.round(t)))}function s(){let e=(0,a.Q)(),{status:n,url:t,message:s}=e.claudeLogin,[l,u]=(0,i.useState)(""),d=(0,i.useRef)(null),f="starting"===n||"submitting"===n,h="awaiting"===n||"submitting"===n;(0,i.useEffect)(()=>{if("awaiting"===n&&t&&d.current&&!d.current.closed)try{d.current.location.href=t}catch(e){}if("done"===n||"error"===n){var e;null===(e=d.current)||void 0===e||e.close(),d.current=null}},[n,t]);let p=()=>{d.current=o("about:blank"),e.startClaudeLogin()},m=async()=>{await e.submitClaudeCode(l)&&u("")};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Claude Login"}),(0,r.jsxs)("div",{className:"section-desc",children:["Log Claude Code in on the host so agents can run. This drives"," ",(0,r.jsx)("span",{className:"mono",children:"claude /login"})," in the control container and picks the Claude account with a subscription."]})]}),(0,r.jsxs)("div",{className:"section-body",style:{display:"flex",flexDirection:"column",gap:16},children:[s&&(0,r.jsx)(c.UW,{tone:"error"===n?"danger":"done"===n?"success":"info",children:s}),"done"===n?(0,r.jsx)("div",{children:(0,r.jsx)(c.zx,{variant:"secondary",onClick:e.resetClaudeLogin,children:"Log in again"})}):h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.UW,{tone:"info",children:"A Claude sign-in window should have opened. Authorize there, copy the code Claude shows you, and paste it below. If the window didn't open (popups blocked), use the button."}),(0,r.jsxs)("div",{className:"hstack",style:{gap:10,flexWrap:"wrap"},children:[(0,r.jsx)(c.zx,{variant:"secondary",disabled:!t,onClick:()=>{t&&(d.current=o(t))},children:"Open Claude sign-in window ↗"}),t&&(0,r.jsx)("a",{className:"btn btn-ghost",href:t,target:"_blank",rel:"noopener noreferrer",children:"Open in a new tab"}),(0,r.jsx)(c.zx,{variant:"ghost",disabled:f,onClick:p,children:"Restart"})]}),(0,r.jsxs)("div",{className:"hstack",style:{gap:10,alignItems:"flex-end",flexWrap:"wrap"},children:[(0,r.jsx)("div",{style:{flex:"1 1 320px"},children:(0,r.jsx)(c.II,{label:"Authorization code",value:l,onChange:u,placeholder:"Paste the code from claude.com",disabled:"submitting"===n})}),(0,r.jsx)(c.zx,{variant:"primary",disabled:"submitting"===n||!l.trim(),onClick:m,children:"submitting"===n?"Submitting…":"Finish login"})]})]}):(0,r.jsxs)("div",{className:"hstack",style:{gap:10},children:[(0,r.jsx)(c.zx,{variant:"primary",disabled:f,onClick:p,children:"starting"===n?"Starting…":"Log in to Claude"}),"error"===n&&(0,r.jsx)(c.zx,{variant:"ghost",disabled:f,onClick:p,children:"Retry"})]})]})]})}function l(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(s,{})})}},8280:function(e,n,t){"use strict";t.d(n,{Ct:function(){return a},II:function(){return u},OE:function(){return c},Ph:function(){return f},UW:function(){return m},ZD:function(){return g},Zb:function(){return o},gx:function(){return d},kN:function(){return p},mQ:function(){return h},zx:function(){return s}});var r=t(7437),i=t(6039);function a(e){let{tone:n="neutral",pill:t=!1,dot:i=!1,children:a}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(n).concat(t?" pill":""),children:[i&&(0,r.jsx)("span",{className:"dot"}),a]})}function c(e){let{status:n}=e;return(0,r.jsx)(a,{tone:(0,i.FH)(n),children:(0,i.Cf)(n)})}function o(e){let{children:n,interactive:t=!1,onClick:i,className:a=""}=e;return(0,r.jsx)("div",{className:"card".concat(t?" interactive":""," ").concat(a).trim(),onClick:i,role:t?"button":void 0,tabIndex:t?0:void 0,children:n})}function s(e){let{variant:n="secondary",size:t="md",onClick:i,disabled:a,type:c="button",children:o}=e;return(0,r.jsx)("button",{type:c,className:"btn btn-".concat(n).concat("sm"===t?" btn-sm":""),onClick:i,disabled:a,children:o})}function l(e){let{label:n,children:t}=e;return(0,r.jsxs)("label",{className:"field",children:[n&&(0,r.jsx)("span",{className:"field-label",children:n}),t]})}function u(e){let{label:n,value:t,onChange:i,placeholder:a,type:c="text",disabled:o}=e;return(0,r.jsx)(l,{label:n,children:(0,r.jsx)("input",{className:"input",type:c,value:t,placeholder:a,disabled:o,onChange:e=>i(e.target.value)})})}function d(e){let{label:n,value:t,onChange:i,placeholder:a,rows:c=3}=e;return(0,r.jsx)(l,{label:n,children:(0,r.jsx)("textarea",{className:"textarea",value:t,rows:c,placeholder:a,onChange:e=>i(e.target.value)})})}function f(e){let{label:n,value:t,onChange:i,options:a}=e;return(0,r.jsx)(l,{label:n,children:(0,r.jsx)("select",{className:"select",value:t,onChange:e=>i(e.target.value),children:a.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function h(e){let{tabs:n,value:t,onChange:i}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:n.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":t===e.value,className:"tab".concat(t===e.value?" active":""),onClick:()=>i(e.value),children:e.label},e.value))})}function p(e){let{value:n,label:t,sub:i,accent:a=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(a?" accent":""),children:n}),(0,r.jsx)("div",{className:"stat-label",children:t}),i&&(0,r.jsx)("div",{className:"stat-sub",children:i})]})}function m(e){let{tone:n="info",children:t}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(n),children:t})}function g(e){let{on:n,onClick:t}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(n?" on":""),"aria-pressed":n,onClick:t,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,n,t){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}t.d(n,{Cf:function(){return a},Eh:function(){return c},FH:function(){return r},Q6:function(){return o},Sy:function(){return s}});let i={paused_for_input:"Needs input",not_applicable:"N/A"};function a(e){let n=(null!=e?e:"").trim();if(!n)return"—";let t=n.toLowerCase();return i[t]?i[t]:t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function c(e){if(!e)return"—";let n=new Date(e);return Number.isNaN(n.getTime())?String(e):n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function o(e){return e?e.slice(0,7):"—"}function s(e){if(!e)return"—";let n=new Date(e).getTime();if(Number.isNaN(n))return"—";let t=Math.max(0,Math.floor((Date.now()-n)/1e3));if(t<60)return"".concat(t,"s");let r=Math.floor(t/60);if(r<60)return"".concat(r,"m");let i=Math.floor(r/60);if(i<24)return"".concat(i,"h");let a=Math.floor(i/24);if(a<30)return"".concat(a,"d");let c=Math.floor(a/30);return c<12?"".concat(c,"mo"):"".concat(Math.floor(c/12),"y")}},257:function(e,n,t){"use strict";var r,i;e.exports=(null==(r=t.g.process)?void 0:r.env)&&"object"==typeof(null==(i=t.g.process)?void 0:i.env)?t.g.process:t(4227)},4227:function(e){!function(){var n={229:function(e){var n,t,r,i=e.exports={};function a(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function o(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{t="function"==typeof clearTimeout?clearTimeout:c}catch(e){t=c}}();var s=[],l=!1,u=-1;function d(){l&&r&&(l=!1,r.length?s=r.concat(s):u=-1,s.length&&f())}function f(){if(!l){var e=o(d);l=!0;for(var n=s.length;n;){for(r=s,s=[];++u1)for(var t=1;t{if("awaiting"===n&&t&&d.current&&!d.current.closed)try{d.current.location.href=t}catch(e){}if("done"===n||"error"===n){var e;null===(e=d.current)||void 0===e||e.close(),d.current=null}},[n,t]);let p=()=>{d.current=o("about:blank"),e.startClaudeLogin()},m=async()=>{await e.submitClaudeCode(l)&&u("")};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Claude Login"}),(0,r.jsxs)("div",{className:"section-desc",children:["Log Claude Code in on the host so agents can run. This drives"," ",(0,r.jsx)("span",{className:"mono",children:"claude /login"})," in the control container and picks the Claude account with a subscription."]})]}),(0,r.jsxs)("div",{className:"section-body",style:{display:"flex",flexDirection:"column",gap:16},children:[s&&(0,r.jsx)(c.UW,{tone:"error"===n?"danger":"done"===n?"success":"info",children:s}),"done"===n?(0,r.jsx)("div",{children:(0,r.jsx)(c.zx,{variant:"secondary",onClick:e.resetClaudeLogin,children:"Log in again"})}):h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.UW,{tone:"info",children:"A Claude sign-in window should have opened. Authorize there, copy the code Claude shows you, and paste it below. If the window didn't open (popups blocked), use the button."}),(0,r.jsxs)("div",{className:"hstack",style:{gap:10,flexWrap:"wrap"},children:[(0,r.jsx)(c.zx,{variant:"secondary",disabled:!t,onClick:()=>{t&&(d.current=o(t))},children:"Open Claude sign-in window ↗"}),t&&(0,r.jsx)("a",{className:"btn btn-ghost",href:t,target:"_blank",rel:"noopener noreferrer",children:"Open in a new tab"}),(0,r.jsx)(c.zx,{variant:"ghost",disabled:f,onClick:p,children:"Restart"})]}),(0,r.jsxs)("div",{className:"hstack",style:{gap:10,alignItems:"flex-end",flexWrap:"wrap"},children:[(0,r.jsx)("div",{style:{flex:"1 1 320px"},children:(0,r.jsx)(c.II,{label:"Authorization code",value:l,onChange:u,placeholder:"Paste the code from claude.com",disabled:"submitting"===n})}),(0,r.jsx)(c.zx,{variant:"primary",disabled:"submitting"===n||!l.trim(),onClick:m,children:"submitting"===n?"Submitting…":"Finish login"})]})]}):(0,r.jsxs)("div",{className:"hstack",style:{gap:10},children:[(0,r.jsx)(c.zx,{variant:"primary",disabled:f,onClick:p,children:"starting"===n?"Starting…":"Log in to Claude"}),"error"===n&&(0,r.jsx)(c.zx,{variant:"ghost",disabled:f,onClick:p,children:"Retry"})]})]})]})}function l(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(s,{})})}},8280:function(e,n,t){"use strict";t.d(n,{Ct:function(){return a},II:function(){return u},OE:function(){return c},Ph:function(){return f},UW:function(){return m},ZD:function(){return g},Zb:function(){return o},gx:function(){return d},kN:function(){return p},mQ:function(){return h},zx:function(){return s}});var r=t(7437),i=t(6039);function a(e){let{tone:n="neutral",pill:t=!1,dot:i=!1,children:a}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(n).concat(t?" pill":""),children:[i&&(0,r.jsx)("span",{className:"dot"}),a]})}function c(e){let{status:n}=e;return(0,r.jsx)(a,{tone:(0,i.FH)(n),children:(0,i.Cf)(n)})}function o(e){let{children:n,interactive:t=!1,onClick:i,className:a=""}=e;return(0,r.jsx)("div",{className:"card".concat(t?" interactive":""," ").concat(a).trim(),onClick:i,role:t?"button":void 0,tabIndex:t?0:void 0,children:n})}function s(e){let{variant:n="secondary",size:t="md",onClick:i,disabled:a,type:c="button",children:o}=e;return(0,r.jsx)("button",{type:c,className:"btn btn-".concat(n).concat("sm"===t?" btn-sm":""),onClick:i,disabled:a,children:o})}function l(e){let{label:n,children:t}=e;return(0,r.jsxs)("label",{className:"field",children:[n&&(0,r.jsx)("span",{className:"field-label",children:n}),t]})}function u(e){let{label:n,value:t,onChange:i,placeholder:a,type:c="text",disabled:o}=e;return(0,r.jsx)(l,{label:n,children:(0,r.jsx)("input",{className:"input",type:c,value:t,placeholder:a,disabled:o,onChange:e=>i(e.target.value)})})}function d(e){let{label:n,value:t,onChange:i,placeholder:a,rows:c=3}=e;return(0,r.jsx)(l,{label:n,children:(0,r.jsx)("textarea",{className:"textarea",value:t,rows:c,placeholder:a,onChange:e=>i(e.target.value)})})}function f(e){let{label:n,value:t,onChange:i,options:a}=e;return(0,r.jsx)(l,{label:n,children:(0,r.jsx)("select",{className:"select",value:t,onChange:e=>i(e.target.value),children:a.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function h(e){let{tabs:n,value:t,onChange:i}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:n.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":t===e.value,className:"tab".concat(t===e.value?" active":""),onClick:()=>i(e.value),children:e.label},e.value))})}function p(e){let{value:n,label:t,sub:i,accent:a=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(a?" accent":""),children:n}),(0,r.jsx)("div",{className:"stat-label",children:t}),i&&(0,r.jsx)("div",{className:"stat-sub",children:i})]})}function m(e){let{tone:n="info",children:t}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(n),children:t})}function g(e){let{on:n,onClick:t}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(n?" on":""),"aria-pressed":n,onClick:t,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,n,t){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}t.d(n,{Cf:function(){return a},Eh:function(){return c},FH:function(){return r},Q6:function(){return o},Sy:function(){return s}});let i={paused_for_input:"Needs input",not_applicable:"N/A"};function a(e){let n=(null!=e?e:"").trim();if(!n)return"—";let t=n.toLowerCase();return i[t]?i[t]:t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function c(e){if(!e)return"—";let n=new Date(e);return Number.isNaN(n.getTime())?String(e):n.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function o(e){return e?e.slice(0,7):"—"}function s(e){if(!e)return"—";let n=new Date(e).getTime();if(Number.isNaN(n))return"—";let t=Math.max(0,Math.floor((Date.now()-n)/1e3));if(t<60)return"".concat(t,"s");let r=Math.floor(t/60);if(r<60)return"".concat(r,"m");let i=Math.floor(r/60);if(i<24)return"".concat(i,"h");let a=Math.floor(i/24);if(a<30)return"".concat(a,"d");let c=Math.floor(a/30);return c<12?"".concat(c,"mo"):"".concat(Math.floor(c/12),"y")}},257:function(e,n,t){"use strict";var r,i;e.exports=(null==(r=t.g.process)?void 0:r.env)&&"object"==typeof(null==(i=t.g.process)?void 0:i.env)?t.g.process:t(4227)},4227:function(e){!function(){var n={229:function(e){var n,t,r,i=e.exports={};function a(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function o(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{t="function"==typeof clearTimeout?clearTimeout:c}catch(e){t=c}}();var s=[],l=!1,u=-1;function d(){l&&r&&(l=!1,r.length?s=r.concat(s):u=-1,s.length&&f())}function f(){if(!l){var e=o(d);l=!0;for(var n=s.length;n;){for(r=s,s=[];++u1)for(var t=1;t[...e.agents.filter(e=>{var n;return n=e.status,"all"===t||("needs"===t?"paused_for_input"===n:"working"===t?"working"===n||"running"===n:"done"===t?"done"===n||"completed"===n:"crashed"!==t||"crashed"===n||"blocked"===n)})].sort((e,t)=>e.created_at"paused_for_input"===e.status).length,p=e.agents.filter(e=>"working"===e.status||"running"===e.status).length;return(0,s.jsxs)("div",{className:"runs",children:[(0,s.jsx)("div",{className:"runs-stats",children:(0,s.jsxs)("div",{className:"stat-row",children:[(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:e.agents.length,label:"Runs tracked"})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:x,label:"Needs input",accent:!0})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:p,label:"Working"})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:e.projects.length,label:"Repositories"})})]})}),(0,s.jsxs)("div",{className:"split",children:[(0,s.jsxs)("div",{className:"split-list",children:[(0,s.jsxs)("div",{className:"split-list-head",children:[(0,s.jsx)("div",{className:"section-title",style:{fontSize:"var(--text-lg)"},children:"Runs"}),(0,s.jsx)(a.mQ,{tabs:c,value:t,onChange:n})]}),(0,s.jsxs)("div",{className:"split-list-scroll",children:[0===i.length&&(0,s.jsx)(a.UW,{tone:"info",children:"No runs match this filter."}),i.map(t=>(0,s.jsx)(d,{agent:t,selected:(null==o?void 0:o.projectId)===t.project_id&&(null==o?void 0:o.name)===t.name,onSelect:()=>e.selectRun(t.project_id,t.name)},"".concat(t.project_id,"/").concat(t.name)))]})]}),(0,s.jsx)("div",{className:"split-detail",children:o?(0,s.jsx)(h,{}):(0,s.jsx)(u,{})})]})]})}function d(e){let{agent:t,selected:n,onSelect:r}=e;return(0,s.jsxs)("button",{className:"run-row".concat(n?" selected":""),onClick:r,children:[(0,s.jsxs)("div",{className:"run-row-top",children:[(0,s.jsx)("span",{className:"run-project",children:t.project_id}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:(0,i.Sy)(t.created_at)})]}),(0,s.jsxs)("div",{className:"truncate muted",style:{fontSize:"var(--text-sm)"},children:[t.name,t.role?" \xb7 ".concat(t.role):""]}),(0,s.jsx)("div",{className:"hstack",style:{gap:8},children:(0,s.jsx)(a.OE,{status:t.status})})]})}function u(){return(0,s.jsx)("div",{style:{padding:"60px 32px",color:"var(--text-muted)"},children:"Select a run to see its checkmark, log, and any open question."})}function h(){var e;let t=(0,l.Q)(),n=t.selectedRun,c=t.agents.find(e=>e.project_id===n.projectId&&e.name===n.name),o=t.checkmark,[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!1),f=(null==c?void 0:c.status)==="paused_for_input",m=async e=>{if(!d.trim())return;p(!0);let n=await t.submitAnswer(d.trim(),e);p(!1),n&&u("")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{padding:"24px 28px",borderBottom:"1px solid var(--border-default)",display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsxs)("div",{className:"hstack",children:[(0,s.jsx)("span",{style:{color:"var(--accent)",fontWeight:"var(--fw-bold)",fontSize:"var(--text-xl)"},children:n.projectId}),(0,s.jsx)("span",{className:"faint",children:"/"}),(0,s.jsx)("span",{style:{color:"var(--text-heading)",fontWeight:"var(--fw-semibold)",fontSize:"var(--text-lg)"},children:n.name}),(0,s.jsx)(a.OE,{status:null==c?void 0:c.status}),(null==c?void 0:c.role)&&(0,s.jsx)(a.Ct,{tone:"info",children:c.role}),(0,s.jsx)("span",{className:"spacer"}),(0,s.jsx)(a.zx,{size:"sm",variant:"secondary",onClick:()=>t.killAgent(n.projectId,n.name),children:"Kill"}),(0,s.jsx)(a.zx,{size:"sm",variant:"danger",onClick:()=>t.deleteAgent(n.projectId,n.name),children:"Delete row"})]}),(0,s.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)"},children:[null!==(e=null==c?void 0:c.working_dir)&&void 0!==e?e:"—"," \xb7 created ",(0,i.Eh)(null==c?void 0:c.created_at)]})]}),(0,s.jsxs)("div",{style:{padding:"20px 28px",display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"eyebrow",style:{marginBottom:10},children:"Checkmark"}),t.checkmarkMissing&&(0,s.jsx)(a.UW,{tone:"info",children:"No checkpoint recorded yet."}),o&&!t.checkmarkMissing&&(0,s.jsxs)("dl",{className:"kv",children:[(0,s.jsx)("dt",{children:"Status"}),(0,s.jsx)("dd",{children:(0,s.jsx)(a.OE,{status:o.status})}),(0,s.jsx)("dt",{children:"Where it stopped"}),(0,s.jsx)("dd",{children:o.where_it_stopped||"—"}),(0,s.jsx)("dt",{children:"Open question"}),(0,s.jsx)("dd",{children:o.open_question||"—"}),(0,s.jsx)("dt",{children:"Next steps"}),(0,s.jsx)("dd",{children:o.next_steps&&o.next_steps.length>0?(0,s.jsx)("ul",{children:o.next_steps.map((e,t)=>(0,s.jsx)("li",{children:e},t))}):"—"}),(0,s.jsx)("dt",{children:"Tests"}),(0,s.jsxs)("dd",{className:"hstack",children:[(0,s.jsx)(a.Ct,{tone:(0,i.FH)(o.tests_status),children:o.tests_status}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:o.tested_at?(0,i.Eh)(o.tested_at):""})]}),(0,s.jsx)("dt",{children:"Build"}),(0,s.jsxs)("dd",{className:"hstack",children:[(0,s.jsx)(a.Ct,{tone:(0,i.FH)(o.build_status),children:o.build_status}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:o.built_at?(0,i.Eh)(o.built_at):""})]}),(0,s.jsx)("dt",{children:"Checkpoint at"}),(0,s.jsx)("dd",{className:"faint",children:(0,i.Eh)(o.checkpoint_at)})]})]}),f&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsx)("div",{className:"eyebrow",children:"Answer this question"}),(0,s.jsx)(a.UW,{tone:"danger",children:(null==o?void 0:o.open_question)||"(no question text on the checkmark)"}),(0,s.jsx)(a.gx,{value:d,onChange:u,rows:3,placeholder:"Your answer…"}),(0,s.jsxs)("div",{className:"hstack",children:[(0,s.jsx)(a.zx,{variant:"secondary",disabled:h||!d.trim(),onClick:()=>m(!1),children:"Answer"}),(0,s.jsx)(a.zx,{variant:"primary",disabled:h||!d.trim(),onClick:()=>m(!0),children:"Answer & Resume"})]})]}),(null==c?void 0:c.session_id)&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsxs)("div",{className:"eyebrow",children:["Run events",c.worker_id?(0,s.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)",marginLeft:8},children:["on ",c.worker_id]}):null]}),0===t.events.length?(0,s.jsx)("div",{className:"empty",children:"No events yet."}):(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6,maxHeight:420,overflow:"auto",padding:"10px 12px",background:"var(--surface-2, rgba(0,0,0,0.25))",borderRadius:6},children:t.events.map(e=>(0,s.jsx)(x,{e:e},e.id))})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsx)("div",{className:"eyebrow",children:"Log \xb7 newest first"}),0===t.log.length?(0,s.jsx)("div",{className:"empty",children:"No log entries."}):(0,s.jsx)("div",{className:"table-wrap",children:(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"When"}),(0,s.jsx)("th",{children:"Status"}),(0,s.jsx)("th",{children:"Summary"}),(0,s.jsx)("th",{children:"Q / A"}),(0,s.jsx)("th",{children:"Push"}),(0,s.jsx)("th",{children:"CI"})]})}),(0,s.jsx)("tbody",{children:t.log.map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,s.jsx)("td",{children:(0,s.jsx)(a.OE,{status:e.status})}),(0,s.jsx)("td",{children:e.summary||"—"}),(0,s.jsxs)("td",{children:[e.question&&(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Q:"})," ",e.question]}),e.answer&&(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"A:"})," ",e.answer]}),!e.question&&!e.answer&&"—"]}),(0,s.jsx)("td",{className:"mono",children:(0,i.Q6)(e.push_sha)}),(0,s.jsx)("td",{children:(0,s.jsx)(a.Ct,{tone:(0,i.FH)(e.ci_status),children:e.ci_status})})]},e.id))})]})}),(0,s.jsxs)("div",{className:"pager",children:[(0,s.jsx)(a.zx,{size:"sm",variant:"ghost",disabled:0===t.logOffset,onClick:()=>t.pageLog(-1),children:"‹ Newer"}),(0,s.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:["offset ",t.logOffset]}),(0,s.jsx)(a.zx,{size:"sm",variant:"ghost",disabled:t.log.length<100,onClick:()=>t.pageLog(1),children:"Older ›"})]})]})]})]})}function x(e){var t,n,r,l;let{e:i}=e,c=null!==(t=i.payload)&&void 0!==t?t:{},o={fontSize:"var(--text-xs)"};if("system"===i.type)return(0,s.jsxs)("div",{className:"faint mono",style:o,children:["▸ session ",null!==(n=c.subtype)&&void 0!==n?n:"event",c.session_id?" \xb7 ".concat(String(c.session_id).slice(0,8)):"",Array.isArray(c.tools)?" \xb7 ".concat(c.tools.length," tools"):""]});if("assistant"===i.type){let e=null===(r=c.message)||void 0===r?void 0:r.content,t=Array.isArray(e)?e:[],n=t.filter(e=>(null==e?void 0:e.type)==="text"&&e.text).map(e=>e.text).join("\n"),l=t.filter(e=>(null==e?void 0:e.type)==="tool_use");return(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[n&&(0,s.jsx)("div",{style:{fontSize:"var(--text-sm)",whiteSpace:"pre-wrap"},children:n}),l.length>0&&(0,s.jsx)("div",{className:"hstack",style:{gap:6,flexWrap:"wrap"},children:l.map((e,t)=>(0,s.jsxs)(a.Ct,{tone:"info",children:[e.name,e.input?": ".concat(function(e){let t="string"==typeof e?e:(null==e?void 0:e.command)?String(e.command):JSON.stringify(e);return t.length>80?"".concat(t.slice(0,77),"…"):t}(e.input)):""]},t))})]})}if("result"===i.type){let e=!!c.is_error;return(0,s.jsxs)("div",{className:"hstack",style:{gap:8,flexWrap:"wrap"},children:[(0,s.jsx)(a.Ct,{tone:e?"danger":"success",children:e?"run errored":"run finished"}),(0,s.jsxs)("span",{className:"faint mono",style:o,children:[null!=c.num_turns?"".concat(c.num_turns," turns"):"",null!=c.total_cost_usd?" \xb7 $".concat(Number(c.total_cost_usd).toFixed(4)):""]}),"string"==typeof c.result&&c.result&&(0,s.jsx)("span",{className:"muted",style:{...o,whiteSpace:"pre-wrap",width:"100%"},children:c.result})]})}return"worker"===i.type?(0,s.jsxs)(a.UW,{tone:"danger",children:[null!==(l=c.notice)&&void 0!==l?l:"runner notice",c.stderr_tail?(0,s.jsx)("pre",{className:"mono",style:{...o,margin:"6px 0 0",whiteSpace:"pre-wrap"},children:c.stderr_tail}):null]}):"raw"===i.type?(0,s.jsx)("div",{className:"faint mono",style:{...o,whiteSpace:"pre-wrap"},children:"string"==typeof c.line?c.line.trimEnd():JSON.stringify(c)}):(0,s.jsxs)("div",{className:"faint mono",style:o,children:["▸ ",i.type]})}function p(){return(0,s.jsx)(o,{})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return l},II:function(){return d},OE:function(){return a},Ph:function(){return h},UW:function(){return f},ZD:function(){return m},Zb:function(){return i},gx:function(){return u},kN:function(){return p},mQ:function(){return x},zx:function(){return c}});var s=n(7437),r=n(6039);function l(e){let{tone:t="neutral",pill:n=!1,dot:r=!1,children:l}=e;return(0,s.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[r&&(0,s.jsx)("span",{className:"dot"}),l]})}function a(e){let{status:t}=e;return(0,s.jsx)(l,{tone:(0,r.FH)(t),children:(0,r.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:r,className:l=""}=e;return(0,s.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(l).trim(),onClick:r,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function c(e){let{variant:t="secondary",size:n="md",onClick:r,disabled:l,type:a="button",children:i}=e;return(0,s.jsx)("button",{type:a,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:r,disabled:l,children:i})}function o(e){let{label:t,children:n}=e;return(0,s.jsxs)("label",{className:"field",children:[t&&(0,s.jsx)("span",{className:"field-label",children:t}),n]})}function d(e){let{label:t,value:n,onChange:r,placeholder:l,type:a="text",disabled:i}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("input",{className:"input",type:a,value:n,placeholder:l,disabled:i,onChange:e=>r(e.target.value)})})}function u(e){let{label:t,value:n,onChange:r,placeholder:l,rows:a=3}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("textarea",{className:"textarea",value:n,rows:a,placeholder:l,onChange:e=>r(e.target.value)})})}function h(e){let{label:t,value:n,onChange:r,options:l}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("select",{className:"select",value:n,onChange:e=>r(e.target.value),children:l.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})})}function x(e){let{tabs:t,value:n,onChange:r}=e;return(0,s.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,s.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>r(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:r,accent:l=!1}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"stat-value".concat(l?" accent":""),children:t}),(0,s.jsx)("div",{className:"stat-label",children:n}),r&&(0,s.jsx)("div",{className:"stat-sub",children:r})]})}function f(e){let{tone:t="info",children:n}=e;return(0,s.jsx)("div",{className:"callout callout-".concat(t),children:n})}function m(e){let{on:t,onClick:n}=e;return(0,s.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,s.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function s(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return l},Eh:function(){return a},FH:function(){return s},Q6:function(){return i},Sy:function(){return c}});let r={paused_for_input:"Needs input",not_applicable:"N/A"};function l(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return r[n]?r[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function a(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let s=Math.floor(n/60);if(s<60)return"".concat(s,"m");let r=Math.floor(s/60);if(r<24)return"".concat(r,"h");let l=Math.floor(r/24);if(l<30)return"".concat(l,"d");let a=Math.floor(l/30);return a<12?"".concat(a,"mo"):"".concat(Math.floor(a/12),"y")}},257:function(e,t,n){"use strict";var s,r;e.exports=(null==(s=n.g.process)?void 0:s.env)&&"object"==typeof(null==(r=n.g.process)?void 0:r.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,s,r=e.exports={};function l(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:l}catch(e){t=l}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c=[],o=!1,d=-1;function u(){o&&s&&(o=!1,s.length?c=s.concat(c):d=-1,c.length&&h())}function h(){if(!o){var e=i(u);o=!0;for(var t=c.length;t;){for(s=c,c=[];++d1)for(var n=1;n[...e.agents.filter(e=>{var n;return n=e.status,"all"===t||("needs"===t?"paused_for_input"===n:"working"===t?"working"===n||"running"===n:"done"===t?"done"===n||"completed"===n:"crashed"!==t||"crashed"===n||"blocked"===n)})].sort((e,t)=>e.created_at"paused_for_input"===e.status).length,p=e.agents.filter(e=>"working"===e.status||"running"===e.status).length;return(0,s.jsxs)("div",{className:"runs",children:[(0,s.jsx)("div",{className:"runs-stats",children:(0,s.jsxs)("div",{className:"stat-row",children:[(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:e.agents.length,label:"Runs tracked"})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:x,label:"Needs input",accent:!0})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:p,label:"Working"})}),(0,s.jsx)("div",{className:"stat-cell",children:(0,s.jsx)(a.kN,{value:e.projects.length,label:"Repositories"})})]})}),(0,s.jsxs)("div",{className:"split",children:[(0,s.jsxs)("div",{className:"split-list",children:[(0,s.jsxs)("div",{className:"split-list-head",children:[(0,s.jsx)("div",{className:"section-title",style:{fontSize:"var(--text-lg)"},children:"Runs"}),(0,s.jsx)(a.mQ,{tabs:c,value:t,onChange:n})]}),(0,s.jsxs)("div",{className:"split-list-scroll",children:[0===i.length&&(0,s.jsx)(a.UW,{tone:"info",children:"No runs match this filter."}),i.map(t=>(0,s.jsx)(d,{agent:t,selected:(null==o?void 0:o.projectId)===t.project_id&&(null==o?void 0:o.name)===t.name,onSelect:()=>e.selectRun(t.project_id,t.name)},"".concat(t.project_id,"/").concat(t.name)))]})]}),(0,s.jsx)("div",{className:"split-detail",children:o?(0,s.jsx)(h,{}):(0,s.jsx)(u,{})})]})]})}function d(e){let{agent:t,selected:n,onSelect:r}=e;return(0,s.jsxs)("button",{className:"run-row".concat(n?" selected":""),onClick:r,children:[(0,s.jsxs)("div",{className:"run-row-top",children:[(0,s.jsx)("span",{className:"run-project",children:t.project_id}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:(0,i.Sy)(t.created_at)})]}),(0,s.jsxs)("div",{className:"truncate muted",style:{fontSize:"var(--text-sm)"},children:[t.name,t.role?" \xb7 ".concat(t.role):""]}),(0,s.jsx)("div",{className:"hstack",style:{gap:8},children:(0,s.jsx)(a.OE,{status:t.status})})]})}function u(){return(0,s.jsx)("div",{style:{padding:"60px 32px",color:"var(--text-muted)"},children:"Select a run to see its checkmark, log, and any open question."})}function h(){var e;let t=(0,l.Q)(),n=t.selectedRun,c=t.agents.find(e=>e.project_id===n.projectId&&e.name===n.name),o=t.checkmark,[d,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(!1),f=(null==c?void 0:c.status)==="paused_for_input",m=async e=>{if(!d.trim())return;p(!0);let n=await t.submitAnswer(d.trim(),e);p(!1),n&&u("")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{style:{padding:"24px 28px",borderBottom:"1px solid var(--border-default)",display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsxs)("div",{className:"hstack",children:[(0,s.jsx)("span",{style:{color:"var(--accent)",fontWeight:"var(--fw-bold)",fontSize:"var(--text-xl)"},children:n.projectId}),(0,s.jsx)("span",{className:"faint",children:"/"}),(0,s.jsx)("span",{style:{color:"var(--text-heading)",fontWeight:"var(--fw-semibold)",fontSize:"var(--text-lg)"},children:n.name}),(0,s.jsx)(a.OE,{status:null==c?void 0:c.status}),(null==c?void 0:c.role)&&(0,s.jsx)(a.Ct,{tone:"info",children:c.role}),(0,s.jsx)("span",{className:"spacer"}),(0,s.jsx)(a.zx,{size:"sm",variant:"secondary",onClick:()=>t.killAgent(n.projectId,n.name),children:"Kill"}),(0,s.jsx)(a.zx,{size:"sm",variant:"danger",onClick:()=>t.deleteAgent(n.projectId,n.name),children:"Delete row"})]}),(0,s.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)"},children:[null!==(e=null==c?void 0:c.working_dir)&&void 0!==e?e:"—"," \xb7 created ",(0,i.Eh)(null==c?void 0:c.created_at)]})]}),(0,s.jsxs)("div",{style:{padding:"20px 28px",display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"eyebrow",style:{marginBottom:10},children:"Checkmark"}),t.checkmarkMissing&&(0,s.jsx)(a.UW,{tone:"info",children:"No checkpoint recorded yet."}),o&&!t.checkmarkMissing&&(0,s.jsxs)("dl",{className:"kv",children:[(0,s.jsx)("dt",{children:"Status"}),(0,s.jsx)("dd",{children:(0,s.jsx)(a.OE,{status:o.status})}),(0,s.jsx)("dt",{children:"Where it stopped"}),(0,s.jsx)("dd",{children:o.where_it_stopped||"—"}),(0,s.jsx)("dt",{children:"Open question"}),(0,s.jsx)("dd",{children:o.open_question||"—"}),(0,s.jsx)("dt",{children:"Next steps"}),(0,s.jsx)("dd",{children:o.next_steps&&o.next_steps.length>0?(0,s.jsx)("ul",{children:o.next_steps.map((e,t)=>(0,s.jsx)("li",{children:e},t))}):"—"}),(0,s.jsx)("dt",{children:"Tests"}),(0,s.jsxs)("dd",{className:"hstack",children:[(0,s.jsx)(a.Ct,{tone:(0,i.FH)(o.tests_status),children:o.tests_status}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:o.tested_at?(0,i.Eh)(o.tested_at):""})]}),(0,s.jsx)("dt",{children:"Build"}),(0,s.jsxs)("dd",{className:"hstack",children:[(0,s.jsx)(a.Ct,{tone:(0,i.FH)(o.build_status),children:o.build_status}),(0,s.jsx)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:o.built_at?(0,i.Eh)(o.built_at):""})]}),(0,s.jsx)("dt",{children:"Checkpoint at"}),(0,s.jsx)("dd",{className:"faint",children:(0,i.Eh)(o.checkpoint_at)})]})]}),f&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsx)("div",{className:"eyebrow",children:"Answer this question"}),(0,s.jsx)(a.UW,{tone:"danger",children:(null==o?void 0:o.open_question)||"(no question text on the checkmark)"}),(0,s.jsx)(a.gx,{value:d,onChange:u,rows:3,placeholder:"Your answer…"}),(0,s.jsxs)("div",{className:"hstack",children:[(0,s.jsx)(a.zx,{variant:"secondary",disabled:h||!d.trim(),onClick:()=>m(!1),children:"Answer"}),(0,s.jsx)(a.zx,{variant:"primary",disabled:h||!d.trim(),onClick:()=>m(!0),children:"Answer & Resume"})]})]}),(null==c?void 0:c.session_id)&&(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsxs)("div",{className:"eyebrow",children:["Run events",c.worker_id?(0,s.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)",marginLeft:8},children:["on ",c.worker_id]}):null]}),0===t.events.length?(0,s.jsx)("div",{className:"empty",children:"No events yet."}):(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6,maxHeight:420,overflow:"auto",padding:"10px 12px",background:"var(--surface-2, rgba(0,0,0,0.25))",borderRadius:6},children:t.events.map(e=>(0,s.jsx)(x,{e:e},e.id))})]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,s.jsx)("div",{className:"eyebrow",children:"Log \xb7 newest first"}),0===t.log.length?(0,s.jsx)("div",{className:"empty",children:"No log entries."}):(0,s.jsx)("div",{className:"table-wrap",children:(0,s.jsxs)("table",{className:"tbl",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"When"}),(0,s.jsx)("th",{children:"Status"}),(0,s.jsx)("th",{children:"Summary"}),(0,s.jsx)("th",{children:"Q / A"}),(0,s.jsx)("th",{children:"Push"}),(0,s.jsx)("th",{children:"CI"})]})}),(0,s.jsx)("tbody",{children:t.log.map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,s.jsx)("td",{children:(0,s.jsx)(a.OE,{status:e.status})}),(0,s.jsx)("td",{children:e.summary||"—"}),(0,s.jsxs)("td",{children:[e.question&&(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Q:"})," ",e.question]}),e.answer&&(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"A:"})," ",e.answer]}),!e.question&&!e.answer&&"—"]}),(0,s.jsx)("td",{className:"mono",children:(0,i.Q6)(e.push_sha)}),(0,s.jsx)("td",{children:(0,s.jsx)(a.Ct,{tone:(0,i.FH)(e.ci_status),children:e.ci_status})})]},e.id))})]})}),(0,s.jsxs)("div",{className:"pager",children:[(0,s.jsx)(a.zx,{size:"sm",variant:"ghost",disabled:0===t.logOffset,onClick:()=>t.pageLog(-1),children:"‹ Newer"}),(0,s.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:["offset ",t.logOffset]}),(0,s.jsx)(a.zx,{size:"sm",variant:"ghost",disabled:t.log.length<100,onClick:()=>t.pageLog(1),children:"Older ›"})]})]})]})]})}function x(e){var t,n,r,l;let{e:i}=e,c=null!==(t=i.payload)&&void 0!==t?t:{},o={fontSize:"var(--text-xs)"};if("system"===i.type)return(0,s.jsxs)("div",{className:"faint mono",style:o,children:["▸ session ",null!==(n=c.subtype)&&void 0!==n?n:"event",c.session_id?" \xb7 ".concat(String(c.session_id).slice(0,8)):"",Array.isArray(c.tools)?" \xb7 ".concat(c.tools.length," tools"):""]});if("assistant"===i.type){let e=null===(r=c.message)||void 0===r?void 0:r.content,t=Array.isArray(e)?e:[],n=t.filter(e=>(null==e?void 0:e.type)==="text"&&e.text).map(e=>e.text).join("\n"),l=t.filter(e=>(null==e?void 0:e.type)==="tool_use");return(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[n&&(0,s.jsx)("div",{style:{fontSize:"var(--text-sm)",whiteSpace:"pre-wrap"},children:n}),l.length>0&&(0,s.jsx)("div",{className:"hstack",style:{gap:6,flexWrap:"wrap"},children:l.map((e,t)=>(0,s.jsxs)(a.Ct,{tone:"info",children:[e.name,e.input?": ".concat(function(e){let t="string"==typeof e?e:(null==e?void 0:e.command)?String(e.command):JSON.stringify(e);return t.length>80?"".concat(t.slice(0,77),"…"):t}(e.input)):""]},t))})]})}if("result"===i.type){let e=!!c.is_error;return(0,s.jsxs)("div",{className:"hstack",style:{gap:8,flexWrap:"wrap"},children:[(0,s.jsx)(a.Ct,{tone:e?"danger":"success",children:e?"run errored":"run finished"}),(0,s.jsxs)("span",{className:"faint mono",style:o,children:[null!=c.num_turns?"".concat(c.num_turns," turns"):"",null!=c.total_cost_usd?" \xb7 $".concat(Number(c.total_cost_usd).toFixed(4)):""]}),"string"==typeof c.result&&c.result&&(0,s.jsx)("span",{className:"muted",style:{...o,whiteSpace:"pre-wrap",width:"100%"},children:c.result})]})}return"worker"===i.type?(0,s.jsxs)(a.UW,{tone:"danger",children:[null!==(l=c.notice)&&void 0!==l?l:"runner notice",c.stderr_tail?(0,s.jsx)("pre",{className:"mono",style:{...o,margin:"6px 0 0",whiteSpace:"pre-wrap"},children:c.stderr_tail}):null]}):"raw"===i.type?(0,s.jsx)("div",{className:"faint mono",style:{...o,whiteSpace:"pre-wrap"},children:"string"==typeof c.line?c.line.trimEnd():JSON.stringify(c)}):(0,s.jsxs)("div",{className:"faint mono",style:o,children:["▸ ",i.type]})}function p(){return(0,s.jsx)(o,{})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return l},II:function(){return d},OE:function(){return a},Ph:function(){return h},UW:function(){return f},ZD:function(){return m},Zb:function(){return i},gx:function(){return u},kN:function(){return p},mQ:function(){return x},zx:function(){return c}});var s=n(7437),r=n(6039);function l(e){let{tone:t="neutral",pill:n=!1,dot:r=!1,children:l}=e;return(0,s.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[r&&(0,s.jsx)("span",{className:"dot"}),l]})}function a(e){let{status:t}=e;return(0,s.jsx)(l,{tone:(0,r.FH)(t),children:(0,r.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:r,className:l=""}=e;return(0,s.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(l).trim(),onClick:r,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function c(e){let{variant:t="secondary",size:n="md",onClick:r,disabled:l,type:a="button",children:i}=e;return(0,s.jsx)("button",{type:a,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:r,disabled:l,children:i})}function o(e){let{label:t,children:n}=e;return(0,s.jsxs)("label",{className:"field",children:[t&&(0,s.jsx)("span",{className:"field-label",children:t}),n]})}function d(e){let{label:t,value:n,onChange:r,placeholder:l,type:a="text",disabled:i}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("input",{className:"input",type:a,value:n,placeholder:l,disabled:i,onChange:e=>r(e.target.value)})})}function u(e){let{label:t,value:n,onChange:r,placeholder:l,rows:a=3}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("textarea",{className:"textarea",value:n,rows:a,placeholder:l,onChange:e=>r(e.target.value)})})}function h(e){let{label:t,value:n,onChange:r,options:l}=e;return(0,s.jsx)(o,{label:t,children:(0,s.jsx)("select",{className:"select",value:n,onChange:e=>r(e.target.value),children:l.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))})})}function x(e){let{tabs:t,value:n,onChange:r}=e;return(0,s.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,s.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>r(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:r,accent:l=!1}=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"stat-value".concat(l?" accent":""),children:t}),(0,s.jsx)("div",{className:"stat-label",children:n}),r&&(0,s.jsx)("div",{className:"stat-sub",children:r})]})}function f(e){let{tone:t="info",children:n}=e;return(0,s.jsx)("div",{className:"callout callout-".concat(t),children:n})}function m(e){let{on:t,onClick:n}=e;return(0,s.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,s.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function s(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return l},Eh:function(){return a},FH:function(){return s},Q6:function(){return i},Sy:function(){return c}});let r={paused_for_input:"Needs input",not_applicable:"N/A"};function l(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return r[n]?r[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function a(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let s=Math.floor(n/60);if(s<60)return"".concat(s,"m");let r=Math.floor(s/60);if(r<24)return"".concat(r,"h");let l=Math.floor(r/24);if(l<30)return"".concat(l,"d");let a=Math.floor(l/30);return a<12?"".concat(a,"mo"):"".concat(Math.floor(a/12),"y")}},257:function(e,t,n){"use strict";var s,r;e.exports=(null==(s=n.g.process)?void 0:s.env)&&"object"==typeof(null==(r=n.g.process)?void 0:r.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,s,r=e.exports={};function l(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:l}catch(e){t=l}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c=[],o=!1,d=-1;function u(){o&&s&&(o=!1,s.length?c=s.concat(c):d=-1,c.length&&h())}function h(){if(!o){var e=i(u);o=!0;for(var t=c.length;t;){for(s=c,c=[];++d1)for(var n=1;n{var t;let n=new Map;for(let r of e.agents)n.set(r.project_id,(null!==(t=n.get(r.project_id))&&void 0!==t?t:0)+1);return n},[e.agents]),h=(0,a.useMemo)(()=>[{value:"",label:e.hosts.length?"Pick a git server…":"No git servers configured"},...e.hosts.map(e=>({value:e.hostname,label:"".concat(e.hostname," (").concat(e.forge_type,")")}))],[e.hosts]),m=()=>{n(l),u(!1)},f=async()=>{(c?await e.updateProject(t.id,t):await e.createProject(t))&&m()},p=e=>{var t,r;n({...l,mode:"manual",id:e.id,root_dir:e.root_dir,git_remote:null!==(t=e.git_remote)&&void 0!==t?t:"",credential_ref:null!==(r=e.credential_ref)&&void 0!==r?r:""}),u(!0)},v=c?!!t.root_dir.trim():"server"===t.mode?!!t.git_server&&/^[\w.-]+\/[\w.-]+$/.test(t.repo.trim()):!!t.id.trim()&&!!t.root_dir.trim();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Repositories"}),(0,r.jsx)("div",{className:"section-desc",children:"Repos Handler manages. Each carries its own agents, history, and credentials."})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)(i.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:c?"Edit repository \xb7 ".concat(t.id):"Add a repository"})}),!c&&(0,r.jsx)("div",{style:{marginBottom:14},children:(0,r.jsx)(i.mQ,{tabs:[{value:"server",label:"From a git server"},{value:"manual",label:"Manual (existing checkout)"}],value:t.mode,onChange:e=>n({...t,mode:e})})}),c||"server"!==t.mode?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(i.II,{label:"ID / slug",value:t.id,onChange:e=>n({...t,id:e}),placeholder:"leeworks-api",disabled:c}),(0,r.jsx)(i.II,{label:"Root dir",value:t.root_dir,onChange:e=>n({...t,root_dir:e}),placeholder:"/var/lib/handler/projects/leeworks"}),(0,r.jsx)(i.II,{label:"Git remote",value:t.git_remote,onChange:e=>n({...t,git_remote:e}),placeholder:"git@github.com:user/repo.git (optional)"}),(0,r.jsx)(i.II,{label:"Credential ref",value:t.credential_ref,onChange:e=>n({...t,credential_ref:e}),placeholder:"env:VAR / file:/path / db:host:github.com"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"Optional override — projects on a configured git server use its stored token automatically. credential_ref is a pointer, never the token (env: / file: / db:host:)."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(i.Ph,{label:"Git server",value:t.git_server,onChange:e=>n({...t,git_server:e}),options:h}),(0,r.jsx)(i.II,{label:"Repository (owner/name)",value:t.repo,onChange:e=>n({...t,repo:e}),placeholder:"me/coolproj"}),(0,r.jsx)(i.II,{label:"ID / slug (optional — defaults to the repo name)",value:t.id,onChange:e=>n({...t,id:e}),placeholder:"coolproj"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"The repo is always pulled: Handler derives the remote from the server (ssh when it has a deploy key, https via the stored token otherwise), clones it under PROJECTS_ROOT, and keeps it fresh before every run."})]}),!c&&(0,r.jsxs)("label",{className:"hstack",style:{gap:8,cursor:"pointer",marginTop:14},children:[(0,r.jsx)("input",{type:"checkbox",checked:t.init_mise,onChange:e=>n({...t,init_mise:e.target.checked})}),(0,r.jsxs)("span",{style:{fontSize:"var(--text-sm)"},children:["Initialize mise — after the clone, run an agent that writes a"," ",(0,r.jsx)("span",{className:"mono",children:".mise.toml"})," with a"," ",(0,r.jsx)("span",{className:"mono",children:"[tasks.test]"})," task for this repo’s stack, then commits and pushes it. Needed for repos that don’t define one yet."]})]}),!c&&t.init_mise&&"manual"===t.mode&&!t.git_remote.trim()&&(0,r.jsxs)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"6px 0 0"},children:["A git remote is required to push the new ",(0,r.jsx)("span",{className:"mono",children:".mise.toml"})," — add one above, or mise won’t be initialized."]}),(0,r.jsxs)("div",{className:"hstack mt14",children:[(0,r.jsx)(i.zx,{variant:"primary",disabled:e.cmd.busy||!v,onClick:f,children:c?"Save changes":"server"===t.mode?"Add & pull":"Register"}),c&&(0,r.jsx)(i.zx,{variant:"ghost",onClick:m,children:"Cancel"})]})]}),0===e.projects.length&&(0,r.jsx)("div",{className:"empty",children:"No repositories registered."}),e.projects.map(t=>{var n,a;return(0,r.jsxs)(i.Zb,{children:[(0,r.jsxs)("div",{className:"card-head",children:[(0,r.jsx)("span",{className:"card-title",children:t.id}),(0,r.jsxs)(i.Ct,{tone:"info",pill:!0,children:[null!==(n=d.get(t.id))&&void 0!==n?n:0," ",(null!==(a=d.get(t.id))&&void 0!==a?a:0)===1?"agent":"agents"]})]}),(0,r.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:4},children:[t.root_dir,t.git_remote?" \xb7 ".concat(t.git_remote):""]}),(0,r.jsxs)("div",{className:"hstack",style:{marginTop:12,justifyContent:"space-between"},children:[(0,r.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:["cred ",t.credential_ref||"server default"," \xb7 added ",(0,o.Eh)(t.created_at)]}),(0,r.jsxs)("div",{className:"hstack",children:[t.git_remote&&(0,r.jsx)(i.zx,{size:"sm",variant:"secondary",onClick:()=>e.syncProject(t.id),children:"Pull now"}),(0,r.jsx)(i.zx,{size:"sm",variant:"secondary",onClick:()=>p(t),children:"Edit"}),(0,r.jsx)(i.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteProject(t.id),children:"Remove"})]})]})]},t.id)})]})]})}function u(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(c,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return i},Ph:function(){return h},UW:function(){return p},ZD:function(){return v},Zb:function(){return o},gx:function(){return d},kN:function(){return f},mQ:function(){return m},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function i(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function o(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:i="button",children:o}=e;return(0,r.jsx)("button",{type:i,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:o})}function c(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:i="text",disabled:o}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("input",{className:"input",type:i,value:n,placeholder:s,disabled:o,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:i=3}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:i,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function m(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function f(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return i},FH:function(){return r},Q6:function(){return o},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function i(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function o(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let i=Math.floor(s/30);return i<12?"".concat(i,"mo"):"".concat(Math.floor(i/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var l=[],c=!1,u=-1;function d(){c&&r&&(c=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n{var t;let n=new Map;for(let r of e.agents)n.set(r.project_id,(null!==(t=n.get(r.project_id))&&void 0!==t?t:0)+1);return n},[e.agents]),h=(0,a.useMemo)(()=>[{value:"",label:e.hosts.length?"Pick a git server…":"No git servers configured"},...e.hosts.map(e=>({value:e.hostname,label:"".concat(e.hostname," (").concat(e.forge_type,")")}))],[e.hosts]),m=()=>{n(l),u(!1)},f=async()=>{(c?await e.updateProject(t.id,t):await e.createProject(t))&&m()},p=e=>{var t,r;n({...l,mode:"manual",id:e.id,root_dir:e.root_dir,git_remote:null!==(t=e.git_remote)&&void 0!==t?t:"",credential_ref:null!==(r=e.credential_ref)&&void 0!==r?r:""}),u(!0)},v=c?!!t.root_dir.trim():"server"===t.mode?!!t.git_server&&/^[\w.-]+\/[\w.-]+$/.test(t.repo.trim()):!!t.id.trim()&&!!t.root_dir.trim();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Repositories"}),(0,r.jsx)("div",{className:"section-desc",children:"Repos Handler manages. Each carries its own agents, history, and credentials."})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)(i.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:c?"Edit repository \xb7 ".concat(t.id):"Add a repository"})}),!c&&(0,r.jsx)("div",{style:{marginBottom:14},children:(0,r.jsx)(i.mQ,{tabs:[{value:"server",label:"From a git server"},{value:"manual",label:"Manual (existing checkout)"}],value:t.mode,onChange:e=>n({...t,mode:e})})}),c||"server"!==t.mode?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(i.II,{label:"ID / slug",value:t.id,onChange:e=>n({...t,id:e}),placeholder:"leeworks-api",disabled:c}),(0,r.jsx)(i.II,{label:"Root dir",value:t.root_dir,onChange:e=>n({...t,root_dir:e}),placeholder:"/var/lib/handler/projects/leeworks"}),(0,r.jsx)(i.II,{label:"Git remote",value:t.git_remote,onChange:e=>n({...t,git_remote:e}),placeholder:"git@github.com:user/repo.git (optional)"}),(0,r.jsx)(i.II,{label:"Credential ref",value:t.credential_ref,onChange:e=>n({...t,credential_ref:e}),placeholder:"env:VAR / file:/path / db:host:github.com"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"Optional override — projects on a configured git server use its stored token automatically. credential_ref is a pointer, never the token (env: / file: / db:host:)."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(i.Ph,{label:"Git server",value:t.git_server,onChange:e=>n({...t,git_server:e}),options:h}),(0,r.jsx)(i.II,{label:"Repository (owner/name)",value:t.repo,onChange:e=>n({...t,repo:e}),placeholder:"me/coolproj"}),(0,r.jsx)(i.II,{label:"ID / slug (optional — defaults to the repo name)",value:t.id,onChange:e=>n({...t,id:e}),placeholder:"coolproj"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"The repo is always pulled: Handler derives the remote from the server (ssh when it has a deploy key, https via the stored token otherwise), clones it under PROJECTS_ROOT, and keeps it fresh before every run."})]}),!c&&(0,r.jsxs)("label",{className:"hstack",style:{gap:8,cursor:"pointer",marginTop:14},children:[(0,r.jsx)("input",{type:"checkbox",checked:t.init_mise,onChange:e=>n({...t,init_mise:e.target.checked})}),(0,r.jsxs)("span",{style:{fontSize:"var(--text-sm)"},children:["Initialize mise — after the clone, run an agent that writes a"," ",(0,r.jsx)("span",{className:"mono",children:".mise.toml"})," with a"," ",(0,r.jsx)("span",{className:"mono",children:"[tasks.test]"})," task for this repo’s stack, then commits and pushes it. Needed for repos that don’t define one yet."]})]}),!c&&t.init_mise&&"manual"===t.mode&&!t.git_remote.trim()&&(0,r.jsxs)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"6px 0 0"},children:["A git remote is required to push the new ",(0,r.jsx)("span",{className:"mono",children:".mise.toml"})," — add one above, or mise won’t be initialized."]}),(0,r.jsxs)("div",{className:"hstack mt14",children:[(0,r.jsx)(i.zx,{variant:"primary",disabled:e.cmd.busy||!v,onClick:f,children:c?"Save changes":"server"===t.mode?"Add & pull":"Register"}),c&&(0,r.jsx)(i.zx,{variant:"ghost",onClick:m,children:"Cancel"})]})]}),0===e.projects.length&&(0,r.jsx)("div",{className:"empty",children:"No repositories registered."}),e.projects.map(t=>{var n,a;return(0,r.jsxs)(i.Zb,{children:[(0,r.jsxs)("div",{className:"card-head",children:[(0,r.jsx)("span",{className:"card-title",children:t.id}),(0,r.jsxs)(i.Ct,{tone:"info",pill:!0,children:[null!==(n=d.get(t.id))&&void 0!==n?n:0," ",(null!==(a=d.get(t.id))&&void 0!==a?a:0)===1?"agent":"agents"]})]}),(0,r.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:4},children:[t.root_dir,t.git_remote?" \xb7 ".concat(t.git_remote):""]}),(0,r.jsxs)("div",{className:"hstack",style:{marginTop:12,justifyContent:"space-between"},children:[(0,r.jsxs)("span",{className:"faint mono",style:{fontSize:"var(--text-xs)"},children:["cred ",t.credential_ref||"server default"," \xb7 added ",(0,o.Eh)(t.created_at)]}),(0,r.jsxs)("div",{className:"hstack",children:[t.git_remote&&(0,r.jsx)(i.zx,{size:"sm",variant:"secondary",onClick:()=>e.syncProject(t.id),children:"Pull now"}),(0,r.jsx)(i.zx,{size:"sm",variant:"secondary",onClick:()=>p(t),children:"Edit"}),(0,r.jsx)(i.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteProject(t.id),children:"Remove"})]})]})]},t.id)})]})]})}function u(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(c,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return i},Ph:function(){return h},UW:function(){return p},ZD:function(){return v},Zb:function(){return o},gx:function(){return d},kN:function(){return f},mQ:function(){return m},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function i(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function o(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:i="button",children:o}=e;return(0,r.jsx)("button",{type:i,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:o})}function c(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:i="text",disabled:o}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("input",{className:"input",type:i,value:n,placeholder:s,disabled:o,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:i=3}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:i,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function m(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function f(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return i},FH:function(){return r},Q6:function(){return o},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function i(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function o(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let i=Math.floor(s/30);return i<12?"".concat(i,"mo"):"".concat(Math.floor(i/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var l=[],c=!1,u=-1;function d(){c&&r&&(c=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),h=async()=>{await e.createSchedule(e.selectedProjectId,{name_prefix:t.name_prefix,task:t.task,interval_seconds:Number(t.interval),role:t.role})&&n(u)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Schedules"}),(0,r.jsx)("div",{className:"section-desc",children:"Spawn a fresh agent on an interval. Each run is stateless — keep continuity in a file the prompt reads and overwrites."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(l.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:d})})}),(0,r.jsxs)(l.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"New schedule"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(l.II,{label:"Name prefix",value:t.name_prefix,onChange:e=>n({...t,name_prefix:e}),placeholder:"nightly"}),(0,r.jsx)(l.Ph,{label:"Interval",value:t.interval,onChange:e=>n({...t,interval:e}),options:o}),(0,r.jsx)(l.Ph,{label:"Role",value:t.role,onChange:e=>n({...t,role:e}),options:c})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(l.gx,{label:"Prompt (the task every run starts with)",value:t.task,onChange:e=>n({...t,task:e}),rows:3,placeholder:"Read @notes.md and continue from where it left off. Before finishing, overwrite @notes.md with the current state so the next run can pick up from there."})}),(0,r.jsxs)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:["Runs are named ",(0,r.jsxs)("span",{className:"mono",children:[t.name_prefix.trim()||"prefix","-YYYYMMDD-HHMMSS"]}),". The repo is pulled before every run; the first run fires on the worker's next pass."]}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(l.zx,{variant:"primary",disabled:e.cmd.busy||!t.name_prefix.trim()||!t.task.trim(),onClick:h,children:"Create schedule"})})]}),0===e.schedules.length?(0,r.jsx)("div",{className:"empty",children:"No schedules yet."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"On"}),(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Repository"}),(0,r.jsx)("th",{children:"Interval"}),(0,r.jsx)("th",{children:"Prompt"}),(0,r.jsx)("th",{children:"Next run"}),(0,r.jsx)("th",{children:"Last run"}),(0,r.jsx)("th",{})]})}),(0,r.jsx)("tbody",{children:e.schedules.map(t=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)(l.ZD,{on:t.enabled,onClick:()=>e.updateSchedule(t.id,{enabled:!t.enabled})})}),(0,r.jsxs)("td",{className:"mono",children:[t.name_prefix,t.role?(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(l.Ct,{tone:"info",children:t.role})]}):null]}),(0,r.jsx)("td",{className:"mono faint",children:t.project_id}),(0,r.jsx)("td",{className:"nowrap",children:function(e){let t=o.find(t=>Number(t.value)===e);return t?t.label:e%3600==0?"every ".concat(e/3600,"h"):e%60==0?"every ".concat(e/60,"m"):"every ".concat(e,"s")}(t.interval_seconds)}),(0,r.jsx)("td",{className:"faint",style:{maxWidth:340},children:(0,r.jsx)("span",{className:"truncate",style:{display:"block"},title:t.task,children:t.task})}),(0,r.jsx)("td",{className:"faint nowrap",children:t.enabled?(0,i.Eh)(t.next_run_at):"paused"}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(t.last_run_at)}),(0,r.jsx)("td",{className:"nowrap",children:(0,r.jsx)(l.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteSchedule(t.id),children:"Delete"})})]},t.id))})]})})]})})]})}function h(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(d,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return l},Ph:function(){return h},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return f},zx:function(){return c}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function l(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function c(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:l="button",children:i}=e;return(0,r.jsx)("button",{type:l,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:l="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:l,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:l=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:l,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function m(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function x(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return l},FH:function(){return r},Q6:function(){return i},Sy:function(){return c}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function l(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let l=Math.floor(s/30);return l<12?"".concat(l,"mo"):"".concat(Math.floor(l/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:l}catch(e){n=l}}();var c=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?c=r.concat(c):u=-1,c.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=c.length;t;){for(r=c,c=[];++u1)for(var n=1;ne.projects.map(e=>({value:e.id,label:e.id})),[e.projects]),h=async()=>{await e.createSchedule(e.selectedProjectId,{name_prefix:t.name_prefix,task:t.task,interval_seconds:Number(t.interval),role:t.role})&&n(u)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Schedules"}),(0,r.jsx)("div",{className:"section-desc",children:"Spawn a fresh agent on an interval. Each run is stateless — keep continuity in a file the prompt reads and overwrites."})]}),(0,r.jsx)("div",{className:"section-body",children:0===e.projects.length?(0,r.jsx)("div",{className:"empty",children:"Register a repository first."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{style:{width:260},children:(0,r.jsx)(l.Ph,{label:"Repository",value:e.selectedProjectId,onChange:e.selectProject,options:d})})}),(0,r.jsxs)(l.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"New schedule"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(l.II,{label:"Name prefix",value:t.name_prefix,onChange:e=>n({...t,name_prefix:e}),placeholder:"nightly"}),(0,r.jsx)(l.Ph,{label:"Interval",value:t.interval,onChange:e=>n({...t,interval:e}),options:o}),(0,r.jsx)(l.Ph,{label:"Role",value:t.role,onChange:e=>n({...t,role:e}),options:c})]}),(0,r.jsx)("div",{className:"mt14",children:(0,r.jsx)(l.gx,{label:"Prompt (the task every run starts with)",value:t.task,onChange:e=>n({...t,task:e}),rows:3,placeholder:"Read @notes.md and continue from where it left off. Before finishing, overwrite @notes.md with the current state so the next run can pick up from there."})}),(0,r.jsxs)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:["Runs are named ",(0,r.jsxs)("span",{className:"mono",children:[t.name_prefix.trim()||"prefix","-YYYYMMDD-HHMMSS"]}),". The repo is pulled before every run; the first run fires on the worker's next pass."]}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(l.zx,{variant:"primary",disabled:e.cmd.busy||!t.name_prefix.trim()||!t.task.trim(),onClick:h,children:"Create schedule"})})]}),0===e.schedules.length?(0,r.jsx)("div",{className:"empty",children:"No schedules yet."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"On"}),(0,r.jsx)("th",{children:"Name"}),(0,r.jsx)("th",{children:"Repository"}),(0,r.jsx)("th",{children:"Interval"}),(0,r.jsx)("th",{children:"Prompt"}),(0,r.jsx)("th",{children:"Next run"}),(0,r.jsx)("th",{children:"Last run"}),(0,r.jsx)("th",{})]})}),(0,r.jsx)("tbody",{children:e.schedules.map(t=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsx)(l.ZD,{on:t.enabled,onClick:()=>e.updateSchedule(t.id,{enabled:!t.enabled})})}),(0,r.jsxs)("td",{className:"mono",children:[t.name_prefix,t.role?(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(l.Ct,{tone:"info",children:t.role})]}):null]}),(0,r.jsx)("td",{className:"mono faint",children:t.project_id}),(0,r.jsx)("td",{className:"nowrap",children:function(e){let t=o.find(t=>Number(t.value)===e);return t?t.label:e%3600==0?"every ".concat(e/3600,"h"):e%60==0?"every ".concat(e/60,"m"):"every ".concat(e,"s")}(t.interval_seconds)}),(0,r.jsx)("td",{className:"faint",style:{maxWidth:340},children:(0,r.jsx)("span",{className:"truncate",style:{display:"block"},title:t.task,children:t.task})}),(0,r.jsx)("td",{className:"faint nowrap",children:t.enabled?(0,i.Eh)(t.next_run_at):"paused"}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(t.last_run_at)}),(0,r.jsx)("td",{className:"nowrap",children:(0,r.jsx)(l.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteSchedule(t.id),children:"Delete"})})]},t.id))})]})})]})})]})}function h(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(d,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return l},Ph:function(){return h},UW:function(){return p},ZD:function(){return x},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return f},zx:function(){return c}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function l(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function c(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:l="button",children:i}=e;return(0,r.jsx)("button",{type:l,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:l="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:l,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:l=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:l,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function m(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function p(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function x(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return l},FH:function(){return r},Q6:function(){return i},Sy:function(){return c}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function l(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function c(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let l=Math.floor(s/30);return l<12?"".concat(l,"mo"):"".concat(Math.floor(l/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:l}catch(e){n=l}}();var c=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?c=r.concat(c):u=-1,c.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=c.length;t;){for(r=c,c=[];++u1)for(var n=1;n{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)}catch(e){}};return(0,r.jsxs)("div",{style:{marginTop:10},children:[(0,r.jsxs)("div",{className:"hstack",style:{justifyContent:"space-between"},children:[(0,r.jsx)("span",{className:"eyebrow",children:"SSH public key — add it to the forge (deploy key)"}),(0,r.jsx)(o.zx,{size:"sm",variant:"secondary",onClick:i,children:n?"Copied":"Copy"})]}),(0,r.jsx)("pre",{className:"mono",style:{fontSize:"var(--text-xs)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:"6px 0 0",padding:8,border:"1px solid var(--border-default)",borderRadius:6,userSelect:"all"},children:t})]})}function u(){let e=(0,s.Q)(),[t,n]=(0,a.useState)(l),[u,d]=(0,a.useState)(!1),h=()=>{n(l),d(!1)},f=async()=>{(u?await e.updateHost(t.hostname,t):await e.createHost(t))&&h()},p=e=>{var t,r;n({hostname:e.hostname,forge_type:e.forge_type,token_env_var:null!==(t=e.token_env_var)&&void 0!==t?t:"",base_url:null!==(r=e.base_url)&&void 0!==r?r:"",token:"",generate_ssh_key:!1}),d(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Git Servers"}),(0,r.jsxs)("div",{className:"section-desc",children:["Each server carries its own credentials: a forge token (encrypted at rest, used by agents' ",(0,r.jsx)("span",{className:"mono",children:"forge"})," + git) and an SSH deploy key — paste the public key into the forge. New repositories are added by picking a server and typing owner/name."]})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)(o.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:u?"Edit server \xb7 ".concat(t.hostname):"Add a git server"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(o.II,{label:"Hostname",value:t.hostname,onChange:e=>n({...t,hostname:e}),placeholder:"github.com",disabled:u}),(0,r.jsx)(o.Ph,{label:"Type",value:t.forge_type,onChange:e=>n({...t,forge_type:e}),options:i}),(0,r.jsx)(o.II,{label:u?"Forge token (blank = keep current)":"Forge token",type:"password",value:t.token,onChange:e=>n({...t,token:e}),placeholder:"stored encrypted; used by forge + git"}),(0,r.jsx)(o.II,{label:"Base URL (optional)",value:t.base_url,onChange:e=>n({...t,base_url:e}),placeholder:"https://git.corp.internal:8443"}),(0,r.jsx)(o.II,{label:"Token env var override (optional)",value:t.token_env_var,onChange:e=>n({...t,token_env_var:e}),placeholder:"GITEA_TOKEN"}),(0,r.jsxs)("label",{className:"field",children:[(0,r.jsx)("span",{className:"field-label",children:"SSH deploy key"}),(0,r.jsxs)("label",{className:"hstack",style:{gap:8,cursor:"pointer"},children:[(0,r.jsx)("input",{type:"checkbox",checked:t.generate_ssh_key,onChange:e=>n({...t,generate_ssh_key:e.target.checked})}),(0,r.jsx)("span",{style:{fontSize:"var(--text-sm)"},children:u?"Regenerate keypair (replaces the current key)":"Generate a keypair"})]})]})]}),(0,r.jsxs)("div",{className:"hstack mt14",children:[(0,r.jsx)(o.zx,{variant:"primary",disabled:e.cmd.busy||!t.hostname.trim(),onClick:f,children:u?"Save changes":"Add server"}),u&&(0,r.jsx)(o.zx,{variant:"ghost",onClick:h,children:"Cancel"})]})]}),0===e.hosts.length&&(0,r.jsx)("div",{className:"empty",children:"No git servers registered (built-in host map still applies)."}),e.hosts.map(t=>(0,r.jsxs)(o.Zb,{children:[(0,r.jsxs)("div",{className:"card-head",children:[(0,r.jsx)("span",{className:"mono",style:{fontWeight:"var(--fw-bold)",fontSize:"var(--text-lg)",color:"var(--text-heading)"},children:t.hostname}),(0,r.jsxs)("div",{className:"hstack",children:[(0,r.jsx)(o.Ct,{tone:"info",children:t.forge_type}),(0,r.jsx)(o.Ct,{tone:t.has_token?"success":"neutral",children:t.has_token?"token stored":"no token"}),(0,r.jsx)(o.Ct,{tone:t.ssh_public_key?"success":"neutral",children:t.ssh_public_key?"ssh key":"no ssh key"}),(0,r.jsx)(o.zx,{size:"sm",variant:"secondary",onClick:()=>p(t),children:"Edit"}),(0,r.jsx)(o.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteHost(t.hostname),children:"Remove"})]})]}),(0,r.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:8},children:["token env ",t.token_env_var||"—",t.base_url?" \xb7 ".concat(t.base_url):""]}),t.ssh_public_key&&(0,r.jsx)(c,{value:t.ssh_public_key})]},t.hostname))]})]})}function d(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(u,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return o},Ph:function(){return h},UW:function(){return m},ZD:function(){return v},Zb:function(){return i},gx:function(){return d},kN:function(){return p},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function o(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:o="button",children:i}=e;return(0,r.jsx)("button",{type:o,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function c(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:o="text",disabled:i}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("input",{className:"input",type:o,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:o=3}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:o,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function m(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return o},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function o(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let o=Math.floor(s/30);return o<12?"".concat(o,"mo"):"".concat(Math.floor(o/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var l=[],c=!1,u=-1;function d(){c&&r&&(c=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=i(d);c=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)}catch(e){}};return(0,r.jsxs)("div",{style:{marginTop:10},children:[(0,r.jsxs)("div",{className:"hstack",style:{justifyContent:"space-between"},children:[(0,r.jsx)("span",{className:"eyebrow",children:"SSH public key — add it to the forge (deploy key)"}),(0,r.jsx)(o.zx,{size:"sm",variant:"secondary",onClick:i,children:n?"Copied":"Copy"})]}),(0,r.jsx)("pre",{className:"mono",style:{fontSize:"var(--text-xs)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:"6px 0 0",padding:8,border:"1px solid var(--border-default)",borderRadius:6,userSelect:"all"},children:t})]})}function u(){let e=(0,s.Q)(),[t,n]=(0,a.useState)(l),[u,d]=(0,a.useState)(!1),h=()=>{n(l),d(!1)},f=async()=>{(u?await e.updateHost(t.hostname,t):await e.createHost(t))&&h()},p=e=>{var t,r;n({hostname:e.hostname,forge_type:e.forge_type,token_env_var:null!==(t=e.token_env_var)&&void 0!==t?t:"",base_url:null!==(r=e.base_url)&&void 0!==r?r:"",token:"",generate_ssh_key:!1}),d(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Git Servers"}),(0,r.jsxs)("div",{className:"section-desc",children:["Each server carries its own credentials: a forge token (encrypted at rest, used by agents' ",(0,r.jsx)("span",{className:"mono",children:"forge"})," + git) and an SSH deploy key — paste the public key into the forge. New repositories are added by picking a server and typing owner/name."]})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)(o.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:u?"Edit server \xb7 ".concat(t.hostname):"Add a git server"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(o.II,{label:"Hostname",value:t.hostname,onChange:e=>n({...t,hostname:e}),placeholder:"github.com",disabled:u}),(0,r.jsx)(o.Ph,{label:"Type",value:t.forge_type,onChange:e=>n({...t,forge_type:e}),options:i}),(0,r.jsx)(o.II,{label:u?"Forge token (blank = keep current)":"Forge token",type:"password",value:t.token,onChange:e=>n({...t,token:e}),placeholder:"stored encrypted; used by forge + git"}),(0,r.jsx)(o.II,{label:"Base URL (optional)",value:t.base_url,onChange:e=>n({...t,base_url:e}),placeholder:"https://git.corp.internal:8443"}),(0,r.jsx)(o.II,{label:"Token env var override (optional)",value:t.token_env_var,onChange:e=>n({...t,token_env_var:e}),placeholder:"GITEA_TOKEN"}),(0,r.jsxs)("label",{className:"field",children:[(0,r.jsx)("span",{className:"field-label",children:"SSH deploy key"}),(0,r.jsxs)("label",{className:"hstack",style:{gap:8,cursor:"pointer"},children:[(0,r.jsx)("input",{type:"checkbox",checked:t.generate_ssh_key,onChange:e=>n({...t,generate_ssh_key:e.target.checked})}),(0,r.jsx)("span",{style:{fontSize:"var(--text-sm)"},children:u?"Regenerate keypair (replaces the current key)":"Generate a keypair"})]})]})]}),(0,r.jsxs)("div",{className:"hstack mt14",children:[(0,r.jsx)(o.zx,{variant:"primary",disabled:e.cmd.busy||!t.hostname.trim(),onClick:f,children:u?"Save changes":"Add server"}),u&&(0,r.jsx)(o.zx,{variant:"ghost",onClick:h,children:"Cancel"})]})]}),0===e.hosts.length&&(0,r.jsx)("div",{className:"empty",children:"No git servers registered (built-in host map still applies)."}),e.hosts.map(t=>(0,r.jsxs)(o.Zb,{children:[(0,r.jsxs)("div",{className:"card-head",children:[(0,r.jsx)("span",{className:"mono",style:{fontWeight:"var(--fw-bold)",fontSize:"var(--text-lg)",color:"var(--text-heading)"},children:t.hostname}),(0,r.jsxs)("div",{className:"hstack",children:[(0,r.jsx)(o.Ct,{tone:"info",children:t.forge_type}),(0,r.jsx)(o.Ct,{tone:t.has_token?"success":"neutral",children:t.has_token?"token stored":"no token"}),(0,r.jsx)(o.Ct,{tone:t.ssh_public_key?"success":"neutral",children:t.ssh_public_key?"ssh key":"no ssh key"}),(0,r.jsx)(o.zx,{size:"sm",variant:"secondary",onClick:()=>p(t),children:"Edit"}),(0,r.jsx)(o.zx,{size:"sm",variant:"danger",onClick:()=>e.deleteHost(t.hostname),children:"Remove"})]})]}),(0,r.jsxs)("div",{className:"mono faint",style:{fontSize:"var(--text-xs)",marginTop:8},children:["token env ",t.token_env_var||"—",t.base_url?" \xb7 ".concat(t.base_url):""]}),t.ssh_public_key&&(0,r.jsx)(c,{value:t.ssh_public_key})]},t.hostname))]})]})}function d(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(u,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return o},Ph:function(){return h},UW:function(){return m},ZD:function(){return v},Zb:function(){return i},gx:function(){return d},kN:function(){return p},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function o(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:o="button",children:i}=e;return(0,r.jsx)("button",{type:o,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function c(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:o="text",disabled:i}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("input",{className:"input",type:o,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:o=3}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:o,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(c,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function p(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function m(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function v(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return o},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function o(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let o=Math.floor(s/30);return o<12?"".concat(o,"mo"):"".concat(Math.floor(o/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var l=[],c=!1,u=-1;function d(){c&&r&&(c=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=i(d);c=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n{t.trim()&&l.trim()&&await e.setSharedKey(t.trim(),l.trim())&&(n(""),o(""))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Shared"}),(0,r.jsx)("div",{className:"section-desc",children:"The cross-project global feed and shared facts."})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"eyebrow",style:{marginBottom:10},children:"Global feed"}),0===e.shared.log.length?(0,r.jsx)("div",{className:"empty",children:"No global log entries."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Agent"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Summary"}),(0,r.jsx)("th",{children:"CI"})]})}),(0,r.jsx)("tbody",{children:e.shared.log.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.agent_id}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.status})}),(0,r.jsx)("td",{children:e.summary||"—"}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.ci_status})})]},e.id))})]})})]}),(0,r.jsxs)(c.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Set a shared key"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(c.II,{label:"Key",value:t,onChange:n,placeholder:"key"}),(0,r.jsx)(c.II,{label:"Value",value:l,onChange:o,placeholder:"value"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"Requires the shared-context write token (or admin/global if unset)."}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(c.zx,{variant:"primary",disabled:!t.trim()||!l.trim(),onClick:u,children:"Set"})})]}),e.shared.context.length>0&&(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Key"}),(0,r.jsx)("th",{children:"Value"}),(0,r.jsx)("th",{children:"Updated"})]})}),(0,r.jsx)("tbody",{children:e.shared.context.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"mono",children:e.key}),(0,r.jsx)("td",{children:e.value}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.updated_at)})]},e.key))})]})})]})]})}function o(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(l,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return c},Ph:function(){return h},UW:function(){return x},ZD:function(){return p},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function c(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:c="button",children:i}=e;return(0,r.jsx)("button",{type:c,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:c="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:c,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:c=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:c,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function m(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function x(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function p(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return c},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function c(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let c=Math.floor(s/30);return c<12?"".concat(c,"mo"):"".concat(Math.floor(c/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var l=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n{t.trim()&&l.trim()&&await e.setSharedKey(t.trim(),l.trim())&&(n(""),o(""))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"section-head",children:[(0,r.jsx)("div",{className:"section-title",children:"Shared"}),(0,r.jsx)("div",{className:"section-desc",children:"The cross-project global feed and shared facts."})]}),(0,r.jsxs)("div",{className:"section-body",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"eyebrow",style:{marginBottom:10},children:"Global feed"}),0===e.shared.log.length?(0,r.jsx)("div",{className:"empty",children:"No global log entries."}):(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"When"}),(0,r.jsx)("th",{children:"Agent"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Summary"}),(0,r.jsx)("th",{children:"CI"})]})}),(0,r.jsx)("tbody",{children:e.shared.log.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.created_at)}),(0,r.jsx)("td",{className:"mono",children:e.agent_id}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.status})}),(0,r.jsx)("td",{children:e.summary||"—"}),(0,r.jsx)("td",{children:(0,r.jsx)(c.OE,{status:e.ci_status})})]},e.id))})]})})]}),(0,r.jsxs)(c.Zb,{children:[(0,r.jsx)("div",{className:"card-head",style:{marginBottom:14},children:(0,r.jsx)("span",{className:"card-title",style:{fontSize:"var(--text-md)",color:"var(--text-heading)"},children:"Set a shared key"})}),(0,r.jsxs)("div",{className:"form-grid",children:[(0,r.jsx)(c.II,{label:"Key",value:t,onChange:n,placeholder:"key"}),(0,r.jsx)(c.II,{label:"Value",value:l,onChange:o,placeholder:"value"})]}),(0,r.jsx)("p",{className:"faint",style:{fontSize:"var(--text-xs)",margin:"10px 0 0"},children:"Requires the shared-context write token (or admin/global if unset)."}),(0,r.jsx)("div",{className:"hstack mt14",children:(0,r.jsx)(c.zx,{variant:"primary",disabled:!t.trim()||!l.trim(),onClick:u,children:"Set"})})]}),e.shared.context.length>0&&(0,r.jsx)("div",{className:"table-wrap",children:(0,r.jsxs)("table",{className:"tbl",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Key"}),(0,r.jsx)("th",{children:"Value"}),(0,r.jsx)("th",{children:"Updated"})]})}),(0,r.jsx)("tbody",{children:e.shared.context.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"mono",children:e.key}),(0,r.jsx)("td",{children:e.value}),(0,r.jsx)("td",{className:"faint nowrap",children:(0,i.Eh)(e.updated_at)})]},e.key))})]})})]})]})}function o(){return(0,r.jsx)("div",{className:"main-scroll",children:(0,r.jsx)(l,{})})}},8280:function(e,t,n){"use strict";n.d(t,{Ct:function(){return s},II:function(){return u},OE:function(){return c},Ph:function(){return h},UW:function(){return x},ZD:function(){return p},Zb:function(){return i},gx:function(){return d},kN:function(){return m},mQ:function(){return f},zx:function(){return l}});var r=n(7437),a=n(6039);function s(e){let{tone:t="neutral",pill:n=!1,dot:a=!1,children:s}=e;return(0,r.jsxs)("span",{className:"badge badge-".concat(t).concat(n?" pill":""),children:[a&&(0,r.jsx)("span",{className:"dot"}),s]})}function c(e){let{status:t}=e;return(0,r.jsx)(s,{tone:(0,a.FH)(t),children:(0,a.Cf)(t)})}function i(e){let{children:t,interactive:n=!1,onClick:a,className:s=""}=e;return(0,r.jsx)("div",{className:"card".concat(n?" interactive":""," ").concat(s).trim(),onClick:a,role:n?"button":void 0,tabIndex:n?0:void 0,children:t})}function l(e){let{variant:t="secondary",size:n="md",onClick:a,disabled:s,type:c="button",children:i}=e;return(0,r.jsx)("button",{type:c,className:"btn btn-".concat(t).concat("sm"===n?" btn-sm":""),onClick:a,disabled:s,children:i})}function o(e){let{label:t,children:n}=e;return(0,r.jsxs)("label",{className:"field",children:[t&&(0,r.jsx)("span",{className:"field-label",children:t}),n]})}function u(e){let{label:t,value:n,onChange:a,placeholder:s,type:c="text",disabled:i}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("input",{className:"input",type:c,value:n,placeholder:s,disabled:i,onChange:e=>a(e.target.value)})})}function d(e){let{label:t,value:n,onChange:a,placeholder:s,rows:c=3}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("textarea",{className:"textarea",value:n,rows:c,placeholder:s,onChange:e=>a(e.target.value)})})}function h(e){let{label:t,value:n,onChange:a,options:s}=e;return(0,r.jsx)(o,{label:t,children:(0,r.jsx)("select",{className:"select",value:n,onChange:e=>a(e.target.value),children:s.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})})}function f(e){let{tabs:t,value:n,onChange:a}=e;return(0,r.jsx)("div",{className:"tabs",role:"tablist",children:t.map(e=>(0,r.jsx)("button",{role:"tab","aria-selected":n===e.value,className:"tab".concat(n===e.value?" active":""),onClick:()=>a(e.value),children:e.label},e.value))})}function m(e){let{value:t,label:n,sub:a,accent:s=!1}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"stat-value".concat(s?" accent":""),children:t}),(0,r.jsx)("div",{className:"stat-label",children:n}),a&&(0,r.jsx)("div",{className:"stat-sub",children:a})]})}function x(e){let{tone:t="info",children:n}=e;return(0,r.jsx)("div",{className:"callout callout-".concat(t),children:n})}function p(e){let{on:t,onClick:n}=e;return(0,r.jsx)("button",{type:"button",className:"toggle".concat(t?" on":""),"aria-pressed":t,onClick:n,children:(0,r.jsx)("span",{className:"knob"})})}},6039:function(e,t,n){"use strict";function r(e){switch((null!=e?e:"").toLowerCase()){case"pass":case"done":case"completed":case"approved":case"success":return"success";case"fail":case"failed":case"blocked":case"rejected":case"error":case"crashed":return"danger";case"pending":case"queued":case"running":case"working":case"paused_for_input":return"warning";case"not_applicable":case"unknown":case"":return"neutral";default:return"info"}}n.d(t,{Cf:function(){return s},Eh:function(){return c},FH:function(){return r},Q6:function(){return i},Sy:function(){return l}});let a={paused_for_input:"Needs input",not_applicable:"N/A"};function s(e){let t=(null!=e?e:"").trim();if(!t)return"—";let n=t.toLowerCase();return a[n]?a[n]:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function c(e){if(!e)return"—";let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function i(e){return e?e.slice(0,7):"—"}function l(e){if(!e)return"—";let t=new Date(e).getTime();if(Number.isNaN(t))return"—";let n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return"".concat(n,"s");let r=Math.floor(n/60);if(r<60)return"".concat(r,"m");let a=Math.floor(r/60);if(a<24)return"".concat(a,"h");let s=Math.floor(a/24);if(s<30)return"".concat(s,"d");let c=Math.floor(s/30);return c<12?"".concat(c,"mo"):"".concat(Math.floor(c/12),"y")}},257:function(e,t,n){"use strict";var r,a;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(a=n.g.process)?void 0:a.env)?n.g.process:n(4227)},4227:function(e){!function(){var t={229:function(e){var t,n,r,a=e.exports={};function s(){throw Error("setTimeout has not been defined")}function c(){throw Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var l=[],o=!1,u=-1;function d(){o&&r&&(o=!1,r.length?l=r.concat(l):u=-1,l.length&&h())}function h(){if(!o){var e=i(d);o=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;nHandler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/activity/index.txt b/src/handler/api/static/activity/index.txt index 91fb680..940a0fb 100644 --- a/src/handler/api/static/activity/index.txt +++ b/src/handler/api/static/activity/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[7839,["171","static/chunks/171-699dc657f6a6678f.js","263","static/chunks/app/activity/page-809b415dd18cb14e.js"],"default",1] +3:I[7839,["171","static/chunks/171-ba6c418b542791c8.js","263","static/chunks/app/activity/page-7be158338498be57.js"],"default",1] 4:I[4707,[],""] 5:I[6423,[],""] -6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["activity",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["activity",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","activity","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["activity",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["activity",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","activity","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/api/static/agents/index.html b/src/handler/api/static/agents/index.html index eb0e06e..0fd37f0 100644 --- a/src/handler/api/static/agents/index.html +++ b/src/handler/api/static/agents/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/agents/index.txt b/src/handler/api/static/agents/index.txt index 00841fc..a6dff28 100644 --- a/src/handler/api/static/agents/index.txt +++ b/src/handler/api/static/agents/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[2506,["171","static/chunks/171-699dc657f6a6678f.js","718","static/chunks/app/agents/page-ed5717b0ac0347b8.js"],"default",1] +3:I[2506,["171","static/chunks/171-ba6c418b542791c8.js","718","static/chunks/app/agents/page-4ae3a1f91119de97.js"],"default",1] 4:I[4707,[],""] 5:I[6423,[],""] -6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["agents",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["agents",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","agents","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["agents",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["agents",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","agents","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/api/static/approvals/index.html b/src/handler/api/static/approvals/index.html index 027e975..1bc9be4 100644 --- a/src/handler/api/static/approvals/index.html +++ b/src/handler/api/static/approvals/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/approvals/index.txt b/src/handler/api/static/approvals/index.txt index a566c5e..15853e1 100644 --- a/src/handler/api/static/approvals/index.txt +++ b/src/handler/api/static/approvals/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[2651,["171","static/chunks/171-699dc657f6a6678f.js","163","static/chunks/app/approvals/page-8d5622be330f4d01.js"],"default",1] +3:I[2651,["171","static/chunks/171-ba6c418b542791c8.js","163","static/chunks/app/approvals/page-423d906e199db97b.js"],"default",1] 4:I[4707,[],""] 5:I[6423,[],""] -6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["approvals",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["approvals",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","approvals","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["approvals",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["approvals",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","approvals","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/api/static/index.html b/src/handler/api/static/index.html index c9a036a..5e4bae1 100644 --- a/src/handler/api/static/index.html +++ b/src/handler/api/static/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/index.txt b/src/handler/api/static/index.txt index ec5a446..0b682c2 100644 --- a/src/handler/api/static/index.txt +++ b/src/handler/api/static/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[3807,["171","static/chunks/171-699dc657f6a6678f.js","931","static/chunks/app/page-cf68f34e95b90a40.js"],"default",1] -4:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] +3:I[3807,["171","static/chunks/171-ba6c418b542791c8.js","931","static/chunks/app/page-52e9c359249c3b73.js"],"default",1] +4:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] 5:I[4707,[],""] 6:I[6423,[],""] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/api/static/login/index.html b/src/handler/api/static/login/index.html index 07c04fb..d35e006 100644 --- a/src/handler/api/static/login/index.html +++ b/src/handler/api/static/login/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/login/index.txt b/src/handler/api/static/login/index.txt index 4e34b37..4df45de 100644 --- a/src/handler/api/static/login/index.txt +++ b/src/handler/api/static/login/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[9347,["171","static/chunks/171-699dc657f6a6678f.js","626","static/chunks/app/login/page-49e21c8c7c3a9dd8.js"],"default",1] +3:I[9347,["171","static/chunks/171-ba6c418b542791c8.js","626","static/chunks/app/login/page-2f7fdd148631e2b5.js"],"default",1] 4:I[4707,[],""] 5:I[6423,[],""] -6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["login",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["login",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","login","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["login",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["login",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","login","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/api/static/repositories/index.html b/src/handler/api/static/repositories/index.html index 2b42b5b..a8299f1 100644 --- a/src/handler/api/static/repositories/index.html +++ b/src/handler/api/static/repositories/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/repositories/index.txt b/src/handler/api/static/repositories/index.txt index 035b86f..310def5 100644 --- a/src/handler/api/static/repositories/index.txt +++ b/src/handler/api/static/repositories/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[3641,["171","static/chunks/171-699dc657f6a6678f.js","27","static/chunks/app/repositories/page-fb0c29b8dc7ed817.js"],"default",1] +3:I[3641,["171","static/chunks/171-ba6c418b542791c8.js","27","static/chunks/app/repositories/page-5820d64699ff6a87.js"],"default",1] 4:I[4707,[],""] 5:I[6423,[],""] -6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["repositories",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["repositories",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","repositories","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["repositories",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["repositories",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","repositories","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/api/static/schedules/index.html b/src/handler/api/static/schedules/index.html index 073628a..b60c048 100644 --- a/src/handler/api/static/schedules/index.html +++ b/src/handler/api/static/schedules/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/schedules/index.txt b/src/handler/api/static/schedules/index.txt index fb5b3cd..58a85a0 100644 --- a/src/handler/api/static/schedules/index.txt +++ b/src/handler/api/static/schedules/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[5124,["171","static/chunks/171-699dc657f6a6678f.js","95","static/chunks/app/schedules/page-db675df274be2677.js"],"default",1] +3:I[5124,["171","static/chunks/171-ba6c418b542791c8.js","95","static/chunks/app/schedules/page-93cc8b9829ad18f2.js"],"default",1] 4:I[4707,[],""] 5:I[6423,[],""] -6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["schedules",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["schedules",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","schedules","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["schedules",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["schedules",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","schedules","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/api/static/servers/index.html b/src/handler/api/static/servers/index.html index 67cbd59..b2b2439 100644 --- a/src/handler/api/static/servers/index.html +++ b/src/handler/api/static/servers/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/servers/index.txt b/src/handler/api/static/servers/index.txt index 72d9782..cc92cf4 100644 --- a/src/handler/api/static/servers/index.txt +++ b/src/handler/api/static/servers/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[4646,["171","static/chunks/171-699dc657f6a6678f.js","664","static/chunks/app/servers/page-7cfc66d88412e3d1.js"],"default",1] +3:I[4646,["171","static/chunks/171-ba6c418b542791c8.js","664","static/chunks/app/servers/page-874e20e9ad86bc3f.js"],"default",1] 4:I[4707,[],""] 5:I[6423,[],""] -6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["servers",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["servers",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","servers","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["servers",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["servers",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","servers","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/api/static/shared/index.html b/src/handler/api/static/shared/index.html index c00249c..b91d9fd 100644 --- a/src/handler/api/static/shared/index.html +++ b/src/handler/api/static/shared/index.html @@ -1 +1 @@ -Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file +Handler · Claude Activity
Claude Monitor

Paste your API token to continue. Management actions require the admin token; read-only views work with the plain auth token.

\ No newline at end of file diff --git a/src/handler/api/static/shared/index.txt b/src/handler/api/static/shared/index.txt index a5c1ebd..d9523c5 100644 --- a/src/handler/api/static/shared/index.txt +++ b/src/handler/api/static/shared/index.txt @@ -1,8 +1,8 @@ 2:I[9107,[],"ClientPageRoot"] -3:I[9475,["171","static/chunks/171-699dc657f6a6678f.js","856","static/chunks/app/shared/page-dc7068fcf86ab8e4.js"],"default",1] +3:I[9475,["171","static/chunks/171-ba6c418b542791c8.js","856","static/chunks/app/shared/page-e449c1a6ddda32bf.js"],"default",1] 4:I[4707,[],""] 5:I[6423,[],""] -6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-699dc657f6a6678f.js","185","static/chunks/app/layout-6809e5ee9cec21d4.js"],"AppFrame"] -0:["QCIYKmybhnvk7okhoCnyi",[[["",{"children":["shared",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["shared",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","shared","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] +6:I[5520,["258","static/chunks/258-01db7d62283ec2f5.js","171","static/chunks/171-ba6c418b542791c8.js","185","static/chunks/app/layout-cdc070e22a7fa32c.js"],"AppFrame"] +0:["ecJZL3f8VZAeTLKfyHRWs",[[["",{"children":["shared",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["shared",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","shared","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/bbd6ee1e7265be74.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]}]],null],null],["$L7",null]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Handler · Claude Activity"}],["$","meta","3",{"name":"description","content":"Monitor and manage Claude Code agents across projects."}],["$","link","4",{"rel":"icon","href":"/icon.svg?bab509b45a421e43","type":"image/svg+xml","sizes":"any"}]] 1:null diff --git a/src/handler/config.py b/src/handler/config.py index 1684dc4..0c15039 100644 --- a/src/handler/config.py +++ b/src/handler/config.py @@ -58,8 +58,10 @@ class Settings(BaseSettings): # start a run are left queued (for another worker) while all slots are busy. max_concurrent_runs: int = 4 # Heartbeats older than this many seconds mark a worker dead; the reaper flips its - # running runs (and their agents) to ``crashed``. - worker_stale_after: float = 60.0 + # running runs (and their agents) to ``crashed``. Generous by design: one slow + # synchronous command (a large clone, the interactive login flow) can hold a worker + # between heartbeats for a minute or more, and a false reap is worse than a slow one. + worker_stale_after: float = 300.0 # Per-run spend cap passed as ``--max-budget-usd``. 0 disables the flag. run_budget_usd: float = 0.0 # Refuse to upload a claude session archive larger than this (a runaway sidecar dir diff --git a/src/handler/control/credsync.py b/src/handler/control/credsync.py index f76363f..166ea0d 100644 --- a/src/handler/control/credsync.py +++ b/src/handler/control/credsync.py @@ -106,10 +106,16 @@ def _merge_claude_json(path: str, incoming: str) -> None: for key in _ACCOUNT_KEYS: if key in new_data: merged[key] = new_data[key] + _write_private(path, json.dumps(merged, indent=2)) + + +def _write_private(path: str, content: str) -> None: + """Atomic write with 0600 from the first byte — these files carry OAuth tokens.""" os.makedirs(os.path.dirname(path) or ".", exist_ok=True) tmp = f"{path}.credsync.tmp" - with open(tmp, "w") as fh: - json.dump(merged, fh, indent=2) + fd = os.open(tmp, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600) + with os.fdopen(fd, "w") as fh: + fh.write(content) os.replace(tmp, path) @@ -151,11 +157,7 @@ def refresh() -> str | None: if rel == ".claude.json": _merge_claude_json(path, content) else: - os.makedirs(os.path.dirname(path) or ".", exist_ok=True) - tmp = f"{path}.credsync.tmp" - with open(tmp, "w") as fh: - fh.write(content) - os.replace(tmp, path) + _write_private(path, content) _state.seen_updated_at = row["updated_at"] _state.last_fingerprint = fingerprint() return "materialized" diff --git a/src/handler/control/headless.py b/src/handler/control/headless.py index 3582810..a50ba64 100644 --- a/src/handler/control/headless.py +++ b/src/handler/control/headless.py @@ -198,6 +198,7 @@ class RunSupervisor: self.archive_interval = archive_interval self.on_exit = on_exit # worker's slot-release callback self._seq = 0 + self._seq_lock = threading.Lock() # reader thread + supervisor both emit events self._result_payload: dict | None = None self._canceled = False self.thread: threading.Thread | None = None @@ -211,13 +212,15 @@ class RunSupervisor: # ---------------------------------------------------------------- internals def _insert_event(self, etype: str, payload: dict) -> None: - self._seq += 1 + with self._seq_lock: + self._seq += 1 + seq = self._seq with connection() as conn: repo.insert_agent_event( conn, self.agent["id"], self.run["id"], - seq=self._seq, + seq=seq, type=etype, payload=payload, session_id=self.run["session_id"], @@ -299,13 +302,22 @@ class RunSupervisor: last_archive = now proc.wait() reader.join(timeout=30.0) + if proc.stdout is not None: + proc.stdout.close() stderr_file.seek(0) stderr_tail = stderr_file.read()[-4000:].decode("utf-8", "replace") stderr_file.close() self._settle(exit_code=proc.returncode, stderr_tail=stderr_tail) def _settle(self, exit_code: int | None, stderr_tail: str) -> None: - """Reconcile run + agent status once the process is gone, then final-archive.""" + """Final-archive, then reconcile run + agent status once the process is gone. + + Order matters: a resume can be claimed the moment the run leaves ``running``, and + it materializes from ``session_archives`` — so the archive upload must land + BEFORE the run is marked finished, or a fast resume races an incomplete archive + and needlessly degrades to context re-injection. + """ + self._upload_archive() result = self._result_payload clean = ( exit_code == 0 @@ -341,7 +353,6 @@ class RunSupervisor: self._insert_event("worker", detail) except Exception: # noqa: BLE001 - never let bookkeeping raise out of the thread pass - self._upload_archive() if self.on_exit is not None: try: self.on_exit(self) diff --git a/src/handler/control/spawn.py b/src/handler/control/spawn.py index 561c11c..7e53ee0 100644 --- a/src/handler/control/spawn.py +++ b/src/handler/control/spawn.py @@ -268,14 +268,20 @@ def resume(agent: dict, answer: str, worker_id: str | None = None) -> tuple[bool elif not transcript.exists(): return _resume_reinjected(agent, answer, settings_path, env, worker_id) - run = headless.launch( - agent, - kind="resume", - prompt=answer, - settings_path=settings_path, - env=env, - worker_id=worker_id, - ) + try: + run = headless.launch( + agent, + kind="resume", + prompt=answer, + settings_path=settings_path, + env=env, + worker_id=worker_id, + ) + except repo.RunConflictError: + # Another worker won the race for this resume (two queued resume commands, or a + # concurrent spawn) — losing loudly here beats two claude processes corrupting + # one session transcript. + return False, "another worker is already running this agent's session" return True, f"headless resume run {run['id']} started for session {agent['session_id']}" @@ -302,14 +308,17 @@ def _resume_reinjected( if entry.get("summary"): parts.append(f"Earlier log: {entry['summary']}") parts.append(f"The operator's answer/instruction: {answer}") - run = headless.launch( - agent, - kind="spawn", # a genuinely new session (new UUID) — --resume has nothing to load - prompt="\n\n".join(parts), - settings_path=settings_path, - env=env, - worker_id=worker_id, - ) + try: + run = headless.launch( + agent, + kind="spawn", # a genuinely new session (new UUID) — --resume has nothing to load + prompt="\n\n".join(parts), + settings_path=settings_path, + env=env, + worker_id=worker_id, + ) + except repo.RunConflictError: + return False, "another worker is already running this agent's session" with connection() as conn: repo.insert_agent_event( conn, diff --git a/src/handler/control/worker.py b/src/handler/control/worker.py index 7368b99..2a4591f 100644 --- a/src/handler/control/worker.py +++ b/src/handler/control/worker.py @@ -413,6 +413,12 @@ def drain(worker_id: str, limit: int | None = None) -> int: break _run_one(command) processed += 1 + # Heartbeat between commands: a long queue must not starve the proof-of-life + # (a peer's reaper would otherwise mark this worker's live runs crashed). + try: + heartbeat(worker_id) + except Exception: # noqa: BLE001 - bookkeeping must not stop the drain + pass return processed diff --git a/src/handler/db/repository.py b/src/handler/db/repository.py index 0f8e0aa..349a094 100644 --- a/src/handler/db/repository.py +++ b/src/handler/db/repository.py @@ -733,10 +733,35 @@ def delete_worker(conn: Connection, worker_id: str) -> bool: return result.rowcount > 0 +class RunConflictError(Exception): + """The agent already has a ``running`` run — a second concurrent claude process on + one session would corrupt its transcript.""" + + def create_run( conn: Connection, agent_id: int, session_id: str, worker_id: str, kind: str ) -> dict: - """Open an ``agent_runs`` row for a launching headless invocation.""" + """Open an ``agent_runs`` row for a launching headless invocation. + + Enforces **one running run per agent** atomically: two workers that both claimed a + resume for the same agent must not both launch. The agent row is locked first on + Postgres (``FOR UPDATE``) so concurrent transactions serialize; SQLite's single + writer gives the same guarantee for free. Raises :class:`RunConflictError` if a + running run already exists. + """ + lock = select(agents.c.id).where(agents.c.id == agent_id) + if conn.dialect.name == "postgresql": + lock = lock.with_for_update() + conn.execute(lock) + existing = conn.execute( + select(agent_runs.c.id) + .where(agent_runs.c.agent_id == agent_id, agent_runs.c.status == "running") + .limit(1) + ).first() + if existing is not None: + raise RunConflictError( + f"agent {agent_id} already has running run {existing[0]}" + ) result = conn.execute( agent_runs.insert().values( agent_id=agent_id, @@ -902,12 +927,13 @@ def get_runtime_secret(conn: Connection, key: str) -> dict | None: return _row_to_dict(row) -def get_latest_finished_command(conn: Connection, type: str) -> dict | None: - """The most recent ``done`` command of a type (login pinning reads login_start's - ``claimed_by`` to route login_submit to the same worker container).""" +def get_latest_claimed_command(conn: Connection, type: str) -> dict | None: + """The most recent command of a type that some worker has claimed (running or + finished). Login pinning reads login_start's ``claimed_by`` to route login_submit to + the same worker container — including while the login_start is still in flight.""" row = conn.execute( select(commands) - .where(commands.c.type == type, commands.c.status == "done") + .where(commands.c.type == type, commands.c.claimed_by.is_not(None)) .order_by(commands.c.id.desc()) .limit(1) ).first() diff --git a/tests/test_reaper.py b/tests/test_reaper.py index db594f8..e617e8f 100644 --- a/tests/test_reaper.py +++ b/tests/test_reaper.py @@ -36,7 +36,7 @@ def _hb(worker_id, age_seconds=0.0): def test_reaper_marks_stale_workers_runs_crashed(env): agent, run = _seed_run("w-dead") - _hb("w-dead", age_seconds=120) # stale: default worker_stale_after is 60s + _hb("w-dead", age_seconds=600) # stale: default worker_stale_after is 300s assert worker.reap_dead_workers() == 1 @@ -64,7 +64,7 @@ def test_reaper_preserves_paused_agent_status(env): """paused_for_input still accurately describes what the agent needs — only agents stuck in 'working' get flipped to crashed.""" agent, run = _seed_run("w-dead2", agent_name="paused", agent_status="paused_for_input") - _hb("w-dead2", age_seconds=120) + _hb("w-dead2", age_seconds=600) assert worker.reap_dead_workers() == 1 with get_engine().begin() as conn: @@ -74,7 +74,7 @@ def test_reaper_preserves_paused_agent_status(env): def test_reaper_idempotent_against_races(env): agent, run = _seed_run("w-dead3", agent_name="raced") - _hb("w-dead3", age_seconds=120) + _hb("w-dead3", age_seconds=600) assert worker.reap_dead_workers() == 1 # A second reaper (or the same one next pass) finds nothing left to settle. assert worker.reap_dead_workers() == 0 diff --git a/tests/test_repository_runs.py b/tests/test_repository_runs.py index 3616320..ff862bd 100644 --- a/tests/test_repository_runs.py +++ b/tests/test_repository_runs.py @@ -55,17 +55,29 @@ def test_cancel_request_roundtrip(conn): def test_list_running_runs_scoped_by_worker(conn): agent = _agent(conn) r1 = repo.create_run(conn, agent["id"], "s1", "worker-a", "spawn") - r2 = repo.create_run(conn, agent["id"], "s2", "worker-b", "spawn") repo.finish_run(conn, r1["id"], "completed") + r2 = repo.create_run(conn, agent["id"], "s2", "worker-b", "spawn") running = repo.list_running_runs(conn) assert [r["id"] for r in running] == [r2["id"]] assert repo.list_running_runs(conn, worker_id="worker-a") == [] assert [r["id"] for r in repo.list_running_runs(conn, worker_id="worker-b")] == [r2["id"]] +def test_create_run_refuses_concurrent_run_for_agent(conn): + """One running run per agent, atomically — two workers racing a resume must not both + launch a claude process on the same session.""" + import pytest + + agent = _agent(conn) + repo.create_run(conn, agent["id"], "s1", "worker-a", "spawn") + with pytest.raises(repo.RunConflictError): + repo.create_run(conn, agent["id"], "s1", "worker-b", "resume") + + def test_latest_run_and_agent_session(conn): agent = _agent(conn) - repo.create_run(conn, agent["id"], "s1", "w", "spawn") + first = repo.create_run(conn, agent["id"], "s1", "w", "spawn") + repo.finish_run(conn, first["id"], "completed") latest = repo.create_run(conn, agent["id"], "s1", "w", "resume") assert repo.get_latest_run(conn, agent["id"])["id"] == latest["id"] diff --git a/tests/test_worker_concurrency.py b/tests/test_worker_concurrency.py index 9e9d0e2..c3bc290 100644 --- a/tests/test_worker_concurrency.py +++ b/tests/test_worker_concurrency.py @@ -22,22 +22,26 @@ def headless_env(env, monkeypatch): config.get_settings.cache_clear() -def _seed(conn_count_running_for=None): +def _seed(extra_agents=("b",)): with get_engine().begin() as conn: repo.create_project(conn, "p", "/tmp/p") agent = repo.create_agent(conn, "p", "a", "/tmp/p/a") + for name in extra_agents: + repo.create_agent(conn, "p", name, f"/tmp/p/{name}") return agent -def _running_run(agent_id, worker_id): +def _running_run(agent_name, worker_id): with get_engine().begin() as conn: - return repo.create_run(conn, agent_id, f"sid-{worker_id}", worker_id, "spawn") + agent = repo.get_agent_by_name(conn, "p", agent_name) + return repo.create_run(conn, agent["id"], f"sid-{agent_name}", worker_id, "spawn") def test_full_worker_skips_run_commands_but_processes_others(headless_env, monkeypatch): agent = _seed() - _running_run(agent["id"], "w-full") - _running_run(agent["id"], "w-full") # 2 running == MAX_CONCURRENT_RUNS + # 2 running (one per agent — one running run per agent) == MAX_CONCURRENT_RUNS + _running_run("a", "w-full") + _running_run("b", "w-full") spawned = {} monkeypatch.setattr( @@ -66,9 +70,9 @@ def test_full_worker_skips_run_commands_but_processes_others(headless_env, monke def test_slot_frees_when_run_finishes(headless_env, monkeypatch): - agent = _seed() - run1 = _running_run(agent["id"], "w1") - _running_run(agent["id"], "w1") + _seed() + run1 = _running_run("a", "w1") + _running_run("b", "w1") assert worker._full_slot_exclusions("w1") == worker._RUN_COMMANDS with get_engine().begin() as conn: