@overlordai/server 1.0.57 → 1.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/dispatcher/worker-auth.service.js +1 -1
  2. package/dist/dispatcher/worker-auth.service.js.map +1 -1
  3. package/package.json +4 -4
  4. package/public/assets/{AccessTokensPage-DPQB2fbi.js → AccessTokensPage-CUQDQyQ5.js} +1 -1
  5. package/public/assets/{AdminPage-BqVelYNu.js → AdminPage-ChDIUX_3.js} +1 -1
  6. package/public/assets/{ApiReferencePage-CiGvbLxL.js → ApiReferencePage-DFFhnxAn.js} +1 -1
  7. package/public/assets/{AuditLogPage-DSo4jVYm.js → AuditLogPage-X3KImiZ3.js} +1 -1
  8. package/public/assets/{BindPlatformPage-CTqzpOmt.js → BindPlatformPage-ByhQZ5qX.js} +1 -1
  9. package/public/assets/{BotManage-CIR0rrK7.js → BotManage-BCCGabIK.js} +1 -1
  10. package/public/assets/{CliReferencePage-C8GmlwUz.js → CliReferencePage-BmEVf_Yf.js} +1 -1
  11. package/public/assets/{DeveloperManage-r6y2AoB4.js → DeveloperManage-959Sec6Y.js} +1 -1
  12. package/public/assets/{EditProjectPage-7WCsNltj.js → EditProjectPage-DiVkK33D.js} +1 -1
  13. package/public/assets/{EmptyState-D3foEiul.js → EmptyState-BQqxSE6p.js} +1 -1
  14. package/public/assets/{HomePage-D4yv4orb.js → HomePage-CO4wRT0y.js} +1 -1
  15. package/public/assets/{InfoRow-DhdTYoY9.js → InfoRow-DGKqWvsB.js} +1 -1
  16. package/public/assets/{LandingPage-CqS0E2eC.js → LandingPage-DP9U6Iea.js} +1 -1
  17. package/public/assets/{LoginPage-DDXkdcz_.js → LoginPage-OLBwEvXt.js} +1 -1
  18. package/public/assets/{MetricBar-DMMHfS0A.js → MetricBar-D8u403eM.js} +1 -1
  19. package/public/assets/{NotFoundPage-D5x5BrlX.js → NotFoundPage-DA9fVgox.js} +1 -1
  20. package/public/assets/{OnboardingGuide-D8RyPcEd.js → OnboardingGuide-BgPC4aiz.js} +1 -1
  21. package/public/assets/{PipelineEditorPage-y2-Q8ofQ.js → PipelineEditorPage-Ra4MjS17.js} +1 -1
  22. package/public/assets/{ProfilePage-DN7usHOi.js → ProfilePage-BWGufJ03.js} +1 -1
  23. package/public/assets/{ProjectDetailPage-DJexg49z.js → ProjectDetailPage-CLqYqqVX.js} +1 -1
  24. package/public/assets/{ProjectListPage-Bz7I2D0H.js → ProjectListPage-CitoAwwH.js} +1 -1
  25. package/public/assets/{QuickAuth-Dr0Q50ld.js → QuickAuth-dOCzSE_V.js} +1 -1
  26. package/public/assets/{RemoveMemberConfirmDialog-BCrue0AP.js → RemoveMemberConfirmDialog-D-rvX20k.js} +1 -1
  27. package/public/assets/{Select-BnV8yZlD.js → Select-CdRjIJm4.js} +1 -1
  28. package/public/assets/{SettingsPage-HaUCcsgl.js → SettingsPage-DHa6WOhU.js} +1 -1
  29. package/public/assets/{Skeleton-DUgWc2LJ.js → Skeleton-CEc5RMQi.js} +1 -1
  30. package/public/assets/{SkillPage-BInwZTQh.js → SkillPage-D0lNlB7o.js} +1 -1
  31. package/public/assets/{TaskDetailPage-CfwEj1hy.js → TaskDetailPage-LdLghDpk.js} +1 -1
  32. package/public/assets/TaskListPage-BjPRD6v8.js +1 -0
  33. package/public/assets/{TaskStatusBadge-DuOoGIwE.js → TaskStatusBadge-xZ7FBWZw.js} +1 -1
  34. package/public/assets/{TerminalHomePage-BwXJjr-a.js → TerminalHomePage-cz_7HYVr.js} +1 -1
  35. package/public/assets/{TokenManage-B0Cpv6SO.js → TokenManage-DP0iub57.js} +1 -1
  36. package/public/assets/{TotpSetupPage-MSCCURj9.js → TotpSetupPage-VeqXwL5k.js} +1 -1
  37. package/public/assets/{WorkerDetailPage-R2veIzKo.js → WorkerDetailPage-BOn7z8cR.js} +1 -1
  38. package/public/assets/{WorkerListPage-CserMjGO.js → WorkerListPage-P1hVwXGG.js} +1 -1
  39. package/public/assets/{WorkerSetupGuidePage-SqO2lzVa.js → WorkerSetupGuidePage-m-ZneK_i.js} +1 -1
  40. package/public/assets/{arrow-left-DklRsENx.js → arrow-left-DGmTxTQH.js} +1 -1
  41. package/public/assets/{arrow-right-MDrzFe3K.js → arrow-right-CTOYnmu3.js} +1 -1
  42. package/public/assets/{bot-DPaziJPf.js → bot-BKKWb03w.js} +1 -1
  43. package/public/assets/{chevron-right-CqyufMDW.js → chevron-right-CKEZOJqX.js} +1 -1
  44. package/public/assets/{copy-BUH7P2Hf.js → copy-Ca3klMOV.js} +1 -1
  45. package/public/assets/{external-link-ChPgQ7N_.js → external-link-smb8Si2G.js} +1 -1
  46. package/public/assets/{index-vL7aQJNr.js → index-CqnL6hX8.js} +2 -2
  47. package/public/assets/{key-CxvwwHnW.js → key-uv0MVCos.js} +1 -1
  48. package/public/assets/{loader-circle-DS5g1-Od.js → loader-circle-knGZUOVM.js} +1 -1
  49. package/public/assets/{pencil-B6spIBcw.js → pencil-zZY9INFY.js} +1 -1
  50. package/public/assets/{plus-Bnd1Vz2Y.js → plus-CypZlZSj.js} +1 -1
  51. package/public/assets/{rotate-ccw-CgcLAXNR.js → rotate-ccw-CV1EIcxQ.js} +1 -1
  52. package/public/assets/{scroll-text-CecZ0Fk5.js → scroll-text-mAU4OFrg.js} +1 -1
  53. package/public/assets/{settings-C1uOD3PZ.js → settings-BZyNzgEB.js} +1 -1
  54. package/public/assets/{status-colors-BPEUp90-.js → status-colors-BXL4VDNh.js} +1 -1
  55. package/public/assets/{task-constants-BbFyCyKk.js → task-constants-Bj_lR7bu.js} +1 -1
  56. package/public/assets/{task.store-BE6fEPu4.js → task.store-Bldcjv9A.js} +1 -1
  57. package/public/assets/{trash-2-A2FsT1yG.js → trash-2-BJ5q4Wkp.js} +1 -1
  58. package/public/assets/{useFetch-vGZMAvGi.js → useFetch-CJla7_79.js} +1 -1
  59. package/public/assets/{users-CEdRS_A3.js → users-DBFmGr_S.js} +1 -1
  60. package/public/assets/{wifi-D60NkK6F.js → wifi-DZo2oi08.js} +1 -1
  61. package/public/assets/{zap-DXw1NrWz.js → zap-CDX3UpIX.js} +1 -1
  62. package/public/index.html +1 -1
  63. package/public/sw.js +1 -1
  64. package/public/assets/TaskListPage-Dh59ldSZ.js +0 -1
@@ -128,7 +128,7 @@ let WorkerAuthService = WorkerAuthService_1 = class WorkerAuthService {
128
128
  // 6. All validations passed — now mark token as used and mutate state
129
129
  this.workerTokenRepo.markUsed(tokenId);
130
130
  if (worker) {
131
- // Update existing worker
131
+ // Update existing worker with latest info
132
132
  this.workerRepo.updateStatus(workerId, protocol_1.WorkerStatus.ONLINE);
133
133
  this.workerRepo.updateTokenId(workerId, tokenId);
134
134
  }
@@ -1 +1 @@
1
- {"version":3,"file":"worker-auth.service.js","sourceRoot":"","sources":["../../src/dispatcher/worker-auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAAsE;AACtE,2CAQwB;AACxB,oDAAsC;AAEtC,kFAA8E;AAC9E,8FAAyF;AACzF,wFAAmF;AACnF,mEAA+D;AAC/D,uDAAmD;AACnD,6DAAyD;AACzD,0DAAsD;AAG/C,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAIT;IACA;IACA;IACA;IACA;IACA;IACA;IATF,MAAM,GAAG,IAAI,eAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IAE7D,YACmB,UAA4B,EAC5B,eAAsC,EACtC,YAAgC,EAChC,eAAgC,EAChC,WAAwB,EACxB,aAA4B,EAC5B,KAAmB;QANnB,eAAU,GAAV,UAAU,CAAkB;QAC5B,oBAAe,GAAf,eAAe,CAAuB;QACtC,iBAAY,GAAZ,YAAY,CAAoB;QAChC,oBAAe,GAAf,eAAe,CAAiB;QAChC,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAe;QAC5B,UAAK,GAAL,KAAK,CAAc;IACnC,CAAC;IAE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}
1
+ {"version":3,"file":"worker-auth.service.js","sourceRoot":"","sources":["../../src/dispatcher/worker-auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAAsE;AACtE,2CAQwB;AACxB,oDAAsC;AAEtC,kFAA8E;AAC9E,8FAAyF;AACzF,wFAAmF;AACnF,mEAA+D;AAC/D,uDAAmD;AACnD,6DAAyD;AACzD,0DAAsD;AAG/C,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAIT;IACA;IACA;IACA;IACA;IACA;IACA;IATF,MAAM,GAAG,IAAI,eAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IAE7D,YACmB,UAA4B,EAC5B,eAAsC,EACtC,YAAgC,EAChC,eAAgC,EAChC,WAAwB,EACxB,aAA4B,EAC5B,KAAmB;QANnB,eAAU,GAAV,UAAU,CAAkB;QAC5B,oBAAe,GAAf,eAAe,CAAuB;QACtC,iBAAY,GAAZ,YAAY,CAAoB;QAChC,oBAAe,GAAf,eAAe,CAAiB;QAChC,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAe;QAC5B,UAAK,GAAL,KAAK,CAAc;IACnC,CAAC;IAEJ,8EAA8E;IAC9E,iBAAiB;IACjB,8EAA8E;IAE9E,KAAK,CAAC,cAAc,CAClB,OAA8B;QAE9B,2CAA2C;QAC3C,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEjE,qDAAqD;QACrD,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,8BAAqB,CAC7B,sCAAsC,CACvC,CAAC;QACJ,CAAC;QAED,iCAAiC;QACjC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC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KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC/B,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;SACjB,CAAC;IACJ,CAAC;IAEO,uBAAuB,CAAC,aAAqB;QACnD,MAAM,CAAC,WAAW,CAAC,GAAG,2BAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE/C,IAAI,WAAW,KAAK,WAAW,EAAE,CAAC;YAChC,MAAM,IAAI,4BAAmB,CAC3B,qCAAqC,2BAAgB,YAAY,aAAa,6BAA6B,CAC5G,CAAC;QACJ,CAAC;QAED,IAAI,aAAa,KAAK,2BAAgB,EAAE,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,2CAA2C,2BAAgB,YAAY,aAAa,EAAE,CACvF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA5TY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAKoB,oCAAgB;QACX,+CAAqB;QACxB,yCAAkB;QACf,kCAAe;QACnB,0BAAW;QACT,8BAAa;QACrB,4BAAY;GAV3B,iBAAiB,CA4T7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overlordai/server",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",
@@ -28,9 +28,9 @@
28
28
  "@nestjs/platform-express": "^10.4.0",
29
29
  "@nestjs/platform-ws": "^10.4.0",
30
30
  "@nestjs/websockets": "^10.4.0",
31
- "@overlordai/command-parser": "1.0.57",
32
- "@overlordai/protocol": "1.0.57",
33
- "@overlordai/validation": "1.0.57",
31
+ "@overlordai/command-parser": "1.0.59",
32
+ "@overlordai/protocol": "1.0.59",
33
+ "@overlordai/validation": "1.0.59",
34
34
  "@slack/web-api": "^7.15.0",
35
35
  "bcrypt": "^6.0.0",
36
36
  "better-sqlite3": "^11.0.0",
@@ -1 +1 @@
1
- import{a as _,r as c,j as e,g as k,s as C,n as T,w as S,K as A,B as f,t as g}from"./index-vL7aQJNr.js";import{S as D}from"./Select-BnV8yZlD.js";import{E}from"./EmptyState-D3foEiul.js";import{T as L}from"./Skeleton-DUgWc2LJ.js";import{t as N}from"./date-BdNtiQTP.js";import{u as I}from"./useFetch-vGZMAvGi.js";import{P as R}from"./plus-Bnd1Vz2Y.js";import{C as O}from"./copy-BUH7P2Hf.js";import{T as w}from"./trash-2-A2FsT1yG.js";function P({isOpen:s,onClose:u,onCreated:i}){const{t:a}=_(),[d,o]=c.useState(""),[x,n]=c.useState("never"),[m,p]=c.useState(!1),[v,l]=c.useState(""),j=[{value:"never",label:a("access_tokens.no_expiry")},{value:"30",label:a("access_tokens.days_30")},{value:"90",label:a("access_tokens.days_90")},{value:"365",label:a("access_tokens.days_365")}];function b(){o(""),n("never"),l(""),u()}async function h(){if(l(""),!d.trim()){l(a("access_tokens.token_label_required"));return}try{p(!0);const r=await k.post("web/profile/tokens",{json:{label:d.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();o(""),n("never"),i({token:r.token,name:r.name})}catch(r){const y=r instanceof Error?r.message:a("access_tokens.failed_to_create_token");l(y)}finally{p(!1)}}return s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]",onClick:b}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:a("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[v&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:v}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:a("access_tokens.token_name_placeholder"),value:d,onChange:r=>o(r.target.value),onKeyDown:r=>{r.key==="Enter"&&h()},className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.expires")}),e.jsx(D,{value:x,onChange:n,options:j})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:h,disabled:m,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:a(m?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function V({isOpen:s,onClose:u,onConfirm:i,tokenLabel:a,isLoading:d}){const{t:o}=_();return e.jsx(C,{isOpen:s,onClose:u,onConfirm:i,title:o("access_tokens.revoke_token_title"),message:o("access_tokens.revoke_confirm",{name:a}),confirmLabel:o("access_tokens.revoke"),confirmVariant:"danger",isLoading:d})}function G(){const{t:s}=_(),[u,i]=c.useState(!1),[a,d]=c.useState(null),[o,x]=c.useState(!1),[n,m]=c.useState(null),[p,v]=c.useState(null),{data:l,loading:j,refetch:b}=I(()=>k.get("web/profile/tokens").json(),[]);T(c.useMemo(()=>e.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[s]));function h(t){i(!1),d(t.token),x(!1),b()}async function r(){if(a)try{await navigator.clipboard.writeText(a),x(!0),setTimeout(()=>x(!1),2e3)}catch{}}async function y(){if(n)try{v(n.id),await k.post(`web/profile/tokens/${n.id}/revoke`),g.success(s("access_tokens.token_revoked")),m(null),b()}catch{g.error(s("access_tokens.failed_to_revoke_token"))}finally{v(null)}}return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[a&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:s("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:a}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[o?e.jsx(S,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(O,{className:"h-3.5 w-3.5"}),s(o?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>d(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:s("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:j?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:3})}):!l||l.length===0?e.jsx(E,{icon:A,title:s("access_tokens.no_tokens"),description:s("access_tokens.create_token_desc"),actionLabel:s("access_tokens.create_token"),onAction:()=>i(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden divide-y divide-[var(--border)]",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] font-medium",children:t.label}),e.jsx("span",{className:`text-xs shrink-0 ml-2 ${t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]"}`,children:t.status})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-[var(--text-secondary)]",children:[e.jsxs("span",{children:[s("access_tokens.created"),": ",new Date(t.createdAt).toLocaleDateString()]}),e.jsxs("span",{children:[s("access_tokens.expires"),": ",t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")]}),e.jsxs("span",{children:[s("access_tokens.last_used"),": ",t.lastUsedAt?N(t.lastUsedAt):s("common.never")]})]}),t.status===f.ACTIVE&&e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))}),e.jsxs("table",{className:"hidden md:table w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:s("common.actions")})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:e.jsx("span",{className:"truncate block max-w-[200px]",children:t.label})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]",children:t.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.lastUsedAt?N(t.lastUsedAt):s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:t.status===f.ACTIVE&&e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))})]})]})}),e.jsx(P,{isOpen:u,onClose:()=>i(!1),onCreated:h}),e.jsx(V,{isOpen:!!n,onClose:()=>m(null),onConfirm:y,tokenLabel:(n==null?void 0:n.label)??"",isLoading:p!==null})]})}export{G as default};
1
+ import{a as _,r as c,j as e,g as k,s as C,n as T,w as S,K as A,B as f,t as g}from"./index-CqnL6hX8.js";import{S as D}from"./Select-CdRjIJm4.js";import{E}from"./EmptyState-BQqxSE6p.js";import{T as L}from"./Skeleton-CEc5RMQi.js";import{t as N}from"./date-BdNtiQTP.js";import{u as I}from"./useFetch-CJla7_79.js";import{P as R}from"./plus-CypZlZSj.js";import{C as O}from"./copy-Ca3klMOV.js";import{T as w}from"./trash-2-BJ5q4Wkp.js";function P({isOpen:s,onClose:u,onCreated:i}){const{t:a}=_(),[d,o]=c.useState(""),[x,n]=c.useState("never"),[m,p]=c.useState(!1),[v,l]=c.useState(""),j=[{value:"never",label:a("access_tokens.no_expiry")},{value:"30",label:a("access_tokens.days_30")},{value:"90",label:a("access_tokens.days_90")},{value:"365",label:a("access_tokens.days_365")}];function b(){o(""),n("never"),l(""),u()}async function h(){if(l(""),!d.trim()){l(a("access_tokens.token_label_required"));return}try{p(!0);const r=await k.post("web/profile/tokens",{json:{label:d.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();o(""),n("never"),i({token:r.token,name:r.name})}catch(r){const y=r instanceof Error?r.message:a("access_tokens.failed_to_create_token");l(y)}finally{p(!1)}}return s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]",onClick:b}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:a("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[v&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:v}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:a("access_tokens.token_name_placeholder"),value:d,onChange:r=>o(r.target.value),onKeyDown:r=>{r.key==="Enter"&&h()},className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.expires")}),e.jsx(D,{value:x,onChange:n,options:j})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:h,disabled:m,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:a(m?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function V({isOpen:s,onClose:u,onConfirm:i,tokenLabel:a,isLoading:d}){const{t:o}=_();return e.jsx(C,{isOpen:s,onClose:u,onConfirm:i,title:o("access_tokens.revoke_token_title"),message:o("access_tokens.revoke_confirm",{name:a}),confirmLabel:o("access_tokens.revoke"),confirmVariant:"danger",isLoading:d})}function G(){const{t:s}=_(),[u,i]=c.useState(!1),[a,d]=c.useState(null),[o,x]=c.useState(!1),[n,m]=c.useState(null),[p,v]=c.useState(null),{data:l,loading:j,refetch:b}=I(()=>k.get("web/profile/tokens").json(),[]);T(c.useMemo(()=>e.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[s]));function h(t){i(!1),d(t.token),x(!1),b()}async function r(){if(a)try{await navigator.clipboard.writeText(a),x(!0),setTimeout(()=>x(!1),2e3)}catch{}}async function y(){if(n)try{v(n.id),await k.post(`web/profile/tokens/${n.id}/revoke`),g.success(s("access_tokens.token_revoked")),m(null),b()}catch{g.error(s("access_tokens.failed_to_revoke_token"))}finally{v(null)}}return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[a&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:s("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:a}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[o?e.jsx(S,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(O,{className:"h-3.5 w-3.5"}),s(o?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>d(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:s("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:j?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:3})}):!l||l.length===0?e.jsx(E,{icon:A,title:s("access_tokens.no_tokens"),description:s("access_tokens.create_token_desc"),actionLabel:s("access_tokens.create_token"),onAction:()=>i(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden divide-y divide-[var(--border)]",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] font-medium",children:t.label}),e.jsx("span",{className:`text-xs shrink-0 ml-2 ${t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]"}`,children:t.status})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-[var(--text-secondary)]",children:[e.jsxs("span",{children:[s("access_tokens.created"),": ",new Date(t.createdAt).toLocaleDateString()]}),e.jsxs("span",{children:[s("access_tokens.expires"),": ",t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")]}),e.jsxs("span",{children:[s("access_tokens.last_used"),": ",t.lastUsedAt?N(t.lastUsedAt):s("common.never")]})]}),t.status===f.ACTIVE&&e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))}),e.jsxs("table",{className:"hidden md:table w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:s("common.actions")})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:e.jsx("span",{className:"truncate block max-w-[200px]",children:t.label})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]",children:t.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.lastUsedAt?N(t.lastUsedAt):s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:t.status===f.ACTIVE&&e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))})]})]})}),e.jsx(P,{isOpen:u,onClose:()=>i(!1),onCreated:h}),e.jsx(V,{isOpen:!!n,onClose:()=>m(null),onConfirm:y,tokenLabel:(n==null?void 0:n.label)??"",isLoading:p!==null})]})}export{G as default};
@@ -1 +1 @@
1
- import{a as i,K as d,j as t,E as m,O as l}from"./index-vL7aQJNr.js";import{U as c}from"./users-CEdRS_A3.js";import{B as b}from"./bot-DPaziJPf.js";import{S as x}from"./scroll-text-CecZ0Fk5.js";import{S as p}from"./settings-C1uOD3PZ.js";function _(){const{t:a}=i(),o=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:c},{to:"/admin/bots",label:a("admin.tab_bots"),icon:b},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:d},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:x},{to:"/admin/settings",label:a("admin.tab_settings"),icon:p}];return t.jsxs("div",{children:[t.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar",children:o.map(({to:e,label:r,icon:s})=>t.jsxs(m,{to:e,className:({isActive:n})=>`flex shrink-0 items-center gap-2 border-b-2 px-4 py-3 md:py-2 text-sm transition-colors ${n?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[t.jsx(s,{size:16}),r]},e))}),t.jsx(l,{})]})}export{_ as default};
1
+ import{a as i,K as d,j as t,E as m,O as l}from"./index-CqnL6hX8.js";import{U as c}from"./users-DBFmGr_S.js";import{B as b}from"./bot-BKKWb03w.js";import{S as x}from"./scroll-text-mAU4OFrg.js";import{S as p}from"./settings-BZyNzgEB.js";function _(){const{t:a}=i(),o=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:c},{to:"/admin/bots",label:a("admin.tab_bots"),icon:b},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:d},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:x},{to:"/admin/settings",label:a("admin.tab_settings"),icon:p}];return t.jsxs("div",{children:[t.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar",children:o.map(({to:e,label:r,icon:s})=>t.jsxs(m,{to:e,className:({isActive:n})=>`flex shrink-0 items-center gap-2 border-b-2 px-4 py-3 md:py-2 text-sm transition-colors ${n?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[t.jsx(s,{size:16}),r]},e))}),t.jsx(l,{})]})}export{_ as default};
@@ -1 +1 @@
1
- import{e as d,a as o,n as p,r as n,j as t}from"./index-vL7aQJNr.js";import{Q as c}from"./QuickAuth-Dr0Q50ld.js";import{P as h}from"./plus-Bnd1Vz2Y.js";import"./copy-BUH7P2Hf.js";const l={GET:"text-green-400",POST:"text-blue-400",PUT:"text-yellow-400",DELETE:"text-red-400"},m=[{title:"authentication",prefix:"/api/auth",endpoints:[{method:"POST",path:"/login",description:"authenticate with username + password (optional totpCode)",auth:"none",body:'{ "username": "string", "password": "string", "totpCode?": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/refresh",description:"refresh access token (rotates refresh token)",auth:"none",body:'{ "refreshToken": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/logout",description:"invalidate refresh token",auth:"jwt",body:'{ "refreshToken": "string" }'}]},{title:"tasks",prefix:"/api/web/tasks",endpoints:[{method:"GET",path:"",description:"list tasks with optional filters",auth:"jwt",response:'[ { "id": 1, "description": "...", "status": "RUNNING", ... } ]'},{method:"POST",path:"",description:"create a new task",auth:"jwt",body:'{ "projectKey": "string", "description": "string", "workerId?": "string" }'},{method:"GET",path:"/:id",description:"get task details",auth:"jwt"},{method:"POST",path:"/:id/cancel",description:"cancel a running task",auth:"jwt"},{method:"POST",path:"/:id/retry",description:"retry a failed task",auth:"jwt"},{method:"POST",path:"/:id/confirm-stage",description:"confirm/choose/input for suspended stage",auth:"jwt",body:'{ "stageIndex": "number", "result": "string" }'},{method:"POST",path:"/:id/pty-token",description:"get pty websocket token",auth:"jwt"}]},{title:"workers",prefix:"/api/web/workers",endpoints:[{method:"GET",path:"",description:"list all workers",auth:"jwt"},{method:"GET",path:"/:id",description:"get worker details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a worker",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a worker",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel worker drain",auth:"jwt"}]},{title:"projects",prefix:"/api/web/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"GET",path:"/:key",description:"get project details",auth:"jwt"}]},{title:"profile",prefix:"/api/web/profile",endpoints:[{method:"GET",path:"",description:"get current user profile",auth:"jwt"},{method:"PUT",path:"",description:"update profile (gitName, gitEmail)",auth:"jwt",body:'{ "gitName?": "string", "gitEmail?": "string" }'},{method:"PUT",path:"/password",description:"change password",auth:"jwt",body:'{ "currentPassword": "string", "newPassword": "string" }'},{method:"POST",path:"/totp/setup",description:"initialize totp setup",auth:"jwt"},{method:"POST",path:"/totp/verify",description:"verify totp setup code",auth:"jwt",body:'{ "code": "string" }'},{method:"GET",path:"/tokens",description:"list personal access tokens",auth:"jwt"},{method:"POST",path:"/tokens",description:"create a personal access token",auth:"jwt",body:'{ "label": "string", "expiresAt?": "string" }'},{method:"POST",path:"/tokens/:id/revoke",description:"revoke a token",auth:"jwt"},{method:"POST",path:"/bind-platform",description:"link a chat platform account using a one-time bind token",auth:"jwt",body:'{ "token": "string" }',response:'{ "success": true, "platform": "lark" }'}]},{title:"workspaces & tunnels",prefix:"/api/web",endpoints:[{method:"GET",path:"/workspaces/:taskId",description:"get workspace for a task",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/start",description:"start a cursor remote tunnel",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/stop",description:"stop a running tunnel",auth:"jwt"},{method:"GET",path:"/workspace-tunnel/:taskId/status",description:"get tunnel status",auth:"jwt"}]},{title:"dashboard",prefix:"/api/web/dashboard",endpoints:[{method:"GET",path:"/stats",description:"get dashboard statistics",auth:"jwt"},{method:"GET",path:"/recent-tasks",description:"get recent tasks for dashboard",auth:"jwt"},{method:"GET",path:"/recent-activity",description:"get recent activity feed",auth:"jwt"}]},{title:"notifications",prefix:"/api/web/notifications",endpoints:[{method:"GET",path:"",description:"list notifications with cursor pagination",auth:"jwt"},{method:"POST",path:"/:id/read",description:"mark a notification as read",auth:"jwt"},{method:"POST",path:"/read-all",description:"mark all notifications as read",auth:"jwt"}]},{title:"search",prefix:"/api/web",endpoints:[{method:"GET",path:"/search?q=query",description:"global search across tasks, workers, projects",auth:"jwt"}]},{title:"admin — developers",prefix:"/api/admin/developers",endpoints:[{method:"GET",path:"",description:"list all developers",auth:"jwt"},{method:"POST",path:"",description:"create a developer",auth:"jwt",body:'{ "name": "string", "password": "string", "role": "string", "gitName": "string", "gitEmail": "string" }'},{method:"PUT",path:"/:id",description:"update developer",auth:"jwt"},{method:"PUT",path:"/:id/reset-totp",description:"reset developer totp",auth:"jwt"}]},{title:"admin — projects",prefix:"/api/admin/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"POST",path:"",description:"create a project",auth:"jwt"},{method:"PUT",path:"/:key",description:"update project (including pipeline)",auth:"jwt"},{method:"DELETE",path:"/:key",description:"delete a project",auth:"jwt"},{method:"GET",path:"/:key/members",description:"get project members",auth:"jwt"},{method:"POST",path:"/:key/members",description:"add project member",auth:"jwt"},{method:"DELETE",path:"/:key/members?developerId=N",description:"remove project member",auth:"jwt"}]},{title:"admin — worker tokens",prefix:"/api/admin/worker-tokens",endpoints:[{method:"GET",path:"",description:"list all worker enrollment tokens",auth:"jwt"},{method:"POST",path:"",description:"generate a new worker token",auth:"jwt"},{method:"POST",path:"/:id/revoke",description:"revoke a worker token",auth:"jwt"},{method:"GET",path:"/:id/status",description:"get token status and linked worker",auth:"jwt"}]},{title:"admin — workers",prefix:"/api/admin/workers",endpoints:[{method:"GET",path:"",description:"list all workers (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update worker status",auth:"jwt",body:'{ "status?": "string" }'}]},{title:"admin — bots",prefix:"/api/admin/bots",endpoints:[{method:"GET",path:"",description:"list bot instances",auth:"jwt"},{method:"POST",path:"",description:"create a bot instance",auth:"jwt"},{method:"GET",path:"/:id/bindings",description:"get chat bindings for a bot",auth:"jwt"},{method:"POST",path:"/:id/bindings",description:"create a chat binding",auth:"jwt"},{method:"DELETE",path:"/:id/bindings",description:"delete a chat binding",auth:"jwt"}]},{title:"admin — audit & settings",prefix:"/api/admin",endpoints:[{method:"GET",path:"/audit-logs",description:"query audit log with filters",auth:"jwt"},{method:"GET",path:"/settings",description:"get all system settings",auth:"jwt"},{method:"PUT",path:"/settings",description:"update system settings",auth:"jwt"}]},{title:"websocket",prefix:"",endpoints:[{method:"GET",path:"WS /ws/pty/:taskId",description:'pty terminal websocket — first obtain a channel token via POST /api/web/tasks/:taskId/pty-token, then send an auth frame after connection: { type: "auth", token: "<jwt>", channelToken: "<channel-token>" }',auth:"jwt"},{method:"GET",path:"WS /api/workers/pty/:taskId",description:'worker pty websocket — auth via frame: { type: "auth", workerJwt: "<worker-jwt>", channelToken: "<channel-token>" }',auth:"worker-token"}]}];function x({ep:e,prefix:a}){const[s,i]=n.useState(!1),{t:r}=o();return t.jsxs("div",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 sm:gap-3 px-3 md:px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)] min-w-0",onClick:()=>i(!s),children:[t.jsx("span",{className:`w-12 shrink-0 text-xs font-bold ${l[e.method]}`,children:e.method}),t.jsxs("code",{className:"flex-1 text-xs text-[var(--text-primary)] truncate min-w-0",children:[a,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),s&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] px-3 md:px-4 py-3 space-y-2",children:[t.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// ",e.description]}),t.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[t.jsx("span",{className:"text-[var(--text-muted)]",children:"auth:"}),t.jsx("span",{className:e.auth==="none"?"text-[var(--text-muted)]":"text-[var(--accent)]",children:e.auth})]}),e.body&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.request_body")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.body})]}),e.response&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.response")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.response})]})]})]})}function g(){const e=d(),{t:a}=o();return p(n.useMemo(()=>t.jsxs("button",{onClick:()=>e("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[t.jsx(h,{className:"h-3.5 w-3.5"}),a("access_tokens.create_token")]}),[e,a])),t.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[t.jsx("div",{className:"mb-8",children:t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.api_base_url_desc",{url:"http://localhost:9000"})})}),t.jsx(c,{mode:"api"}),t.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.authentication")}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"jwt"}),t.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["obtained via /api/auth/login — pass as ",t.jsx("code",{children:"authorization: bearer <token>"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"pat"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"personal access token — same header format, for cli/api usage"})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-yellow-400",children:"worker-token"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"enrollment token for worker registration — used during initial handshake"})]})]}),t.jsx("div",{className:"space-y-6",children:m.map(s=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",s.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s.endpoints.map((i,r)=>t.jsx(x,{ep:i,prefix:s.prefix},`${i.method}-${i.path}-${r}`))})]},s.title))})]})}export{g as default};
1
+ import{e as d,a as o,n as p,r as n,j as t}from"./index-CqnL6hX8.js";import{Q as c}from"./QuickAuth-dOCzSE_V.js";import{P as h}from"./plus-CypZlZSj.js";import"./copy-Ca3klMOV.js";const l={GET:"text-green-400",POST:"text-blue-400",PUT:"text-yellow-400",DELETE:"text-red-400"},m=[{title:"authentication",prefix:"/api/auth",endpoints:[{method:"POST",path:"/login",description:"authenticate with username + password (optional totpCode)",auth:"none",body:'{ "username": "string", "password": "string", "totpCode?": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/refresh",description:"refresh access token (rotates refresh token)",auth:"none",body:'{ "refreshToken": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/logout",description:"invalidate refresh token",auth:"jwt",body:'{ "refreshToken": "string" }'}]},{title:"tasks",prefix:"/api/web/tasks",endpoints:[{method:"GET",path:"",description:"list tasks with optional filters",auth:"jwt",response:'[ { "id": 1, "description": "...", "status": "RUNNING", ... } ]'},{method:"POST",path:"",description:"create a new task",auth:"jwt",body:'{ "projectKey": "string", "description": "string", "workerId?": "string" }'},{method:"GET",path:"/:id",description:"get task details",auth:"jwt"},{method:"POST",path:"/:id/cancel",description:"cancel a running task",auth:"jwt"},{method:"POST",path:"/:id/retry",description:"retry a failed task",auth:"jwt"},{method:"POST",path:"/:id/confirm-stage",description:"confirm/choose/input for suspended stage",auth:"jwt",body:'{ "stageIndex": "number", "result": "string" }'},{method:"POST",path:"/:id/pty-token",description:"get pty websocket token",auth:"jwt"}]},{title:"workers",prefix:"/api/web/workers",endpoints:[{method:"GET",path:"",description:"list all workers",auth:"jwt"},{method:"GET",path:"/:id",description:"get worker details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a worker",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a worker",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel worker drain",auth:"jwt"}]},{title:"projects",prefix:"/api/web/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"GET",path:"/:key",description:"get project details",auth:"jwt"}]},{title:"profile",prefix:"/api/web/profile",endpoints:[{method:"GET",path:"",description:"get current user profile",auth:"jwt"},{method:"PUT",path:"",description:"update profile (gitName, gitEmail)",auth:"jwt",body:'{ "gitName?": "string", "gitEmail?": "string" }'},{method:"PUT",path:"/password",description:"change password",auth:"jwt",body:'{ "currentPassword": "string", "newPassword": "string" }'},{method:"POST",path:"/totp/setup",description:"initialize totp setup",auth:"jwt"},{method:"POST",path:"/totp/verify",description:"verify totp setup code",auth:"jwt",body:'{ "code": "string" }'},{method:"GET",path:"/tokens",description:"list personal access tokens",auth:"jwt"},{method:"POST",path:"/tokens",description:"create a personal access token",auth:"jwt",body:'{ "label": "string", "expiresAt?": "string" }'},{method:"POST",path:"/tokens/:id/revoke",description:"revoke a token",auth:"jwt"},{method:"POST",path:"/bind-platform",description:"link a chat platform account using a one-time bind token",auth:"jwt",body:'{ "token": "string" }',response:'{ "success": true, "platform": "lark" }'}]},{title:"workspaces & tunnels",prefix:"/api/web",endpoints:[{method:"GET",path:"/workspaces/:taskId",description:"get workspace for a task",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/start",description:"start a cursor remote tunnel",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/stop",description:"stop a running tunnel",auth:"jwt"},{method:"GET",path:"/workspace-tunnel/:taskId/status",description:"get tunnel status",auth:"jwt"}]},{title:"dashboard",prefix:"/api/web/dashboard",endpoints:[{method:"GET",path:"/stats",description:"get dashboard statistics",auth:"jwt"},{method:"GET",path:"/recent-tasks",description:"get recent tasks for dashboard",auth:"jwt"},{method:"GET",path:"/recent-activity",description:"get recent activity feed",auth:"jwt"}]},{title:"notifications",prefix:"/api/web/notifications",endpoints:[{method:"GET",path:"",description:"list notifications with cursor pagination",auth:"jwt"},{method:"POST",path:"/:id/read",description:"mark a notification as read",auth:"jwt"},{method:"POST",path:"/read-all",description:"mark all notifications as read",auth:"jwt"}]},{title:"search",prefix:"/api/web",endpoints:[{method:"GET",path:"/search?q=query",description:"global search across tasks, workers, projects",auth:"jwt"}]},{title:"admin — developers",prefix:"/api/admin/developers",endpoints:[{method:"GET",path:"",description:"list all developers",auth:"jwt"},{method:"POST",path:"",description:"create a developer",auth:"jwt",body:'{ "name": "string", "password": "string", "role": "string", "gitName": "string", "gitEmail": "string" }'},{method:"PUT",path:"/:id",description:"update developer",auth:"jwt"},{method:"PUT",path:"/:id/reset-totp",description:"reset developer totp",auth:"jwt"}]},{title:"admin — projects",prefix:"/api/admin/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"POST",path:"",description:"create a project",auth:"jwt"},{method:"PUT",path:"/:key",description:"update project (including pipeline)",auth:"jwt"},{method:"DELETE",path:"/:key",description:"delete a project",auth:"jwt"},{method:"GET",path:"/:key/members",description:"get project members",auth:"jwt"},{method:"POST",path:"/:key/members",description:"add project member",auth:"jwt"},{method:"DELETE",path:"/:key/members?developerId=N",description:"remove project member",auth:"jwt"}]},{title:"admin — worker tokens",prefix:"/api/admin/worker-tokens",endpoints:[{method:"GET",path:"",description:"list all worker enrollment tokens",auth:"jwt"},{method:"POST",path:"",description:"generate a new worker token",auth:"jwt"},{method:"POST",path:"/:id/revoke",description:"revoke a worker token",auth:"jwt"},{method:"GET",path:"/:id/status",description:"get token status and linked worker",auth:"jwt"}]},{title:"admin — workers",prefix:"/api/admin/workers",endpoints:[{method:"GET",path:"",description:"list all workers (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update worker status",auth:"jwt",body:'{ "status?": "string" }'}]},{title:"admin — bots",prefix:"/api/admin/bots",endpoints:[{method:"GET",path:"",description:"list bot instances",auth:"jwt"},{method:"POST",path:"",description:"create a bot instance",auth:"jwt"},{method:"GET",path:"/:id/bindings",description:"get chat bindings for a bot",auth:"jwt"},{method:"POST",path:"/:id/bindings",description:"create a chat binding",auth:"jwt"},{method:"DELETE",path:"/:id/bindings",description:"delete a chat binding",auth:"jwt"}]},{title:"admin — audit & settings",prefix:"/api/admin",endpoints:[{method:"GET",path:"/audit-logs",description:"query audit log with filters",auth:"jwt"},{method:"GET",path:"/settings",description:"get all system settings",auth:"jwt"},{method:"PUT",path:"/settings",description:"update system settings",auth:"jwt"}]},{title:"websocket",prefix:"",endpoints:[{method:"GET",path:"WS /ws/pty/:taskId",description:'pty terminal websocket — first obtain a channel token via POST /api/web/tasks/:taskId/pty-token, then send an auth frame after connection: { type: "auth", token: "<jwt>", channelToken: "<channel-token>" }',auth:"jwt"},{method:"GET",path:"WS /api/workers/pty/:taskId",description:'worker pty websocket — auth via frame: { type: "auth", workerJwt: "<worker-jwt>", channelToken: "<channel-token>" }',auth:"worker-token"}]}];function x({ep:e,prefix:a}){const[s,i]=n.useState(!1),{t:r}=o();return t.jsxs("div",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 sm:gap-3 px-3 md:px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)] min-w-0",onClick:()=>i(!s),children:[t.jsx("span",{className:`w-12 shrink-0 text-xs font-bold ${l[e.method]}`,children:e.method}),t.jsxs("code",{className:"flex-1 text-xs text-[var(--text-primary)] truncate min-w-0",children:[a,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),s&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] px-3 md:px-4 py-3 space-y-2",children:[t.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// ",e.description]}),t.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[t.jsx("span",{className:"text-[var(--text-muted)]",children:"auth:"}),t.jsx("span",{className:e.auth==="none"?"text-[var(--text-muted)]":"text-[var(--accent)]",children:e.auth})]}),e.body&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.request_body")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.body})]}),e.response&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.response")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.response})]})]})]})}function g(){const e=d(),{t:a}=o();return p(n.useMemo(()=>t.jsxs("button",{onClick:()=>e("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[t.jsx(h,{className:"h-3.5 w-3.5"}),a("access_tokens.create_token")]}),[e,a])),t.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[t.jsx("div",{className:"mb-8",children:t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.api_base_url_desc",{url:"http://localhost:9000"})})}),t.jsx(c,{mode:"api"}),t.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.authentication")}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"jwt"}),t.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["obtained via /api/auth/login — pass as ",t.jsx("code",{children:"authorization: bearer <token>"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"pat"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"personal access token — same header format, for cli/api usage"})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-yellow-400",children:"worker-token"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"enrollment token for worker registration — used during initial handshake"})]})]}),t.jsx("div",{className:"space-y-6",children:m.map(s=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",s.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s.endpoints.map((i,r)=>t.jsx(x,{ep:i,prefix:s.prefix},`${i.method}-${i.path}-${r}`))})]},s.title))})]})}export{g as default};
@@ -1,4 +1,4 @@
1
- import{c as C,a as S,r,g as k,j as e,o as L}from"./index-vL7aQJNr.js";import{S as E}from"./Select-BnV8yZlD.js";import{E as T}from"./EmptyState-D3foEiul.js";import{T as A}from"./Skeleton-DUgWc2LJ.js";import{S as F}from"./scroll-text-CecZ0Fk5.js";import{C as I}from"./chevron-right-CqyufMDW.js";/**
1
+ import{c as C,a as S,r,g as k,j as e,o as L}from"./index-CqnL6hX8.js";import{S as E}from"./Select-CdRjIJm4.js";import{E as T}from"./EmptyState-BQqxSE6p.js";import{T as A}from"./Skeleton-CEc5RMQi.js";import{S as F}from"./scroll-text-mAU4OFrg.js";import{C as I}from"./chevron-right-CKEZOJqX.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a as u,z as h,e as g,r as s,g as v,j as e}from"./index-vL7aQJNr.js";function j(){const{t:r}=u(),[l]=h(),i=g(),a=l.get("token"),[n,o]=s.useState("loading"),[m,p]=s.useState(""),[b,c]=s.useState("");return s.useEffect(()=>{if(!a){o("error"),c(r("bind.no_token"));return}v.post("web/profile/bind-platform",{json:{token:a}}).json().then(t=>{p(t.platform),o("success")}).catch(async t=>{var x;o("error");try{const d=await((x=t.response)==null?void 0:x.json());c((d==null?void 0:d.message)??r("bind.error"))}catch{c(t instanceof Error?t.message:r("bind.error"))}})},[a]),e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--bg-primary)] px-4 font-mono",children:e.jsxs("div",{className:"w-full max-w-[400px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-6",children:[e.jsx("h1",{className:"mb-4 text-sm text-[var(--text-primary)]",children:r("bind.title")}),n==="loading"&&e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("bind.linking")}),n==="success"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-[4px] border border-green-500/30 bg-green-500/10 px-3 py-2 text-xs text-green-400",children:r("bind.success")}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:r("bind.success_detail").replace("{platform}",m)}),e.jsx("button",{onClick:()=>i("/home"),className:"rounded-[4px] bg-[var(--accent)] px-3 py-2 text-xs text-black hover:opacity-90 transition-opacity",children:r("bind.back_to_home")})]}),n==="error"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400 break-words",children:b||r("bind.invalid_token")}),e.jsx("button",{onClick:()=>i("/home"),className:"rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("bind.back_to_home")})]})]})})}export{j as default};
1
+ import{a as u,z as h,e as g,r as s,g as v,j as e}from"./index-CqnL6hX8.js";function j(){const{t:r}=u(),[l]=h(),i=g(),a=l.get("token"),[n,o]=s.useState("loading"),[m,p]=s.useState(""),[b,c]=s.useState("");return s.useEffect(()=>{if(!a){o("error"),c(r("bind.no_token"));return}v.post("web/profile/bind-platform",{json:{token:a}}).json().then(t=>{p(t.platform),o("success")}).catch(async t=>{var x;o("error");try{const d=await((x=t.response)==null?void 0:x.json());c((d==null?void 0:d.message)??r("bind.error"))}catch{c(t instanceof Error?t.message:r("bind.error"))}})},[a]),e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--bg-primary)] px-4 font-mono",children:e.jsxs("div",{className:"w-full max-w-[400px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-6",children:[e.jsx("h1",{className:"mb-4 text-sm text-[var(--text-primary)]",children:r("bind.title")}),n==="loading"&&e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("bind.linking")}),n==="success"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-[4px] border border-green-500/30 bg-green-500/10 px-3 py-2 text-xs text-green-400",children:r("bind.success")}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:r("bind.success_detail").replace("{platform}",m)}),e.jsx("button",{onClick:()=>i("/home"),className:"rounded-[4px] bg-[var(--accent)] px-3 py-2 text-xs text-black hover:opacity-90 transition-opacity",children:r("bind.back_to_home")})]}),n==="error"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400 break-words",children:b||r("bind.invalid_token")}),e.jsx("button",{onClick:()=>i("/home"),className:"rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("bind.back_to_home")})]})]})})}export{j as default};
@@ -1,4 +1,4 @@
1
- import{c as K,a as E,r as s,j as e,X as $,g,s as z,t as q}from"./index-vL7aQJNr.js";import{S as A}from"./Select-BnV8yZlD.js";import{T as D}from"./trash-2-A2FsT1yG.js";import{P as M}from"./plus-Bnd1Vz2Y.js";import{E as O}from"./EmptyState-D3foEiul.js";import{T}from"./Skeleton-DUgWc2LJ.js";import{u as B}from"./useFetch-vGZMAvGi.js";import{d as P}from"./status-colors-BPEUp90-.js";import{B as R}from"./bot-DPaziJPf.js";import{P as U}from"./pencil-B6spIBcw.js";/**
1
+ import{c as K,a as E,r as s,j as e,X as $,g,s as z,t as q}from"./index-CqnL6hX8.js";import{S as A}from"./Select-CdRjIJm4.js";import{T as D}from"./trash-2-BJ5q4Wkp.js";import{P as M}from"./plus-CypZlZSj.js";import{E as O}from"./EmptyState-BQqxSE6p.js";import{T}from"./Skeleton-CEc5RMQi.js";import{u as B}from"./useFetch-CJla7_79.js";import{d as P}from"./status-colors-BXL4VDNh.js";import{B as R}from"./bot-BKKWb03w.js";import{P as U}from"./pencil-zZY9INFY.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{e as l,a as n,n as p,r as d,j as e,C as m}from"./index-vL7aQJNr.js";import{Q as x}from"./QuickAuth-Dr0Q50ld.js";import{P as u}from"./plus-Bnd1Vz2Y.js";import{C as v}from"./copy-BUH7P2Hf.js";const g=[{command:"ov setup",description:"quick setup — configure server connection and authenticate in one step",usage:"ov setup [--server <url>] [--token <token>]",flags:[{flag:"--server <url>",desc:"overlord server url"},{flag:"--token <token>",desc:"personal access token (skips prompt)"}],example:`ov setup
1
+ import{e as l,a as n,n as p,r as d,j as e,C as m}from"./index-CqnL6hX8.js";import{Q as x}from"./QuickAuth-dOCzSE_V.js";import{P as u}from"./plus-CypZlZSj.js";import{C as v}from"./copy-Ca3klMOV.js";const g=[{command:"ov setup",description:"quick setup — configure server connection and authenticate in one step",usage:"ov setup [--server <url>] [--token <token>]",flags:[{flag:"--server <url>",desc:"overlord server url"},{flag:"--token <token>",desc:"personal access token (skips prompt)"}],example:`ov setup
2
2
  > Overlord server URL: http://localhost:9000
3
3
  > Personal Access Token: ov_pat_xxxxx
4
4
  ✓ Connected to http://localhost:9000
@@ -1,4 +1,4 @@
1
- import{c as I,D as C,a as D,r as l,j as e,X as R,g as E,u as z,o as V,F as k}from"./index-vL7aQJNr.js";import{S as O}from"./Select-BnV8yZlD.js";import{v as q}from"./password-CHk45-jw.js";import{E as $}from"./EmptyState-D3foEiul.js";import{T as G}from"./Skeleton-DUgWc2LJ.js";import{u as H}from"./useFetch-vGZMAvGi.js";import{c as L}from"./status-colors-BPEUp90-.js";import{P as B}from"./plus-Bnd1Vz2Y.js";import{U as J}from"./users-CEdRS_A3.js";import{P as K}from"./pencil-B6spIBcw.js";import{R as Q}from"./rotate-ccw-CgcLAXNR.js";/**
1
+ import{c as I,D as C,a as D,r as l,j as e,X as R,g as E,u as z,o as V,F as k}from"./index-CqnL6hX8.js";import{S as O}from"./Select-CdRjIJm4.js";import{v as q}from"./password-CHk45-jw.js";import{E as $}from"./EmptyState-BQqxSE6p.js";import{T as G}from"./Skeleton-CEc5RMQi.js";import{u as H}from"./useFetch-CJla7_79.js";import{c as L}from"./status-colors-BXL4VDNh.js";import{P as B}from"./plus-CypZlZSj.js";import{U as J}from"./users-DBFmGr_S.js";import{P as K}from"./pencil-zZY9INFY.js";import{R as Q}from"./rotate-ccw-CV1EIcxQ.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,2 +1,2 @@
1
- import{v as ne,e as le,a as ce,r as a,G as u,A as d,g as m,j as e,L as de,P as W,t as f}from"./index-vL7aQJNr.js";import{S as X}from"./Select-BnV8yZlD.js";import{U as pe,A as ie,R as xe}from"./RemoveMemberConfirmDialog-BCrue0AP.js";import{P as ue}from"./plus-Bnd1Vz2Y.js";function he(){const{key:n}=ne(),l=le(),{t:r}=ce(),[o,Q]=a.useState(null),[b,V]=a.useState([]),[Y,Z]=a.useState(!0),[N,v]=a.useState(!1),[j,C]=a.useState(""),[h,w]=a.useState(""),[_,S]=a.useState(""),[k,I]=a.useState(u.GITHUB),[M,T]=a.useState(""),[A,P]=a.useState(d.CLAUDE),[R,U]=a.useState(""),[O,E]=a.useState("50"),[D,$]=a.useState(""),[L,B]=a.useState(""),[G,F]=a.useState(""),[J,q]=a.useState("0"),[p,g]=a.useState(""),[ee,z]=a.useState(!1),[c,y]=a.useState(null),[te,H]=a.useState(!1),i=a.useCallback(async()=>{if(n)try{const[t,x]=await Promise.all([m.get(`web/projects/${n}`).json(),m.get(`web/projects/${n}/members`).json().catch(()=>[])]);if(Q(t),V(x),C(t.name),w(t.repoUrl),S(t.sshUrl??""),I(t.gitPlatform),T(t.defaultBranch),P(t.agentType),U(t.agentCommand??""),E(String(t.maxTurns)),$(t.workspaceRoot??""),B(t.setupCommands??""),F(t.testCommand??""),q(String(t.ptyOutputFilter??0)),t.pipeline)try{g(JSON.stringify(JSON.parse(t.pipeline),null,2))}catch{g(t.pipeline)}}catch{}finally{Z(!1)}},[n]);a.useEffect(()=>{i()},[i]);async function re(t){if(t.preventDefault(),!o)return;v(!0);let x=null;if(p.trim())try{JSON.parse(p),x=p.trim()}catch{f.error(r("projects.invalid_pipeline_json")),v(!1);return}try{await m.put(`web/projects/${o.key}`,{json:{name:j,repoUrl:h,sshUrl:_||null,defaultBranch:M,gitPlatform:k,agentType:A,agentCommand:R||null,maxTurns:parseInt(O,10)||50,workspaceRoot:D||null,setupCommands:L||null,testCommand:G||null,ptyOutputFilter:parseInt(J,10)||0,pipeline:x}}),f.success(r("projects.project_saved")),l(`/projects/${o.key}`)}catch(K){const oe=K instanceof Error?K.message:r("projects.failed_to_save_project");f.error(oe)}finally{v(!1)}}function ae(){l(`/projects/${n}`)}async function se(){if(!(!o||!c)){H(!0);try{await m.delete(`web/projects/${o.key}/members`,{searchParams:{developerId:String(c.developerId)}}),await i()}catch{}finally{H(!1),y(null)}}}return Y?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):o?e.jsxs("form",{onSubmit:re,className:"mx-auto max-w-6xl px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l(`/projects/${o.key}`),children:o.key})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r("common.edit")})]}),e.jsx("h1",{className:"text-lg font-bold text-[var(--text-primary)] mb-4",children:r("projects.edit_project_title")}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_400px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.basic_info")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.key"),children:e.jsx("input",{type:"text",value:o.key,readOnly:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-muted)] outline-none opacity-60 cursor-not-allowed"})}),e.jsx(s,{label:r("projects.name"),children:e.jsx("input",{type:"text",value:j,onChange:t=>C(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.repo_url"),children:e.jsx("input",{type:"text",value:h,onChange:t=>w(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsxs(s,{label:r("projects.ssh_url"),children:[e.jsx("input",{type:"text",value:_,onChange:t=>S(t.target.value),placeholder:r("projects.ssh_url_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:r("projects.ssh_url_hint")})]}),e.jsx(s,{label:r("projects.git_platform"),children:e.jsx(X,{value:k,onChange:t=>I(t),options:[{value:u.GITHUB,label:r("projects.github")},{value:u.GITLAB,label:r("projects.gitlab")},{value:u.GITEA,label:r("projects.gitea")}]})}),e.jsx(s,{label:r("projects.default_branch"),children:e.jsx("input",{type:"text",value:M,onChange:t=>T(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.agent_config")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.agent_type"),children:e.jsx(X,{value:A,onChange:t=>P(t),options:[{value:d.CLAUDE,label:r("projects.claude")},{value:d.CURSOR,label:r("projects.cursor")},{value:d.CODEX,label:r("projects.codex")},{value:d.CUSTOM,label:r("projects.custom")}]})}),e.jsx(s,{label:r("projects.agent_command"),children:e.jsx("input",{type:"text",value:R,onChange:t=>U(t.target.value),placeholder:"custom agent command",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.max_turns"),children:e.jsx("input",{type:"number",value:O,onChange:t=>E(t.target.value),min:1,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.workspace_root"),children:e.jsx("input",{type:"text",value:D,onChange:t=>$(t.target.value),placeholder:"/path/to/workspace",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.environment")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.setup_commands"),children:e.jsx("textarea",{value:L,onChange:t=>B(t.target.value),rows:3,placeholder:`npm install
1
+ import{v as ne,e as le,a as ce,r as a,G as u,A as d,g as m,j as e,L as de,P as W,t as f}from"./index-CqnL6hX8.js";import{S as X}from"./Select-CdRjIJm4.js";import{U as pe,A as ie,R as xe}from"./RemoveMemberConfirmDialog-D-rvX20k.js";import{P as ue}from"./plus-CypZlZSj.js";function he(){const{key:n}=ne(),l=le(),{t:r}=ce(),[o,Q]=a.useState(null),[b,V]=a.useState([]),[Y,Z]=a.useState(!0),[N,v]=a.useState(!1),[j,C]=a.useState(""),[h,w]=a.useState(""),[_,S]=a.useState(""),[k,I]=a.useState(u.GITHUB),[M,T]=a.useState(""),[A,P]=a.useState(d.CLAUDE),[R,U]=a.useState(""),[O,E]=a.useState("50"),[D,$]=a.useState(""),[L,B]=a.useState(""),[G,F]=a.useState(""),[J,q]=a.useState("0"),[p,g]=a.useState(""),[ee,z]=a.useState(!1),[c,y]=a.useState(null),[te,H]=a.useState(!1),i=a.useCallback(async()=>{if(n)try{const[t,x]=await Promise.all([m.get(`web/projects/${n}`).json(),m.get(`web/projects/${n}/members`).json().catch(()=>[])]);if(Q(t),V(x),C(t.name),w(t.repoUrl),S(t.sshUrl??""),I(t.gitPlatform),T(t.defaultBranch),P(t.agentType),U(t.agentCommand??""),E(String(t.maxTurns)),$(t.workspaceRoot??""),B(t.setupCommands??""),F(t.testCommand??""),q(String(t.ptyOutputFilter??0)),t.pipeline)try{g(JSON.stringify(JSON.parse(t.pipeline),null,2))}catch{g(t.pipeline)}}catch{}finally{Z(!1)}},[n]);a.useEffect(()=>{i()},[i]);async function re(t){if(t.preventDefault(),!o)return;v(!0);let x=null;if(p.trim())try{JSON.parse(p),x=p.trim()}catch{f.error(r("projects.invalid_pipeline_json")),v(!1);return}try{await m.put(`web/projects/${o.key}`,{json:{name:j,repoUrl:h,sshUrl:_||null,defaultBranch:M,gitPlatform:k,agentType:A,agentCommand:R||null,maxTurns:parseInt(O,10)||50,workspaceRoot:D||null,setupCommands:L||null,testCommand:G||null,ptyOutputFilter:parseInt(J,10)||0,pipeline:x}}),f.success(r("projects.project_saved")),l(`/projects/${o.key}`)}catch(K){const oe=K instanceof Error?K.message:r("projects.failed_to_save_project");f.error(oe)}finally{v(!1)}}function ae(){l(`/projects/${n}`)}async function se(){if(!(!o||!c)){H(!0);try{await m.delete(`web/projects/${o.key}/members`,{searchParams:{developerId:String(c.developerId)}}),await i()}catch{}finally{H(!1),y(null)}}}return Y?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):o?e.jsxs("form",{onSubmit:re,className:"mx-auto max-w-6xl px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l(`/projects/${o.key}`),children:o.key})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r("common.edit")})]}),e.jsx("h1",{className:"text-lg font-bold text-[var(--text-primary)] mb-4",children:r("projects.edit_project_title")}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_400px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.basic_info")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.key"),children:e.jsx("input",{type:"text",value:o.key,readOnly:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-muted)] outline-none opacity-60 cursor-not-allowed"})}),e.jsx(s,{label:r("projects.name"),children:e.jsx("input",{type:"text",value:j,onChange:t=>C(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.repo_url"),children:e.jsx("input",{type:"text",value:h,onChange:t=>w(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsxs(s,{label:r("projects.ssh_url"),children:[e.jsx("input",{type:"text",value:_,onChange:t=>S(t.target.value),placeholder:r("projects.ssh_url_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:r("projects.ssh_url_hint")})]}),e.jsx(s,{label:r("projects.git_platform"),children:e.jsx(X,{value:k,onChange:t=>I(t),options:[{value:u.GITHUB,label:r("projects.github")},{value:u.GITLAB,label:r("projects.gitlab")},{value:u.GITEA,label:r("projects.gitea")}]})}),e.jsx(s,{label:r("projects.default_branch"),children:e.jsx("input",{type:"text",value:M,onChange:t=>T(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.agent_config")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.agent_type"),children:e.jsx(X,{value:A,onChange:t=>P(t),options:[{value:d.CLAUDE,label:r("projects.claude")},{value:d.CURSOR,label:r("projects.cursor")},{value:d.CODEX,label:r("projects.codex")},{value:d.CUSTOM,label:r("projects.custom")}]})}),e.jsx(s,{label:r("projects.agent_command"),children:e.jsx("input",{type:"text",value:R,onChange:t=>U(t.target.value),placeholder:"custom agent command",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.max_turns"),children:e.jsx("input",{type:"number",value:O,onChange:t=>E(t.target.value),min:1,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.workspace_root"),children:e.jsx("input",{type:"text",value:D,onChange:t=>$(t.target.value),placeholder:"/path/to/workspace",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.environment")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.setup_commands"),children:e.jsx("textarea",{value:L,onChange:t=>B(t.target.value),rows:3,placeholder:`npm install
2
2
  npm run build`,className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.post_command"),children:e.jsx("input",{type:"text",value:G,onChange:t=>F(t.target.value),placeholder:"npm test",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.security")}),e.jsx("div",{className:"space-y-3",children:e.jsx(s,{label:r("projects.pty_output_filter"),children:e.jsx("input",{type:"text",value:J,onChange:t=>q(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.pipeline_section")}),e.jsx(de,{to:"/projects/"+n+"/pipeline",className:"text-xs text-[var(--accent)] hover:underline",children:r("projects.edit_pipeline")})]}),e.jsx("textarea",{value:p,onChange:t=>g(t.target.value),rows:20,spellCheck:!1,placeholder:'{"stages": []}',className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]",style:{fontFamily:'"JetBrains Mono", monospace',textTransform:"none"}})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),e.jsxs("button",{type:"button",onClick:()=>z(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_members_yet")})]}):e.jsx("div",{className:"space-y-2",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-[var(--accent)]/20 text-xs font-bold text-[var(--accent)]",children:(t.developerName??String(t.developerId)).charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"ml-2 rounded-[4px] px-1.5 py-0.5 text-[11px] font-medium",style:{color:t.role===W.MAINTAINER?"var(--warning)":"var(--text-secondary)",background:t.role===W.MAINTAINER?"rgba(245,158,11,0.1)":"rgba(163,163,163,0.1)"},children:t.role})]})]}),e.jsx("button",{type:"button",onClick:()=>y(t),className:"text-[var(--destructive)] hover:opacity-70 transition-opacity","aria-label":r("projects.remove_member"),children:e.jsx(pe,{className:"h-3.5 w-3.5"})})]},t.developerId))})]})]})]}),e.jsxs("div",{className:"mt-8 flex items-center justify-end gap-3 border-t border-[var(--border)] pt-6",children:[e.jsx("button",{type:"button",onClick:ae,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("common.discard")}),e.jsx("button",{type:"submit",disabled:N||!j||!h,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:r(N?"common.saving":"projects.save_changes")})]}),e.jsx(ie,{isOpen:ee,onClose:()=>z(!1),projectKey:o.key,existingMemberIds:b.map(t=>t.developerId),onAdded:i}),e.jsx(xe,{isOpen:!!c,onClose:()=>y(null),onConfirm:se,memberName:c?c.developerName??`#${c.developerId}`:"",loading:te})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("projects.project_not_found")}),e.jsx("button",{onClick:()=>l("/projects"),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("projects.back_to_projects")})]})}function s({label:n,children:l}){return e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-3",children:[e.jsx("label",{className:"sm:w-36 shrink-0 sm:pt-2 text-xs text-[var(--text-muted)]",children:n}),e.jsx("div",{className:"flex-1",children:l})]})}export{he as default};
@@ -1,4 +1,4 @@
1
- import{c as o,j as e}from"./index-vL7aQJNr.js";/**
1
+ import{c as o,j as e}from"./index-CqnL6hX8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{e as W,a as A,h as $,i as w,r as S,j as e,L as b,W as v,g as x}from"./index-vL7aQJNr.js";import{T as L}from"./TaskStatusBadge-DuOoGIwE.js";import{T as u}from"./Skeleton-DUgWc2LJ.js";import{O as B}from"./OnboardingGuide-D8RyPcEd.js";import{f as j}from"./date-BdNtiQTP.js";import{t as D}from"./string-B39tzdVK.js";import{g as F}from"./status-colors-BPEUp90-.js";import{u as o}from"./useFetch-vGZMAvGi.js";import{A as g}from"./arrow-right-MDrzFe3K.js";import"./chevron-right-CqyufMDW.js";const M=3e5,O=[{key:"active_tasks",labelKey:"dashboard.active_tasks"},{key:"queued_tasks",labelKey:"dashboard.queued_tasks"},{key:"online_workers",labelKey:"dashboard.online_workers"},{key:"completed_today",labelKey:"dashboard.completed_today"}],P=["mon","tue","wed","thu","fri","sat","sun"];function G({dailyRates:l,overallRate:t}){const{t:m}=A(),n=P.map((r,c)=>({label:r,value:l[c]??0})),i=Math.max(...n.map(r=>r.value),1);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[t,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:m("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:n.map(r=>{const c=i>0?Math.max(r.value/i*100,4):4;return e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"relative w-full h-full rounded-[4px]",style:{backgroundColor:"rgba(34,197,94,0.1)"},children:e.jsx("div",{className:"absolute bottom-0 left-0 right-0 rounded-[4px]",style:{height:`${c}%`,backgroundColor:r.value>=80?"var(--accent)":r.value>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:r.label})]},r.label)})})]})}function se(){const l=W(),{t}=A(),m=$(),n=w(s=>s.taskSeq),i=w(s=>s.workerSeq),[r,c]=S.useState(0),{data:a,loading:f}=o(()=>x.get("web/dashboard/stats").json(),[r,n,i]),{data:T,loading:R}=o(()=>x.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json(),[r,n]),{data:C,loading:I}=o(()=>x.get("web/workers").json(),[r,i]),{data:E,loading:q}=o(()=>x.get("web/dashboard/recent-activity").json(),[]);S.useEffect(()=>{const s=setInterval(()=>{c(d=>d+1)},M);return()=>clearInterval(s)},[]);const N=(a==null?void 0:a.success_rate_daily)??null,y=(a==null?void 0:a.task_success_rate_7d)??0,k=T??[],h=C??[],_=E??[];function K(s){switch(s){case v.ONLINE:return t("dashboard.online");case v.DRAINING:return t("dashboard.idle");case v.OFFLINE:default:return t("dashboard.offline")}}return e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-4 md:px-6 md:py-8 font-mono",children:[e.jsx("div",{className:"mb-4 md:hidden",children:e.jsxs("span",{className:"text-base font-bold text-[var(--accent)]",children:["// ",t("dashboard.title")]})}),e.jsx("div",{className:"mb-6 md:mb-8 grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:O.map(({key:s,labelKey:d})=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-4",children:[e.jsxs("span",{className:"text-[11px] md:text-xs text-[var(--text-muted)]",children:[t(d),":"]}),f?e.jsx("div",{className:"mt-1 h-6 md:h-8 w-12 md:w-16 animate-pulse rounded-[4px] bg-[var(--bg-input)]"}):e.jsx("div",{className:"mt-1 flex items-baseline gap-2",children:e.jsx("span",{className:"text-2xl md:text-3xl font-bold text-[var(--text-primary)]",children:(a==null?void 0:a[s])??0})})]},s))}),e.jsx(B,{data:{activeTasks:((a==null?void 0:a.active_tasks)??0)+((a==null?void 0:a.queued_tasks)??0),totalWorkers:h.length,totalProjects:(a==null?void 0:a.project_count)??0,totalDevelopers:(a==null?void 0:a.developer_count)??0}}),e.jsxs("div",{className:"mb-6 grid gap-6 lg:grid-cols-3 items-stretch",children:[e.jsx("div",{className:"flex flex-col gap-6 lg:col-span-2",children:e.jsxs("div",{className:"flex flex-1 flex-col rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("div",{className:"border-b border-[var(--border)] px-5 py-3",children:e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("dashboard.task_success_rate")})}),e.jsx("div",{className:"flex flex-1 flex-col justify-center p-5",children:f?e.jsx("div",{className:"h-24 animate-pulse rounded-[4px] bg-[var(--bg-input)]"}):N?e.jsx(G,{dailyRates:N,overallRate:y}):e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[y,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("dashboard.daily_breakdown_not_available")})]})})]})}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] md:border",children:[e.jsxs("div",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("dashboard.recent_tasks")}),e.jsxs(b,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[t("common.view_all")," ",e.jsx(g,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"flex md:hidden items-center justify-between px-3 py-3",children:e.jsx("h2",{className:"text-xs font-bold text-[var(--accent)]",children:t("dashboard.recent_tasks")})}),e.jsx("div",{className:"px-3 pb-3 md:px-5 md:pb-4 md:pt-0",children:R?e.jsx(u,{rows:4}):k.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("dashboard.no_tasks_yet")})]}):e.jsx("div",{className:"flex flex-col gap-2 md:gap-0",children:k.map(s=>e.jsxs("div",{onClick:()=>l(`/tasks/${s.id}`),className:"flex cursor-pointer items-center gap-3 rounded-[4px] border border-[var(--border)] p-3 transition-colors hover:bg-[var(--bg-input)] md:rounded-none md:border-0 md:border-b md:border-[var(--border-row)] md:p-0 md:py-2.5 last:md:border-b-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 md:hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",s.id," ",s.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(L,{status:s.status})})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:j(s.createdAt)})]}),e.jsxs("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:["#",s.id]}),e.jsx("span",{className:"hidden md:inline flex-1 text-xs text-[var(--text-primary)] truncate",children:D(s.description,40)}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(L,{status:s.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:j(s.createdAt)})]},s.id))})})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("dashboard.worker_status")}),e.jsxs(b,{to:"/workers",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[t("common.view_all")," ",e.jsx(g,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:I?e.jsx(u,{rows:3}):h.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("dashboard.no_workers_registered")})]}):e.jsx("div",{className:"flex flex-col",children:h.map(s=>e.jsxs("div",{onClick:()=>l(`/workers/${s.id}`),className:"flex cursor-pointer items-center justify-between border-b border-[var(--border-row)] py-2.5 transition-colors hover:bg-[var(--bg-input)] last:border-b-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s.host??"--"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:[s.activeSlots,"/",s.maxSlots," ",t("dashboard.slots")]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs",style:{color:F(s.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),K(s.status)]})]})]},s.id))})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("dashboard.recent_activity")}),m&&e.jsxs(b,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[t("common.view_all")," ",e.jsx(g,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:q?e.jsx(u,{rows:4}):_.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("dashboard.no_recent_activity")})]}):e.jsx("div",{className:"flex flex-col",children:_.map(s=>{const d=s.message.match(/task\s*#?(\d+)/i),p=d?d[1]:null;return e.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border-row)] py-2 last:border-b-0 ${p?"cursor-pointer hover:bg-[var(--bg-input)] transition-colors":""}`,onClick:()=>p&&l(`/tasks/${p}`),children:[e.jsx("span",{className:"shrink-0 text-xs text-[var(--text-muted)]",children:j(s.timestamp)}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:s.message})]},s.id)})})})]})]})]})}export{se as default};
1
+ import{e as W,a as A,h as $,i as w,r as S,j as e,L as b,W as v,g as x}from"./index-CqnL6hX8.js";import{T as L}from"./TaskStatusBadge-xZ7FBWZw.js";import{T as u}from"./Skeleton-CEc5RMQi.js";import{O as B}from"./OnboardingGuide-BgPC4aiz.js";import{f as j}from"./date-BdNtiQTP.js";import{t as D}from"./string-B39tzdVK.js";import{g as F}from"./status-colors-BXL4VDNh.js";import{u as o}from"./useFetch-CJla7_79.js";import{A as g}from"./arrow-right-CTOYnmu3.js";import"./chevron-right-CKEZOJqX.js";const M=3e5,O=[{key:"active_tasks",labelKey:"dashboard.active_tasks"},{key:"queued_tasks",labelKey:"dashboard.queued_tasks"},{key:"online_workers",labelKey:"dashboard.online_workers"},{key:"completed_today",labelKey:"dashboard.completed_today"}],P=["mon","tue","wed","thu","fri","sat","sun"];function G({dailyRates:l,overallRate:t}){const{t:m}=A(),n=P.map((r,c)=>({label:r,value:l[c]??0})),i=Math.max(...n.map(r=>r.value),1);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[t,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:m("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:n.map(r=>{const c=i>0?Math.max(r.value/i*100,4):4;return e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"relative w-full h-full rounded-[4px]",style:{backgroundColor:"rgba(34,197,94,0.1)"},children:e.jsx("div",{className:"absolute bottom-0 left-0 right-0 rounded-[4px]",style:{height:`${c}%`,backgroundColor:r.value>=80?"var(--accent)":r.value>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:r.label})]},r.label)})})]})}function se(){const l=W(),{t}=A(),m=$(),n=w(s=>s.taskSeq),i=w(s=>s.workerSeq),[r,c]=S.useState(0),{data:a,loading:f}=o(()=>x.get("web/dashboard/stats").json(),[r,n,i]),{data:T,loading:R}=o(()=>x.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json(),[r,n]),{data:C,loading:I}=o(()=>x.get("web/workers").json(),[r,i]),{data:E,loading:q}=o(()=>x.get("web/dashboard/recent-activity").json(),[]);S.useEffect(()=>{const s=setInterval(()=>{c(d=>d+1)},M);return()=>clearInterval(s)},[]);const N=(a==null?void 0:a.success_rate_daily)??null,y=(a==null?void 0:a.task_success_rate_7d)??0,k=T??[],h=C??[],_=E??[];function K(s){switch(s){case v.ONLINE:return t("dashboard.online");case v.DRAINING:return t("dashboard.idle");case v.OFFLINE:default:return t("dashboard.offline")}}return e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-4 md:px-6 md:py-8 font-mono",children:[e.jsx("div",{className:"mb-4 md:hidden",children:e.jsxs("span",{className:"text-base font-bold text-[var(--accent)]",children:["// ",t("dashboard.title")]})}),e.jsx("div",{className:"mb-6 md:mb-8 grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:O.map(({key:s,labelKey:d})=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-4",children:[e.jsxs("span",{className:"text-[11px] md:text-xs text-[var(--text-muted)]",children:[t(d),":"]}),f?e.jsx("div",{className:"mt-1 h-6 md:h-8 w-12 md:w-16 animate-pulse rounded-[4px] bg-[var(--bg-input)]"}):e.jsx("div",{className:"mt-1 flex items-baseline gap-2",children:e.jsx("span",{className:"text-2xl md:text-3xl font-bold text-[var(--text-primary)]",children:(a==null?void 0:a[s])??0})})]},s))}),e.jsx(B,{data:{activeTasks:((a==null?void 0:a.active_tasks)??0)+((a==null?void 0:a.queued_tasks)??0),totalWorkers:h.length,totalProjects:(a==null?void 0:a.project_count)??0,totalDevelopers:(a==null?void 0:a.developer_count)??0}}),e.jsxs("div",{className:"mb-6 grid gap-6 lg:grid-cols-3 items-stretch",children:[e.jsx("div",{className:"flex flex-col gap-6 lg:col-span-2",children:e.jsxs("div",{className:"flex flex-1 flex-col rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("div",{className:"border-b border-[var(--border)] px-5 py-3",children:e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("dashboard.task_success_rate")})}),e.jsx("div",{className:"flex flex-1 flex-col justify-center p-5",children:f?e.jsx("div",{className:"h-24 animate-pulse rounded-[4px] bg-[var(--bg-input)]"}):N?e.jsx(G,{dailyRates:N,overallRate:y}):e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[y,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("dashboard.daily_breakdown_not_available")})]})})]})}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] md:border",children:[e.jsxs("div",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("dashboard.recent_tasks")}),e.jsxs(b,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[t("common.view_all")," ",e.jsx(g,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"flex md:hidden items-center justify-between px-3 py-3",children:e.jsx("h2",{className:"text-xs font-bold text-[var(--accent)]",children:t("dashboard.recent_tasks")})}),e.jsx("div",{className:"px-3 pb-3 md:px-5 md:pb-4 md:pt-0",children:R?e.jsx(u,{rows:4}):k.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("dashboard.no_tasks_yet")})]}):e.jsx("div",{className:"flex flex-col gap-2 md:gap-0",children:k.map(s=>e.jsxs("div",{onClick:()=>l(`/tasks/${s.id}`),className:"flex cursor-pointer items-center gap-3 rounded-[4px] border border-[var(--border)] p-3 transition-colors hover:bg-[var(--bg-input)] md:rounded-none md:border-0 md:border-b md:border-[var(--border-row)] md:p-0 md:py-2.5 last:md:border-b-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 md:hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",s.id," ",s.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(L,{status:s.status})})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:j(s.createdAt)})]}),e.jsxs("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:["#",s.id]}),e.jsx("span",{className:"hidden md:inline flex-1 text-xs text-[var(--text-primary)] truncate",children:D(s.description,40)}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(L,{status:s.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:j(s.createdAt)})]},s.id))})})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("dashboard.worker_status")}),e.jsxs(b,{to:"/workers",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[t("common.view_all")," ",e.jsx(g,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:I?e.jsx(u,{rows:3}):h.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("dashboard.no_workers_registered")})]}):e.jsx("div",{className:"flex flex-col",children:h.map(s=>e.jsxs("div",{onClick:()=>l(`/workers/${s.id}`),className:"flex cursor-pointer items-center justify-between border-b border-[var(--border-row)] py-2.5 transition-colors hover:bg-[var(--bg-input)] last:border-b-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s.host??"--"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:[s.activeSlots,"/",s.maxSlots," ",t("dashboard.slots")]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs",style:{color:F(s.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),K(s.status)]})]})]},s.id))})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:t("dashboard.recent_activity")}),m&&e.jsxs(b,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[t("common.view_all")," ",e.jsx(g,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:q?e.jsx(u,{rows:4}):_.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("dashboard.no_recent_activity")})]}):e.jsx("div",{className:"flex flex-col",children:_.map(s=>{const d=s.message.match(/task\s*#?(\d+)/i),p=d?d[1]:null;return e.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border-row)] py-2 last:border-b-0 ${p?"cursor-pointer hover:bg-[var(--bg-input)] transition-colors":""}`,onClick:()=>p&&l(`/tasks/${p}`),children:[e.jsx("span",{className:"shrink-0 text-xs text-[var(--text-muted)]",children:j(s.timestamp)}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:s.message})]},s.id)})})})]})]})]})}export{se as default};
@@ -1 +1 @@
1
- import{j as e}from"./index-vL7aQJNr.js";function c({label:s,value:t,href:r,variant:a="between",labelWidth:n="w-20 md:w-28"}){return a==="fixed-label"?e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-0.5 sm:gap-3 py-1",children:[e.jsx("span",{className:`${n} shrink-0 text-xs text-[var(--text-muted)]`,children:s}),r?e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"truncate text-sm text-[var(--accent)] hover:underline",children:t}):e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:t})]}):e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:s}),e.jsx("span",{className:"truncate text-[var(--text-primary)]",children:t})]})}export{c as I};
1
+ import{j as e}from"./index-CqnL6hX8.js";function c({label:s,value:t,href:r,variant:a="between",labelWidth:n="w-20 md:w-28"}){return a==="fixed-label"?e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-0.5 sm:gap-3 py-1",children:[e.jsx("span",{className:`${n} shrink-0 text-xs text-[var(--text-muted)]`,children:s}),r?e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"truncate text-sm text-[var(--accent)] hover:underline",children:t}):e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:t})]}):e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:s}),e.jsx("span",{className:"truncate text-[var(--text-primary)]",children:t})]})}export{c as I};
@@ -1,4 +1,4 @@
1
- import{c as r,u,a as b,r as x,j as e,T as _,L as l,S as f,b as y,d as j,C as N}from"./index-vL7aQJNr.js";import{A as m}from"./arrow-right-MDrzFe3K.js";import{Z as w}from"./zap-DXw1NrWz.js";import{B as k}from"./bot-DPaziJPf.js";import{U as K}from"./users-CEdRS_A3.js";import{C as z}from"./copy-BUH7P2Hf.js";/**
1
+ import{c as r,u,a as b,r as x,j as e,T as _,L as l,S as f,b as y,d as j,C as N}from"./index-CqnL6hX8.js";import{A as m}from"./arrow-right-CTOYnmu3.js";import{Z as w}from"./zap-CDX3UpIX.js";import{B as k}from"./bot-BKKWb03w.js";import{U as K}from"./users-DBFmGr_S.js";import{C as z}from"./copy-Ca3klMOV.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{e as E,f as I,u as g,a as W,r as m,j as t,N as B}from"./index-vL7aQJNr.js";function v(i){const a=i==null?void 0:i.from,s=a==null?void 0:a.pathname;return!s||s==="/totp-setup"||s==="/login"?"/home":`${s}${(a==null?void 0:a.search)??""}`}function q(i,a,s){const p=i==null?void 0:i.from;return p?{from:p}:{from:{pathname:a,search:s}}}function A(){const i=E(),a=I(),s=g(e=>e.login),p=g(e=>e.requireTotpSetup),_=g(e=>e.user),{t:n}=W(),[C,S]=m.useState("credentials"),[f,k]=m.useState(""),[h,F]=m.useState(""),[l,x]=m.useState(""),[d,y]=m.useState(!1),[j,c]=m.useState(""),b=m.useRef([]);if(_&&!p)return t.jsx(B,{to:v(a.state),replace:!0});if(p){const e=q(a.state,a.pathname,a.search);return e.from.pathname==="/bind"&&sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(e.from)),t.jsx(B,{to:"/totp-setup",state:e,replace:!0})}async function z(e){if(e.preventDefault(),c(""),!f.trim()||!h.trim()){c(n("auth.username_and_password_required"));return}y(!0);try{await s({username:f.trim(),password:h});const r=g.getState();if(r.requireTotpSetup)return;r.user&&i(v(a.state),{replace:!0})}catch(r){const o=r instanceof Error?r.message:n("auth.login_failed");o==="TOTP_REQUIRED"?(S("totp"),c("")):c(o)}finally{y(!1)}}async function M(e){if(e.preventDefault(),c(""),!l.trim()||l.trim().length!==6){c(n("auth.please_enter_valid_6_digit_code"));return}y(!0);try{await s({username:f.trim(),password:h,totpCode:l.trim()}),g.getState().user&&i(v(a.state),{replace:!0})}catch(r){const o=r instanceof Error?r.message:n("auth.invalid_totp_code");c(o)}finally{y(!1)}}function J(){S("credentials"),x(""),c("")}function R(e,r){var w;const o=r.replace(/\D/g,"").slice(-1),u=l.split("");for(;u.length<6;)u.push("");u[e]=o,x(u.join("")),o&&e<5&&((w=b.current[e+1])==null||w.focus())}function T(e,r){var o;r.key==="Backspace"&&!l[e]&&e>0&&((o=b.current[e-1])==null||o.focus())}function D(e){var u;e.preventDefault();const r=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);x(r);const o=Math.min(r.length,5);(u=b.current[o])==null||u.focus()}return t.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--bg-primary)",padding:"1rem",fontFamily:"'JetBrains Mono', monospace"},children:t.jsxs("div",{style:{width:"100%",maxWidth:"400px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"2rem"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.625rem",marginBottom:"0.25rem"},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",borderRadius:"4px",backgroundColor:"var(--accent)",fontFamily:"'JetBrains Mono', monospace"},"aria-hidden":!0,children:t.jsx("span",{style:{fontSize:"1.25rem",fontWeight:600,color:"#0C0C0C"},children:"~"})}),t.jsx("span",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:n("landing.overlord")})]}),t.jsx("div",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"0.75rem",marginBottom:"2rem",fontFamily:"'JetBrains Mono', monospace"},children:n(C==="credentials"?"auth.ai_powered_development_system":"auth.two_factor_verification")}),j&&t.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",overflowWrap:"break-word",wordBreak:"break-word"},children:j}),C==="credentials"?t.jsxs("form",{onSubmit:z,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.username")}),t.jsx("input",{type:"text",placeholder:n("auth.enter_username"),value:f,onChange:e=>k(e.target.value),autoFocus:!0,autoComplete:"username",required:!0,style:{width:"100%",padding:"0.625rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},onFocus:e=>e.target.style.borderColor="var(--accent)",onBlur:e=>e.target.style.borderColor="var(--border)"})]}),t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.password")}),t.jsx("input",{type:"password",placeholder:n("auth.enter_password"),value:h,onChange:e=>F(e.target.value),autoComplete:"current-password",required:!0,style:{width:"100%",padding:"0.625rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},onFocus:e=>e.target.style.borderColor="var(--accent)",onBlur:e=>e.target.style.borderColor="var(--border)"})]}),t.jsx("button",{type:"submit",disabled:d,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:d?"not-allowed":"pointer",opacity:d?.7:1,marginTop:"0.5rem"},children:n(d?"common.signing_in":"auth.sign_in")}),t.jsx("button",{type:"button",onClick:()=>i("/"),style:{width:"100%",padding:"0.5rem",backgroundColor:"transparent",border:"none",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:n("common.back")})]},"credentials"):t.jsxs("form",{onSubmit:M,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.5rem",fontFamily:"'JetBrains Mono', monospace",textAlign:"center"},children:n("auth.enter_totp_code")}),t.jsx("div",{style:{display:"flex",gap:"0.5rem",justifyContent:"center"},onPaste:D,children:Array.from({length:6}).map((e,r)=>t.jsx("input",{ref:o=>{b.current[r]=o},type:"text",inputMode:"numeric",maxLength:1,value:l[r]||"",onChange:o=>R(r,o.target.value),onKeyDown:o=>T(r,o),autoFocus:r===0,autoComplete:r===0?"one-time-code":"off",style:{width:"2.75rem",height:"3rem",textAlign:"center",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"1.25rem",fontFamily:"'JetBrains Mono', monospace",fontWeight:600,outline:"none",boxSizing:"border-box"},onFocus:o=>o.target.style.borderColor="var(--accent)",onBlur:o=>o.target.style.borderColor="var(--border)"},r))})]}),t.jsx("button",{type:"submit",disabled:d||l.length!==6,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:d||l.length!==6?"not-allowed":"pointer",opacity:d||l.length!==6?.7:1,marginTop:"0.5rem"},children:n(d?"common.verifying":"auth.verify")}),t.jsx("button",{type:"button",onClick:J,style:{width:"100%",padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:n("common.back")})]},"totp")]})})}export{A as default};
1
+ import{e as E,f as I,u as g,a as W,r as m,j as t,N as B}from"./index-CqnL6hX8.js";function v(i){const a=i==null?void 0:i.from,s=a==null?void 0:a.pathname;return!s||s==="/totp-setup"||s==="/login"?"/home":`${s}${(a==null?void 0:a.search)??""}`}function q(i,a,s){const p=i==null?void 0:i.from;return p?{from:p}:{from:{pathname:a,search:s}}}function A(){const i=E(),a=I(),s=g(e=>e.login),p=g(e=>e.requireTotpSetup),_=g(e=>e.user),{t:n}=W(),[C,S]=m.useState("credentials"),[f,k]=m.useState(""),[h,F]=m.useState(""),[l,x]=m.useState(""),[d,y]=m.useState(!1),[j,c]=m.useState(""),b=m.useRef([]);if(_&&!p)return t.jsx(B,{to:v(a.state),replace:!0});if(p){const e=q(a.state,a.pathname,a.search);return e.from.pathname==="/bind"&&sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(e.from)),t.jsx(B,{to:"/totp-setup",state:e,replace:!0})}async function z(e){if(e.preventDefault(),c(""),!f.trim()||!h.trim()){c(n("auth.username_and_password_required"));return}y(!0);try{await s({username:f.trim(),password:h});const r=g.getState();if(r.requireTotpSetup)return;r.user&&i(v(a.state),{replace:!0})}catch(r){const o=r instanceof Error?r.message:n("auth.login_failed");o==="TOTP_REQUIRED"?(S("totp"),c("")):c(o)}finally{y(!1)}}async function M(e){if(e.preventDefault(),c(""),!l.trim()||l.trim().length!==6){c(n("auth.please_enter_valid_6_digit_code"));return}y(!0);try{await s({username:f.trim(),password:h,totpCode:l.trim()}),g.getState().user&&i(v(a.state),{replace:!0})}catch(r){const o=r instanceof Error?r.message:n("auth.invalid_totp_code");c(o)}finally{y(!1)}}function J(){S("credentials"),x(""),c("")}function R(e,r){var w;const o=r.replace(/\D/g,"").slice(-1),u=l.split("");for(;u.length<6;)u.push("");u[e]=o,x(u.join("")),o&&e<5&&((w=b.current[e+1])==null||w.focus())}function T(e,r){var o;r.key==="Backspace"&&!l[e]&&e>0&&((o=b.current[e-1])==null||o.focus())}function D(e){var u;e.preventDefault();const r=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);x(r);const o=Math.min(r.length,5);(u=b.current[o])==null||u.focus()}return t.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--bg-primary)",padding:"1rem",fontFamily:"'JetBrains Mono', monospace"},children:t.jsxs("div",{style:{width:"100%",maxWidth:"400px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"2rem"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.625rem",marginBottom:"0.25rem"},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",borderRadius:"4px",backgroundColor:"var(--accent)",fontFamily:"'JetBrains Mono', monospace"},"aria-hidden":!0,children:t.jsx("span",{style:{fontSize:"1.25rem",fontWeight:600,color:"#0C0C0C"},children:"~"})}),t.jsx("span",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:n("landing.overlord")})]}),t.jsx("div",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"0.75rem",marginBottom:"2rem",fontFamily:"'JetBrains Mono', monospace"},children:n(C==="credentials"?"auth.ai_powered_development_system":"auth.two_factor_verification")}),j&&t.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",overflowWrap:"break-word",wordBreak:"break-word"},children:j}),C==="credentials"?t.jsxs("form",{onSubmit:z,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.username")}),t.jsx("input",{type:"text",placeholder:n("auth.enter_username"),value:f,onChange:e=>k(e.target.value),autoFocus:!0,autoComplete:"username",required:!0,style:{width:"100%",padding:"0.625rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},onFocus:e=>e.target.style.borderColor="var(--accent)",onBlur:e=>e.target.style.borderColor="var(--border)"})]}),t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.password")}),t.jsx("input",{type:"password",placeholder:n("auth.enter_password"),value:h,onChange:e=>F(e.target.value),autoComplete:"current-password",required:!0,style:{width:"100%",padding:"0.625rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},onFocus:e=>e.target.style.borderColor="var(--accent)",onBlur:e=>e.target.style.borderColor="var(--border)"})]}),t.jsx("button",{type:"submit",disabled:d,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:d?"not-allowed":"pointer",opacity:d?.7:1,marginTop:"0.5rem"},children:n(d?"common.signing_in":"auth.sign_in")}),t.jsx("button",{type:"button",onClick:()=>i("/"),style:{width:"100%",padding:"0.5rem",backgroundColor:"transparent",border:"none",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:n("common.back")})]},"credentials"):t.jsxs("form",{onSubmit:M,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.5rem",fontFamily:"'JetBrains Mono', monospace",textAlign:"center"},children:n("auth.enter_totp_code")}),t.jsx("div",{style:{display:"flex",gap:"0.5rem",justifyContent:"center"},onPaste:D,children:Array.from({length:6}).map((e,r)=>t.jsx("input",{ref:o=>{b.current[r]=o},type:"text",inputMode:"numeric",maxLength:1,value:l[r]||"",onChange:o=>R(r,o.target.value),onKeyDown:o=>T(r,o),autoFocus:r===0,autoComplete:r===0?"one-time-code":"off",style:{width:"2.75rem",height:"3rem",textAlign:"center",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"1.25rem",fontFamily:"'JetBrains Mono', monospace",fontWeight:600,outline:"none",boxSizing:"border-box"},onFocus:o=>o.target.style.borderColor="var(--accent)",onBlur:o=>o.target.style.borderColor="var(--border)"},r))})]}),t.jsx("button",{type:"submit",disabled:d||l.length!==6,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:d||l.length!==6?"not-allowed":"pointer",opacity:d||l.length!==6?.7:1,marginTop:"0.5rem"},children:n(d?"common.verifying":"auth.verify")}),t.jsx("button",{type:"button",onClick:J,style:{width:"100%",padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:n("common.back")})]},"totp")]})})}export{A as default};
@@ -1 +1 @@
1
- import{j as s}from"./index-vL7aQJNr.js";import{b as a}from"./status-colors-BPEUp90-.js";function x({label:r,value:t,variant:n="stacked"}){const e=Math.round(t*100);return n==="inline"?s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{className:"w-8 text-[var(--text-muted)]",children:r}),s.jsx("div",{className:"h-1.5 flex-1 rounded-[2px] bg-[var(--bg-input)]",children:s.jsx("div",{className:"h-full rounded-[2px] transition-all",style:{width:`${e}%`,backgroundColor:a(t)}})}),s.jsxs("span",{className:"w-8 text-right text-[var(--text-secondary)]",children:[e,"%"]})]}):s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-[var(--text-secondary)]",children:r}),s.jsxs("span",{className:"text-[var(--text-primary)]",children:[e,"%"]})]}),s.jsx("div",{className:"h-1.5 w-full rounded-[2px] bg-[var(--bg-input)]",children:s.jsx("div",{className:"h-full rounded-[2px] transition-all",style:{width:`${e}%`,backgroundColor:a(t)}})})]})}export{x as M};
1
+ import{j as s}from"./index-CqnL6hX8.js";import{b as a}from"./status-colors-BXL4VDNh.js";function x({label:r,value:t,variant:n="stacked"}){const e=Math.round(t*100);return n==="inline"?s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{className:"w-8 text-[var(--text-muted)]",children:r}),s.jsx("div",{className:"h-1.5 flex-1 rounded-[2px] bg-[var(--bg-input)]",children:s.jsx("div",{className:"h-full rounded-[2px] transition-all",style:{width:`${e}%`,backgroundColor:a(t)}})}),s.jsxs("span",{className:"w-8 text-right text-[var(--text-secondary)]",children:[e,"%"]})]}):s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-[var(--text-secondary)]",children:r}),s.jsxs("span",{className:"text-[var(--text-primary)]",children:[e,"%"]})]}),s.jsx("div",{className:"h-1.5 w-full rounded-[2px] bg-[var(--bg-input)]",children:s.jsx("div",{className:"h-full rounded-[2px] transition-all",style:{width:`${e}%`,backgroundColor:a(t)}})})]})}export{x as M};
@@ -1 +1 @@
1
- import{e as a,a as n,j as e,L as o}from"./index-vL7aQJNr.js";function x(){const r=a(),{t}=n();return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--bg-primary)] p-8 font-mono",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-12 py-16",children:[e.jsx("span",{className:"text-7xl font-bold text-[var(--border)]",children:t("common.not_found")}),e.jsx("span",{className:"text-base font-bold text-red-500",children:t("common.page_not_found")}),e.jsx("span",{className:"max-w-[340px] text-center text-xs text-[var(--text-muted)]",children:t("common.the_page_does_not_exist")}),e.jsxs("div",{className:"w-full max-w-[380px] rounded-[4px] bg-[#0C0C0C] px-4 py-3",children:[e.jsxs("p",{className:"font-mono text-xs leading-relaxed text-[var(--text-muted)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> overlord $"})," ",e.jsx("span",{className:"text-[#e4e4e4]",children:"page --get /unknown"})]}),e.jsx("p",{className:"mt-1 font-mono text-xs leading-relaxed text-red-500",children:t("common.not_found_terminal_error")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(o,{to:"/",className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black transition-all hover:brightness-110",children:t("common.go_home")}),e.jsx("button",{type:"button",onClick:()=>r(-1),className:"rounded-[4px] border border-[var(--border)] bg-transparent px-5 py-2 text-[11px] font-bold text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",children:t("common.go_back")})]})]})})}export{x as default};
1
+ import{e as a,a as n,j as e,L as o}from"./index-CqnL6hX8.js";function x(){const r=a(),{t}=n();return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--bg-primary)] p-8 font-mono",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-12 py-16",children:[e.jsx("span",{className:"text-7xl font-bold text-[var(--border)]",children:t("common.not_found")}),e.jsx("span",{className:"text-base font-bold text-red-500",children:t("common.page_not_found")}),e.jsx("span",{className:"max-w-[340px] text-center text-xs text-[var(--text-muted)]",children:t("common.the_page_does_not_exist")}),e.jsxs("div",{className:"w-full max-w-[380px] rounded-[4px] bg-[#0C0C0C] px-4 py-3",children:[e.jsxs("p",{className:"font-mono text-xs leading-relaxed text-[var(--text-muted)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> overlord $"})," ",e.jsx("span",{className:"text-[#e4e4e4]",children:"page --get /unknown"})]}),e.jsx("p",{className:"mt-1 font-mono text-xs leading-relaxed text-red-500",children:t("common.not_found_terminal_error")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(o,{to:"/",className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black transition-all hover:brightness-110",children:t("common.go_home")}),e.jsx("button",{type:"button",onClick:()=>r(-1),className:"rounded-[4px] border border-[var(--border)] bg-transparent px-5 py-2 text-[11px] font-bold text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",children:t("common.go_back")})]})]})})}export{x as default};
@@ -1 +1 @@
1
- import{u as j,r as a,a as w,j as t,X as N,C as L,L as D,D as m}from"./index-vL7aQJNr.js";import{C as S}from"./chevron-right-CqyufMDW.js";function y(e){return[{id:"admin_create_project",title:e("onboarding.admin_create_project_title"),description:e("onboarding.admin_create_project_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects"),autoDetect:!0},{id:"admin_register_worker",title:e("onboarding.admin_register_worker_title"),description:e("onboarding.admin_register_worker_desc"),link:"/workers",linkLabel:e("onboarding.go_to_workers"),autoDetect:!0},{id:"admin_create_developer",title:e("onboarding.admin_create_developer_title"),description:e("onboarding.admin_create_developer_desc"),link:"/admin/developers",linkLabel:e("onboarding.manage_developers"),autoDetect:!0},{id:"admin_configure_bot",title:e("onboarding.admin_configure_bot_title"),description:e("onboarding.admin_configure_bot_desc"),link:"/admin/bots",linkLabel:e("onboarding.go_to_bots")},{id:"dev_link_chat",title:e("onboarding.dev_link_chat_title"),description:e("onboarding.dev_link_chat_desc")},{id:"admin_first_task",title:e("onboarding.admin_first_task_title"),description:e("onboarding.admin_first_task_desc"),link:"/tasks",linkLabel:e("onboarding.go_to_tasks"),autoDetect:!0}]}function C(e){return[{id:"lead_view_projects",title:e("onboarding.lead_view_projects_title"),description:e("onboarding.lead_view_projects_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects")},{id:"dev_link_chat",title:e("onboarding.dev_link_chat_title"),description:e("onboarding.dev_link_chat_desc")},{id:"lead_configure_pipeline",title:e("onboarding.lead_configure_pipeline_title"),description:e("onboarding.lead_configure_pipeline_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects")},{id:"lead_add_member",title:e("onboarding.lead_add_member_title"),description:e("onboarding.lead_add_member_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects")},{id:"lead_first_task",title:e("onboarding.lead_first_task_title"),description:e("onboarding.lead_first_task_desc"),link:"/tasks",linkLabel:e("onboarding.go_to_tasks")}]}function E(e){return[{id:"dev_install_cli",title:e("onboarding.dev_install_cli_title"),description:e("onboarding.dev_install_cli_desc"),link:"/docs/cli",linkLabel:e("onboarding.cli")},{id:"dev_setup_cli",title:e("onboarding.dev_setup_cli_title"),description:e("onboarding.dev_setup_cli_desc"),link:"/docs/cli",linkLabel:e("onboarding.setup_guide")},{id:"dev_link_chat",title:e("onboarding.dev_link_chat_title"),description:e("onboarding.dev_link_chat_desc")},{id:"dev_view_projects",title:e("onboarding.dev_view_projects_title"),description:e("onboarding.dev_view_projects_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects")},{id:"dev_first_task",title:e("onboarding.dev_first_task_title"),description:e("onboarding.dev_first_task_desc"),link:"/tasks",linkLabel:e("onboarding.go_to_tasks"),autoDetect:!0}]}const p="overlord_onboarding";function v(){try{const e=localStorage.getItem(p);if(e)return JSON.parse(e)}catch{}return{dismissed:!1,completed:{}}}function R(){return v().dismissed}function u(e){localStorage.setItem(p,JSON.stringify(e))}function $({data:e}){const l=j(i=>{var n;return(n=i.user)==null?void 0:n.role}),[s,c]=a.useState(v),{t:r}=w();function x(){return l===m.ADMIN?y(r):l===m.LEAD?C(r):E(r)}const o=x(),_=a.useCallback(i=>{if(s.completed[i.id])return!0;if(!i.autoDetect)return!1;switch(i.id){case"admin_create_project":return e.totalProjects>0;case"admin_register_worker":return e.totalWorkers>0;case"admin_create_developer":return e.totalDevelopers>1;case"admin_first_task":case"dev_first_task":return e.activeTasks>0;default:return!1}},[s.completed,e]),d=o.filter(_).length,k=d===o.length,h=a.useCallback(i=>{c(n=>{const g={...n,completed:{...n.completed,[i]:!n.completed[i]}};return u(g),g})},[]),b=a.useCallback(()=>{c(i=>{const n={...i,dismissed:!0};return u(n),window.dispatchEvent(new Event("onboarding-dismissed")),n})},[]);if(s.dismissed)return null;const f=Math.round(d/o.length*100);return t.jsxs("div",{className:"mb-6 md:mb-8 rounded-[4px] border border-[var(--accent)]/30 bg-[var(--bg-card)]",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:r("onboarding.getting_started")}),t.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[d,"/",o.length," completed"]})]}),t.jsx("button",{onClick:b,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",title:r("onboarding.dismiss"),children:t.jsx(N,{className:"h-3.5 w-3.5"})})]}),t.jsx("div",{className:"h-0.5 bg-[var(--border)]",children:t.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-500",style:{width:`${f}%`}})}),t.jsx("div",{className:"divide-y divide-[var(--border)]",children:o.map(i=>{const n=_(i);return t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 transition-colors hover:bg-[var(--bg-input)]",children:[t.jsx("button",{onClick:()=>!i.autoDetect&&h(i.id),className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors ${n?"border-[var(--accent)] bg-[var(--accent)]":"border-[var(--border)] hover:border-[var(--text-muted)]"} ${i.autoDetect?"cursor-default":"cursor-pointer"}`,children:n&&t.jsx(L,{className:"h-2.5 w-2.5 text-black"})}),t.jsxs("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:`text-xs ${n?"text-[var(--text-muted)] line-through":"text-[var(--text-primary)]"}`,children:i.title}),t.jsx("p",{className:"text-[11px] text-[var(--text-muted)] truncate",children:i.description})]}),i.link&&!n&&t.jsxs(D,{to:i.link,className:"ml-3 flex shrink-0 items-center gap-1 text-[11px] text-[var(--accent)] hover:underline",children:[i.linkLabel," ",t.jsx(S,{className:"h-3 w-3"})]})]})]},i.id)})}),k&&t.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 text-center",children:[t.jsx("span",{className:"text-xs text-[var(--accent)]",children:r("onboarding.all_done")}),t.jsx("button",{onClick:b,className:"ml-3 text-[11px] text-[var(--text-muted)] underline hover:text-[var(--text-primary)]",children:r("onboarding.dismiss")})]})]})}export{$ as O,R as i};
1
+ import{u as j,r as a,a as w,j as t,X as N,C as L,L as D,D as m}from"./index-CqnL6hX8.js";import{C as S}from"./chevron-right-CKEZOJqX.js";function y(e){return[{id:"admin_create_project",title:e("onboarding.admin_create_project_title"),description:e("onboarding.admin_create_project_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects"),autoDetect:!0},{id:"admin_register_worker",title:e("onboarding.admin_register_worker_title"),description:e("onboarding.admin_register_worker_desc"),link:"/workers",linkLabel:e("onboarding.go_to_workers"),autoDetect:!0},{id:"admin_create_developer",title:e("onboarding.admin_create_developer_title"),description:e("onboarding.admin_create_developer_desc"),link:"/admin/developers",linkLabel:e("onboarding.manage_developers"),autoDetect:!0},{id:"admin_configure_bot",title:e("onboarding.admin_configure_bot_title"),description:e("onboarding.admin_configure_bot_desc"),link:"/admin/bots",linkLabel:e("onboarding.go_to_bots")},{id:"dev_link_chat",title:e("onboarding.dev_link_chat_title"),description:e("onboarding.dev_link_chat_desc")},{id:"admin_first_task",title:e("onboarding.admin_first_task_title"),description:e("onboarding.admin_first_task_desc"),link:"/tasks",linkLabel:e("onboarding.go_to_tasks"),autoDetect:!0}]}function C(e){return[{id:"lead_view_projects",title:e("onboarding.lead_view_projects_title"),description:e("onboarding.lead_view_projects_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects")},{id:"dev_link_chat",title:e("onboarding.dev_link_chat_title"),description:e("onboarding.dev_link_chat_desc")},{id:"lead_configure_pipeline",title:e("onboarding.lead_configure_pipeline_title"),description:e("onboarding.lead_configure_pipeline_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects")},{id:"lead_add_member",title:e("onboarding.lead_add_member_title"),description:e("onboarding.lead_add_member_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects")},{id:"lead_first_task",title:e("onboarding.lead_first_task_title"),description:e("onboarding.lead_first_task_desc"),link:"/tasks",linkLabel:e("onboarding.go_to_tasks")}]}function E(e){return[{id:"dev_install_cli",title:e("onboarding.dev_install_cli_title"),description:e("onboarding.dev_install_cli_desc"),link:"/docs/cli",linkLabel:e("onboarding.cli")},{id:"dev_setup_cli",title:e("onboarding.dev_setup_cli_title"),description:e("onboarding.dev_setup_cli_desc"),link:"/docs/cli",linkLabel:e("onboarding.setup_guide")},{id:"dev_link_chat",title:e("onboarding.dev_link_chat_title"),description:e("onboarding.dev_link_chat_desc")},{id:"dev_view_projects",title:e("onboarding.dev_view_projects_title"),description:e("onboarding.dev_view_projects_desc"),link:"/projects",linkLabel:e("onboarding.go_to_projects")},{id:"dev_first_task",title:e("onboarding.dev_first_task_title"),description:e("onboarding.dev_first_task_desc"),link:"/tasks",linkLabel:e("onboarding.go_to_tasks"),autoDetect:!0}]}const p="overlord_onboarding";function v(){try{const e=localStorage.getItem(p);if(e)return JSON.parse(e)}catch{}return{dismissed:!1,completed:{}}}function R(){return v().dismissed}function u(e){localStorage.setItem(p,JSON.stringify(e))}function $({data:e}){const l=j(i=>{var n;return(n=i.user)==null?void 0:n.role}),[s,c]=a.useState(v),{t:r}=w();function x(){return l===m.ADMIN?y(r):l===m.LEAD?C(r):E(r)}const o=x(),_=a.useCallback(i=>{if(s.completed[i.id])return!0;if(!i.autoDetect)return!1;switch(i.id){case"admin_create_project":return e.totalProjects>0;case"admin_register_worker":return e.totalWorkers>0;case"admin_create_developer":return e.totalDevelopers>1;case"admin_first_task":case"dev_first_task":return e.activeTasks>0;default:return!1}},[s.completed,e]),d=o.filter(_).length,k=d===o.length,h=a.useCallback(i=>{c(n=>{const g={...n,completed:{...n.completed,[i]:!n.completed[i]}};return u(g),g})},[]),b=a.useCallback(()=>{c(i=>{const n={...i,dismissed:!0};return u(n),window.dispatchEvent(new Event("onboarding-dismissed")),n})},[]);if(s.dismissed)return null;const f=Math.round(d/o.length*100);return t.jsxs("div",{className:"mb-6 md:mb-8 rounded-[4px] border border-[var(--accent)]/30 bg-[var(--bg-card)]",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:r("onboarding.getting_started")}),t.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[d,"/",o.length," completed"]})]}),t.jsx("button",{onClick:b,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",title:r("onboarding.dismiss"),children:t.jsx(N,{className:"h-3.5 w-3.5"})})]}),t.jsx("div",{className:"h-0.5 bg-[var(--border)]",children:t.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-500",style:{width:`${f}%`}})}),t.jsx("div",{className:"divide-y divide-[var(--border)]",children:o.map(i=>{const n=_(i);return t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 transition-colors hover:bg-[var(--bg-input)]",children:[t.jsx("button",{onClick:()=>!i.autoDetect&&h(i.id),className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors ${n?"border-[var(--accent)] bg-[var(--accent)]":"border-[var(--border)] hover:border-[var(--text-muted)]"} ${i.autoDetect?"cursor-default":"cursor-pointer"}`,children:n&&t.jsx(L,{className:"h-2.5 w-2.5 text-black"})}),t.jsxs("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:`text-xs ${n?"text-[var(--text-muted)] line-through":"text-[var(--text-primary)]"}`,children:i.title}),t.jsx("p",{className:"text-[11px] text-[var(--text-muted)] truncate",children:i.description})]}),i.link&&!n&&t.jsxs(D,{to:i.link,className:"ml-3 flex shrink-0 items-center gap-1 text-[11px] text-[var(--accent)] hover:underline",children:[i.linkLabel," ",t.jsx(S,{className:"h-3 w-3"})]})]})]},i.id)})}),k&&t.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 text-center",children:[t.jsx("span",{className:"text-xs text-[var(--accent)]",children:r("onboarding.all_done")}),t.jsx("button",{onClick:b,className:"ml-3 text-[11px] text-[var(--text-muted)] underline hover:text-[var(--text-primary)]",children:r("onboarding.dismiss")})]})]})}export{$ as O,R as i};