@overlordai/server 1.0.24 → 1.0.26

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 (67) hide show
  1. package/dist/main.js +1 -1
  2. package/dist/main.js.map +1 -1
  3. package/dist/web/project.controller.d.ts.map +1 -1
  4. package/dist/web/project.controller.js +10 -2
  5. package/dist/web/project.controller.js.map +1 -1
  6. package/dist/web/worker.controller.d.ts +0 -1
  7. package/dist/web/worker.controller.d.ts.map +1 -1
  8. package/dist/web/worker.controller.js +1 -4
  9. package/dist/web/worker.controller.js.map +1 -1
  10. package/package.json +9 -9
  11. package/public/assets/{AccessTokensPage-D73_4hLR.js → AccessTokensPage-DjXg_GcZ.js} +1 -1
  12. package/public/assets/{AdminPage-D6pFjGmN.js → AdminPage-LU3VU8sd.js} +1 -1
  13. package/public/assets/ApiReferencePage-BMDuk9em.js +1 -0
  14. package/public/assets/{AuditLogPage-GREFjQX6.js → AuditLogPage-BQnvLBUm.js} +2 -7
  15. package/public/assets/{BotManage-D9kc8BY5.js → BotManage-Is69ZQBf.js} +1 -1
  16. package/public/assets/CliReferencePage-DpDJXb2B.js +8 -0
  17. package/public/assets/{DeveloperManage-TJw3eF8S.js → DeveloperManage-Ma4FgQXQ.js} +1 -1
  18. package/public/assets/{EditProjectPage-DwCS51Mo.js → EditProjectPage-C78aJ078.js} +1 -1
  19. package/public/assets/{EmptyState-B5jMtmkr.js → EmptyState-BQ2BNVJS.js} +1 -1
  20. package/public/assets/HomePage-Bl0KZPgn.js +1 -0
  21. package/public/assets/{LandingPage-B-3pUdk_.js → LandingPage-Bxv40luT.js} +1 -1
  22. package/public/assets/{LoginPage-Dstlxfad.js → LoginPage-CMyyf5ts.js} +1 -1
  23. package/public/assets/MachineDetailPage-BARcjlVJ.js +1 -0
  24. package/public/assets/MachineListPage-C044mEFY.js +6 -0
  25. package/public/assets/{NotFoundPage-CRp_HeR8.js → NotFoundPage-Ck2hYu_B.js} +1 -1
  26. package/public/assets/{PipelineEditorPage-jSzry5nq.js → PipelineEditorPage-hoXGXxtB.js} +2 -2
  27. package/public/assets/{ProfilePage-BjTXfqR-.js → ProfilePage-DQQh-J_f.js} +1 -1
  28. package/public/assets/ProjectDetailPage-7wHRY-_7.js +7 -0
  29. package/public/assets/{ProjectListPage-DxBqxFUe.js → ProjectListPage-Cpzf-qNq.js} +1 -1
  30. package/public/assets/{QuickAuth-BGJ9EbFe.js → QuickAuth-CoRuLOkE.js} +1 -1
  31. package/public/assets/RemoveMemberConfirmDialog-C-UcPD2-.js +6 -0
  32. package/public/assets/{Select-DobTn2ab.js → Select-cAwdx-J1.js} +1 -1
  33. package/public/assets/{SettingsPage-I5qaiH25.js → SettingsPage-vlEdzALt.js} +1 -1
  34. package/public/assets/{Skeleton-D-ZoNR01.js → Skeleton-DkwMPaZ1.js} +1 -1
  35. package/public/assets/{TaskDetailPage-Lqh5i3TN.js → TaskDetailPage-CSM2ew4E.js} +1 -1
  36. package/public/assets/{TaskListPage-BPHnFmpO.js → TaskListPage-Dr_IZ2vJ.js} +1 -1
  37. package/public/assets/{TaskStatusBadge-RjE_jGwc.js → TaskStatusBadge-B6pZ1mXD.js} +1 -1
  38. package/public/assets/{TokenManage-CQqbOJcD.js → TokenManage-TLgRE0QO.js} +1 -1
  39. package/public/assets/{TotpSetupPage-BNuui0Vg.js → TotpSetupPage-CedCLn9b.js} +1 -1
  40. package/public/assets/{WorkerSetupGuidePage-jvt8Z6j1.js → WorkerSetupGuidePage-C-faBGTF.js} +1 -1
  41. package/public/assets/{arrow-left-R4PVWL3u.js → arrow-left-B701wpRZ.js} +1 -1
  42. package/public/assets/{arrow-right-t-l7E3bV.js → arrow-right-B4SWX5QX.js} +1 -1
  43. package/public/assets/{bot-KOWEPW_6.js → bot-BMG_Lak4.js} +1 -1
  44. package/public/assets/chevron-right-Dv5NEUXH.js +6 -0
  45. package/public/assets/{copy-fRb9wi57.js → copy-C0vNNRrm.js} +1 -1
  46. package/public/assets/{external-link-CB9tx4V-.js → external-link-CVx7jdXb.js} +1 -1
  47. package/public/assets/{index-bdjBPTjT.js → index-BTxGPsOB.js} +11 -11
  48. package/public/assets/index-v5rpOoDH.css +1 -0
  49. package/public/assets/{key-BZHp4zSH.js → key-OwB_ZR3T.js} +1 -1
  50. package/public/assets/{loader-circle-DyfiwA3n.js → loader-circle-BN3eQzTt.js} +1 -1
  51. package/public/assets/{pencil-DgTA8lMR.js → pencil-BtnOFy3d.js} +1 -1
  52. package/public/assets/{plus-CS3VSUw-.js → plus-Cm_mqbAL.js} +1 -1
  53. package/public/assets/{rotate-ccw-e6dKDLQp.js → rotate-ccw-Di9lk9Jq.js} +1 -1
  54. package/public/assets/{scroll-text-DvCW6HuW.js → scroll-text-C8HTue-V.js} +1 -1
  55. package/public/assets/{settings-DDZ75kV_.js → settings-BxP_lYKz.js} +1 -1
  56. package/public/assets/{task.store-CDfQR9zk.js → task.store-CRByTXd0.js} +1 -1
  57. package/public/assets/{trash-2-Z9HHaMPB.js → trash-2-Bzd6fyHf.js} +1 -1
  58. package/public/assets/{users-yEz_0v7L.js → users-DmYD60pt.js} +1 -1
  59. package/public/index.html +2 -2
  60. package/public/assets/ApiReferencePage-Cr6xHbdi.js +0 -1
  61. package/public/assets/CliReferencePage-BIwVJvQK.js +0 -4
  62. package/public/assets/HomePage-Be7BEt8c.js +0 -1
  63. package/public/assets/MachineDetailPage-C3AAUkBm.js +0 -1
  64. package/public/assets/MachineListPage-DYv4UXDO.js +0 -6
  65. package/public/assets/ProjectDetailPage-Dm8phZfW.js +0 -7
  66. package/public/assets/RemoveMemberConfirmDialog-Dpvy8p31.js +0 -6
  67. package/public/assets/index-BwfyjudA.css +0 -1
package/dist/main.js CHANGED
@@ -71,7 +71,7 @@ async function bootstrap() {
71
71
  process.on('SIGTERM', () => shutdown('SIGTERM'));
72
72
  process.on('SIGINT', () => shutdown('SIGINT'));
73
73
  // eslint-disable-next-line @typescript-eslint/no-require-imports
74
- const { version } = require('../../package.json');
74
+ const { version } = require('../package.json');
75
75
  await app.listen(port);
76
76
  logger.log(`Overlord server v${version} listening on port ${port}`);
77
77
  }
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,4BAA0B;AAC1B,uCAA2C;AAE3C,qDAAgD;AAChD,6CAAyC;AACzC,qCAA+B;AAC/B,+BAA4B;AAC5B,2CAAwC;AACxC,wDAA8D;AAE9D,KAAK,UAAU,SAAS;IACtB,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,WAAW,CAAC,CAAC;IAEvC,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAyB,sBAAS,EAAE;QACtE,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;IAEH,qEAAqE;IACrE,wDAAwD;IACxD,GAAG,CAAC,mBAAmB,CAAC,IAAI,uBAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAE5C,oDAAoD;IACpD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC;IAClD,GAAG,CAAC,UAAU,CAAC;QACb,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,UAAU,KAAK,GAAG;KAChC,CAAC,CAAC;IAEH,6BAA6B;IAC7B,GAAG,CAAC,GAAG,CAAC,IAAA,cAAI,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAEhC,4DAA4D;IAC5D,MAAM,SAAS,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAClD,GAAG,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAE/B,0BAA0B;IAC1B,GAAG,CAAC,gBAAgB,CAAC,IAAI,oCAAqB,EAAE,CAAC,CAAC;IAElD,oDAAoD;IACpD,qEAAqE;IACrE,uEAAuE;IACvE,qEAAqE;IAErE,MAAM,IAAI,GAAG,OAAO,CAAC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I,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD;AAED,qBAEa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAHZ,WAAW,EAAE,iBAAiB,EAC9B,iBAAiB,EAAE,uBAAuB,EAC1C,aAAa,EAAE,mBAAmB,EAClC,YAAY,EAAE,kBAAkB;IAInD,YAAY;IAKZ,cAAc;;;;;;IAUd,UAAU,CAAe,GAAG,EAAE,MAAM;IAWpC,aAAa,CACU,GAAG,EAAE,MAAM,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,GAAG,EAAE,oBAAoB;IA2BlC,WAAW,CAAsB,GAAG,EAAE,MAAM;;;;;;;IAW5C,SAAS,CACc,GAAG,EAAE,MAAM,EACxB,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAC7C,GAAG,EAAE,oBAAoB;;;;;;;IAwClC,YAAY,CACW,GAAG,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EAClC,GAAG,EAAE,oBAAoB;;;CAyBnC"}
@@ -79,6 +79,14 @@ let ProjectController = class ProjectController {
79
79
  return this.projectMemberRepo.findByProject(key);
80
80
  }
81
81
  addMember(key, body, req) {
82
+ if (typeof body.developerId !== 'number' || !Number.isInteger(body.developerId) || body.developerId < 1) {
83
+ throw new common_1.BadRequestException('developerId must be a positive integer');
84
+ }
85
+ const validRoles = [protocol_1.ProjectRole.MEMBER, protocol_1.ProjectRole.MAINTAINER];
86
+ const role = body.role ?? protocol_1.ProjectRole.MEMBER;
87
+ if (!validRoles.includes(role)) {
88
+ throw new common_1.BadRequestException(`role must be one of: ${validRoles.join(', ')}`);
89
+ }
82
90
  const project = this.projectRepo.findByKey(key);
83
91
  if (!project) {
84
92
  throw new common_1.NotFoundException(`Project '${key}' not found`);
@@ -90,7 +98,7 @@ let ProjectController = class ProjectController {
90
98
  const member = this.projectMemberRepo.create({
91
99
  projectKey: key,
92
100
  developerId: body.developerId,
93
- role: body.role,
101
+ role,
94
102
  });
95
103
  this.auditLogRepo.create({
96
104
  userId: req.user.sub,
@@ -130,7 +138,7 @@ __decorate([
130
138
  __metadata("design:returntype", void 0)
131
139
  ], ProjectController.prototype, "listProjects", null);
132
140
  __decorate([
133
- (0, common_1.Get)('developers'),
141
+ (0, common_1.Get)('-/developers'),
134
142
  __metadata("design:type", Function),
135
143
  __metadata("design:paramtypes", []),
136
144
  __metadata("design:returntype", void 0)
@@ -1 +1 @@
1
- {"version":3,"file":"project.controller.js","sourceRoot":"","sources":["../../src/web/project.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAcwB;AACxB,mDAAmD;AACnD,kEAA6D;AAC7D,0EAAqE;AACrE,wFAA0E;AAC1E,oFAAgF;AAChF,kGAA6F;AAC7F,wFAAoF;AACpF,wFAAmF;AAQ5E,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAET;IACA;IACA;IACA;IAJnB,YACmB,WAA8B,EAC9B,iBAA0C,EAC1C,aAAkC,EAClC,YAAgC;QAHhC,gBAAW,GAAX,WAAW,CAAmB;QAC9B,sBAAiB,GAAjB,iBAAiB,CAAyB;QAC1C,kBAAa,GAAb,aAAa,CAAqB;QAClC,iBAAY,GAAZ,YAAY,CAAoB;IAChD,CAAC;IAGJ,YAAY;QACV,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;IAGD,cAAc;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9C,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,QAAQ,EAA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,EAAC,6BAAY,CAAC;qCAGU,sCAAiB;QACX,mDAAuB;QAC3B,0CAAmB;QACpB,yCAAkB;GALxC,iBAAiB,CAmJ7B"}
@@ -10,7 +10,6 @@ export declare class WorkerController {
10
10
  healthz(): {
11
11
  status: string;
12
12
  connectedWorkers: number;
13
- connectedMachineIds: string[];
14
13
  };
15
14
  register(body: WorkerRegisterRequest): Promise<WorkerRegisterResponse>;
16
15
  refreshToken(body: WorkerRefreshRequest, req: {
@@ -1 +1 @@
1
- {"version":3,"file":"worker.controller.d.ts","sourceRoot":"","sources":["../../src/web/worker.controller.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGlF,qBACa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,uBAAuB;gBAFvB,UAAU,EAAE,iBAAiB,EAC7B,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,uBAAuB;IAInE,OAAO;;;;;IAYD,QAAQ,CACJ,IAAI,EAAE,qBAAqB,GAClC,OAAO,CAAC,sBAAsB,CAAC;IAK5B,YAAY,CACR,IAAI,EAAE,oBAAoB,EAC3B,GAAG,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAC/C,OAAO,CAAC,qBAAqB,CAAC;IAY3B,OAAO,CACH,IAAI,EAAE,qBAAqB,GAClC,OAAO,CAAC,sBAAsB,CAAC;CAGnC"}
1
+ {"version":3,"file":"worker.controller.d.ts","sourceRoot":"","sources":["../../src/web/worker.controller.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGlF,qBACa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,uBAAuB;gBAFvB,UAAU,EAAE,iBAAiB,EAC7B,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,uBAAuB;IAInE,OAAO;;;;IASD,QAAQ,CACJ,IAAI,EAAE,qBAAqB,GAClC,OAAO,CAAC,sBAAsB,CAAC;IAK5B,YAAY,CACR,IAAI,EAAE,oBAAoB,EAC3B,GAAG,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAC/C,OAAO,CAAC,qBAAqB,CAAC;IAY3B,OAAO,CACH,IAAI,EAAE,qBAAqB,GAClC,OAAO,CAAC,sBAAsB,CAAC;CAGnC"}
@@ -28,12 +28,9 @@ let WorkerController = class WorkerController {
28
28
  this.workerConnectionManager = workerConnectionManager;
29
29
  }
30
30
  healthz() {
31
- const connectedCount = this.workerConnectionManager.getConnectedCount();
32
- const connectedMachineIds = this.workerConnectionManager.getConnectedMachineIds();
33
31
  return {
34
32
  status: 'ok',
35
- connectedWorkers: connectedCount,
36
- connectedMachineIds,
33
+ connectedWorkers: this.workerConnectionManager.getConnectedCount(),
37
34
  };
38
35
  }
39
36
  async register(body) {
@@ -1 +1 @@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,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAEnD,WAAA,IAAA,aAAI,GAAE,CAAA;;;;gDAGR;AAGK;IADL,IAAA,aAAI,EAAC,eAAe,CAAC;IAEnB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,YAAG,GAAE,CAAA;;;;oDASP;AAIK;IAFL,IAAA,aAAI,EAAC,SAAS,CAAC;IACf,IAAA,4BAAS,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAEnD,WAAA,IAAA,aAAI,GAAE,CAAA;;;;+CAGR;2BA3CU,gBAAgB;IAD5B,IAAA,mBAAU,EAAC,aAAa,CAAC;qCAGO,sCAAiB;QAChB,0BAAW;QACC,mDAAuB;GAJxD,gBAAgB,CA4C5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overlordai/server",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",
@@ -10,13 +10,6 @@
10
10
  "bin": {
11
11
  "overlord-server": "dist/main.js"
12
12
  },
13
- "scripts": {
14
- "build": "tsc && node -e \"const f='dist/main.js',c=require('fs').readFileSync(f,'utf8');if(!c.startsWith('#!'))require('fs').writeFileSync(f,'#!/usr/bin/env node\\\\n'+c)\"",
15
- "start": "node dist/main.js",
16
- "seed": "npx tsx scripts/seed.ts",
17
- "test": "vitest run",
18
- "lint": "tsc --noEmit"
19
- },
20
13
  "dependencies": {
21
14
  "@larksuiteoapi/node-sdk": "^1.59.0",
22
15
  "@nestjs/common": "^10.4.0",
@@ -58,5 +51,12 @@
58
51
  "unplugin-swc": "^1.5.9",
59
52
  "vitest": "^4.0.18",
60
53
  "ws": "^8.18.0"
54
+ },
55
+ "scripts": {
56
+ "build": "tsc && node -e \"const f='dist/main.js',c=require('fs').readFileSync(f,'utf8');if(!c.startsWith('#!'))require('fs').writeFileSync(f,'#!/usr/bin/env node\\\\n'+c)\"",
57
+ "start": "node dist/main.js",
58
+ "seed": "npx tsx scripts/seed.ts",
59
+ "test": "vitest run",
60
+ "lint": "tsc --noEmit"
61
61
  }
62
- }
62
+ }
@@ -1 +1 @@
1
- import{a as _,r as o,j as e,f as j,l as w,h as C,t as y,o as T,K as S}from"./index-bdjBPTjT.js";import{S as D}from"./Select-DobTn2ab.js";import{E as A}from"./EmptyState-B5jMtmkr.js";import{T as E}from"./Skeleton-D-ZoNR01.js";import{P as L}from"./plus-CS3VSUw-.js";import{C as R}from"./copy-fRb9wi57.js";import{T as M}from"./trash-2-Z9HHaMPB.js";function O({isOpen:t,onClose:d,onCreated:l}){const{t:s}=_(),[n,i]=o.useState(""),[x,m]=o.useState("never"),[u,v]=o.useState(!1),[p,c]=o.useState(""),b=[{value:"never",label:s("access_tokens.no_expiry")},{value:"30",label:s("access_tokens.days_30")},{value:"90",label:s("access_tokens.days_90")},{value:"365",label:s("access_tokens.days_365")}],h=()=>{i(""),m("never"),c(""),d()},f=async()=>{if(c(""),!n.trim()){c(s("access_tokens.token_label_required"));return}try{v(!0);const a=await j.post("web/profile/tokens",{json:{label:n.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();i(""),m("never"),l({token:a.token,name:a.name})}catch(a){const k=a instanceof Error?a.message:s("access_tokens.failed_to_create_token");c(k)}finally{v(!1)}};return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]",onClick:h}),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:a=>a.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:s("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[p&&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:p}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:s("access_tokens.token_name_placeholder"),value:n,onChange:a=>i(a.target.value),onKeyDown:a=>{a.key==="Enter"&&f()},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:s("access_tokens.expires")}),e.jsx(D,{value:x,onChange:m,options:b})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,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:s("common.cancel")}),e.jsx("button",{onClick:f,disabled:u,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:s(u?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function P({isOpen:t,onClose:d,onConfirm:l,tokenLabel:s,isLoading:n}){const{t:i}=_();return e.jsx(w,{isOpen:t,onClose:d,onConfirm:l,title:i("access_tokens.revoke_token_title"),message:i("access_tokens.revoke_confirm",{name:s}),confirmLabel:i("access_tokens.revoke"),confirmVariant:"danger",isLoading:n})}function $(t){const d=Date.now()-new Date(t).getTime(),l=Math.floor(d/1e3);if(l<60)return`${l}s ago`;const s=Math.floor(l/60);if(s<60)return`${s}m ago`;const n=Math.floor(s/60);return n<24?`${n} hours ago`:`${Math.floor(n/24)}d ago`}function V(){const{t}=_(),[d,l]=o.useState([]),[s,n]=o.useState(!0),[i,x]=o.useState(!1),[m,u]=o.useState(null),[v,p]=o.useState(!1),[c,b]=o.useState(null),[h,f]=o.useState(null);C(o.useMemo(()=>e.jsxs("button",{onClick:()=>x(!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(L,{className:"h-3.5 w-3.5"}),t("access_tokens.create_token")]}),[t]));const a=o.useCallback(async()=>{try{n(!0);const r=await j.get("web/profile/tokens").json();l(r)}catch{y.error(t("access_tokens.failed_to_load_tokens"))}finally{n(!1)}},[t]);o.useEffect(()=>{a()},[a]);const k=r=>{x(!1),u(r.token),p(!1),a()},g=async()=>{if(m)try{await navigator.clipboard.writeText(m),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},N=async()=>{if(c)try{f(c.id),await j.post(`web/profile/tokens/${c.id}/revoke`),y.success(t("access_tokens.token_revoked")),b(null),a()}catch{y.error(t("access_tokens.failed_to_revoke_token"))}finally{f(null)}};return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[m&&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:t("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:m}),e.jsxs("button",{onClick:g,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:[v?e.jsx(T,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(R,{className:"h-3.5 w-3.5"}),t(v?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>u(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:t("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s?e.jsx("div",{className:"p-4",children:e.jsx(E,{rows:3})}):d.length===0?e.jsx(A,{icon:S,title:t("access_tokens.no_tokens"),description:t("access_tokens.create_token_desc"),actionLabel:t("access_tokens.create_token"),onAction:()=>x(!0)}):e.jsxs("table",{className:"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:t("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:t("common.actions")})]})}),e.jsx("tbody",{children:d.map(r=>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:r.label}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:r.status==="active"?"text-green-400":"text-[var(--text-muted)]",children:r.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:r.lastUsedAt?$(r.lastUsedAt):t("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:r.expiresAt?new Date(r.expiresAt).toLocaleDateString():t("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:r.status==="active"&&e.jsxs("button",{onClick:()=>b(r),disabled:h===r.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(M,{className:"h-3 w-3"}),t("access_tokens.revoke")]})})]},r.id))})]})}),e.jsx(O,{isOpen:i,onClose:()=>x(!1),onCreated:k}),e.jsx(P,{isOpen:!!c,onClose:()=>b(null),onConfirm:N,tokenLabel:(c==null?void 0:c.label)??"",isLoading:h!==null})]})}export{V as default};
1
+ import{a as _,r as o,j as e,f as j,l as w,h as C,t as y,o as T,K as S}from"./index-BTxGPsOB.js";import{S as D}from"./Select-cAwdx-J1.js";import{E as A}from"./EmptyState-BQ2BNVJS.js";import{T as E}from"./Skeleton-DkwMPaZ1.js";import{P as L}from"./plus-Cm_mqbAL.js";import{C as R}from"./copy-C0vNNRrm.js";import{T as M}from"./trash-2-Bzd6fyHf.js";function O({isOpen:t,onClose:d,onCreated:l}){const{t:s}=_(),[n,i]=o.useState(""),[x,m]=o.useState("never"),[u,v]=o.useState(!1),[p,c]=o.useState(""),b=[{value:"never",label:s("access_tokens.no_expiry")},{value:"30",label:s("access_tokens.days_30")},{value:"90",label:s("access_tokens.days_90")},{value:"365",label:s("access_tokens.days_365")}],h=()=>{i(""),m("never"),c(""),d()},f=async()=>{if(c(""),!n.trim()){c(s("access_tokens.token_label_required"));return}try{v(!0);const a=await j.post("web/profile/tokens",{json:{label:n.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();i(""),m("never"),l({token:a.token,name:a.name})}catch(a){const k=a instanceof Error?a.message:s("access_tokens.failed_to_create_token");c(k)}finally{v(!1)}};return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]",onClick:h}),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:a=>a.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:s("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[p&&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:p}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:s("access_tokens.token_name_placeholder"),value:n,onChange:a=>i(a.target.value),onKeyDown:a=>{a.key==="Enter"&&f()},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:s("access_tokens.expires")}),e.jsx(D,{value:x,onChange:m,options:b})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,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:s("common.cancel")}),e.jsx("button",{onClick:f,disabled:u,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:s(u?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function P({isOpen:t,onClose:d,onConfirm:l,tokenLabel:s,isLoading:n}){const{t:i}=_();return e.jsx(w,{isOpen:t,onClose:d,onConfirm:l,title:i("access_tokens.revoke_token_title"),message:i("access_tokens.revoke_confirm",{name:s}),confirmLabel:i("access_tokens.revoke"),confirmVariant:"danger",isLoading:n})}function $(t){const d=Date.now()-new Date(t).getTime(),l=Math.floor(d/1e3);if(l<60)return`${l}s ago`;const s=Math.floor(l/60);if(s<60)return`${s}m ago`;const n=Math.floor(s/60);return n<24?`${n} hours ago`:`${Math.floor(n/24)}d ago`}function V(){const{t}=_(),[d,l]=o.useState([]),[s,n]=o.useState(!0),[i,x]=o.useState(!1),[m,u]=o.useState(null),[v,p]=o.useState(!1),[c,b]=o.useState(null),[h,f]=o.useState(null);C(o.useMemo(()=>e.jsxs("button",{onClick:()=>x(!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(L,{className:"h-3.5 w-3.5"}),t("access_tokens.create_token")]}),[t]));const a=o.useCallback(async()=>{try{n(!0);const r=await j.get("web/profile/tokens").json();l(r)}catch{y.error(t("access_tokens.failed_to_load_tokens"))}finally{n(!1)}},[t]);o.useEffect(()=>{a()},[a]);const k=r=>{x(!1),u(r.token),p(!1),a()},g=async()=>{if(m)try{await navigator.clipboard.writeText(m),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},N=async()=>{if(c)try{f(c.id),await j.post(`web/profile/tokens/${c.id}/revoke`),y.success(t("access_tokens.token_revoked")),b(null),a()}catch{y.error(t("access_tokens.failed_to_revoke_token"))}finally{f(null)}};return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[m&&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:t("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:m}),e.jsxs("button",{onClick:g,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:[v?e.jsx(T,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(R,{className:"h-3.5 w-3.5"}),t(v?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>u(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:t("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s?e.jsx("div",{className:"p-4",children:e.jsx(E,{rows:3})}):d.length===0?e.jsx(A,{icon:S,title:t("access_tokens.no_tokens"),description:t("access_tokens.create_token_desc"),actionLabel:t("access_tokens.create_token"),onAction:()=>x(!0)}):e.jsxs("table",{className:"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:t("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:t("common.actions")})]})}),e.jsx("tbody",{children:d.map(r=>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:r.label}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:r.status==="active"?"text-green-400":"text-[var(--text-muted)]",children:r.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:r.lastUsedAt?$(r.lastUsedAt):t("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:r.expiresAt?new Date(r.expiresAt).toLocaleDateString():t("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:r.status==="active"&&e.jsxs("button",{onClick:()=>b(r),disabled:h===r.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(M,{className:"h-3 w-3"}),t("access_tokens.revoke")]})})]},r.id))})]})}),e.jsx(O,{isOpen:i,onClose:()=>x(!1),onCreated:k}),e.jsx(P,{isOpen:!!c,onClose:()=>b(null),onConfirm:N,tokenLabel:(c==null?void 0:c.label)??"",isLoading:h!==null})]})}export{V as default};
@@ -1 +1 @@
1
- import{a as d,e as l,d as c,K as p,r as b,j as e,w as x,O as v}from"./index-bdjBPTjT.js";import{U as f}from"./users-yEz_0v7L.js";import{B as u}from"./bot-KOWEPW_6.js";import{S as g}from"./scroll-text-DvCW6HuW.js";import{S as h}from"./settings-DDZ75kV_.js";function S(){const{t:a}=d(),t=l(),o=c(),r=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:f},{to:"/admin/bots",label:a("admin.tab_bots"),icon:u},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:p},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:g},{to:"/admin/settings",label:a("admin.tab_settings"),icon:h}];return b.useEffect(()=>{(t.pathname==="/admin"||t.pathname==="/admin/")&&o("/admin/developers",{replace:!0})},[t.pathname,o]),e.jsxs("div",{children:[e.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar",children:r.map(({to:s,label:n,icon:i})=>e.jsxs(x,{to:s,className:({isActive:m})=>`flex shrink-0 items-center gap-2 border-b-2 px-4 py-2 text-sm transition-colors ${m?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[e.jsx(i,{size:16}),n]},s))}),e.jsx(v,{})]})}export{S as default};
1
+ import{a as d,e as l,d as c,K as p,r as b,j as e,w as x,O as v}from"./index-BTxGPsOB.js";import{U as f}from"./users-DmYD60pt.js";import{B as u}from"./bot-BMG_Lak4.js";import{S as g}from"./scroll-text-C8HTue-V.js";import{S as h}from"./settings-BxP_lYKz.js";function S(){const{t:a}=d(),t=l(),o=c(),r=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:f},{to:"/admin/bots",label:a("admin.tab_bots"),icon:u},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:p},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:g},{to:"/admin/settings",label:a("admin.tab_settings"),icon:h}];return b.useEffect(()=>{(t.pathname==="/admin"||t.pathname==="/admin/")&&o("/admin/developers",{replace:!0})},[t.pathname,o]),e.jsxs("div",{children:[e.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar",children:r.map(({to:s,label:n,icon:i})=>e.jsxs(x,{to:s,className:({isActive:m})=>`flex shrink-0 items-center gap-2 border-b-2 px-4 py-2 text-sm transition-colors ${m?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[e.jsx(i,{size:16}),n]},s))}),e.jsx(v,{})]})}export{S as default};
@@ -0,0 +1 @@
1
+ import{d,a as n,h as p,r as o,j as t}from"./index-BTxGPsOB.js";import{Q as c}from"./QuickAuth-CoRuLOkE.js";import{P as h}from"./plus-Cm_mqbAL.js";import"./copy-C0vNNRrm.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", "machineId?": "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:"machines",prefix:"/api/web/machines",endpoints:[{method:"GET",path:"",description:"list all machines",auth:"jwt"},{method:"GET",path:"/:id",description:"get machine details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a machine",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a machine",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel machine 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"}]},{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, machines, 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 machine",auth:"jwt"}]},{title:"admin — machines",prefix:"/api/admin/machines",endpoints:[{method:"GET",path:"",description:"list all machines (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update machine 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:s}){const[a,i]=o.useState(!1),{t:r}=n();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-3 px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)]",onClick:()=>i(!a),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",children:[s,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),a&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] 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-[10px]",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-[10px] 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-[10px] 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:s}=n();return p(o.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"}),s("access_tokens.create_token")]}),[e,s])),t.jsxs("div",{className:"mx-auto max-w-4xl 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:s("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:s("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(a=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",a.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:a.endpoints.map((i,r)=>t.jsx(x,{ep:i,prefix:a.prefix},`${i.method}-${i.path}-${r}`))})]},a.title))})]})}export{g as default};
@@ -1,11 +1,6 @@
1
- import{c as h,a as S,r,f as k,j as e,i as L}from"./index-bdjBPTjT.js";import{S as E}from"./Select-DobTn2ab.js";import{E as T}from"./EmptyState-B5jMtmkr.js";import{T as F}from"./Skeleton-D-ZoNR01.js";import{S as A}from"./scroll-text-DvCW6HuW.js";/**
1
+ import{c as C,a as S,r,f as k,j as e,i as L}from"./index-BTxGPsOB.js";import{S as E}from"./Select-cAwdx-J1.js";import{E as T}from"./EmptyState-BQ2BNVJS.js";import{T as F}from"./Skeleton-DkwMPaZ1.js";import{S as A}from"./scroll-text-C8HTue-V.js";import{C as P}from"./chevron-right-Dv5NEUXH.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const P=h("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
7
- * @license lucide-react v0.469.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const I=h("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);function U(){const{t:a}=S(),v=[{value:"",label:a("admin.all_actions")},{value:"login",label:a("admin.action_login")},{value:"logout",label:a("admin.action_logout")},{value:"create",label:a("admin.action_create")},{value:"update",label:a("admin.action_update")},{value:"delete",label:a("admin.action_delete")},{value:"revoke",label:a("admin.action_revoke")},{value:"reset_2fa",label:a("admin.action_reset_2fa")},{value:"generate_token",label:a("admin.action_generate_token")}],[d,b]=r.useState([]),[f,u]=r.useState(!0),[o,g]=r.useState(""),[n,j]=r.useState(""),[N,c]=r.useState(void 0),[x,m]=r.useState([]),[l,y]=r.useState(void 0),i=r.useCallback(async t=>{try{u(!0);const s={limit:"50"};t&&(s.cursor=t),o&&(s.action=o),n&&(s.user=n);const p=await k.get("admin/audit-logs",{searchParams:s}).json();b(p.data),y(p.nextCursor)}catch{}finally{u(!1)}},[o,n]);r.useEffect(()=>{c(void 0),m([]),i()},[i]);const _=()=>{l&&(m(t=>[...t,N??""]),c(l),i(l))},w=()=>{if(x.length===0)return;const t=[...x],s=t.pop();m(t),c(s||void 0),i(s||void 0)},C=t=>t.startsWith("delete")||t==="revoke"?"text-red-400":t.startsWith("create")||t==="generate_token"?"text-green-400":t.startsWith("update")||t==="reset_2fa"?"text-yellow-400":t==="login"?"text-blue-400":"text-[var(--text-secondary)]";return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.audit_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.audit_subtitle")})]}),e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx(E,{value:o,onChange:g,options:v}),e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(L,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.filter_by_user"),value:n,onChange:t=>j(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),f?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(F,{rows:5})}):d.length===0?e.jsx(T,{icon:A,title:a("admin.no_audit_entries"),description:a("admin.audit_logs_appear")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"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:"pb-2 pr-4 font-normal",children:a("admin.timestamp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.user_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.action")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.resource")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.detail")}),e.jsx("th",{className:"pb-2 font-normal",children:a("admin.ip")})]})}),e.jsx("tbody",{children:d.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"whitespace-nowrap py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleString()}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.userId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:C(t.action),children:t.action})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.resource}),e.jsx("td",{className:"max-w-xs truncate py-2.5 pr-4 text-[var(--text-muted)]",children:t.detail}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:t.ip})]},t.id))})]})}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("admin.showing_entries",{count:String(d.length)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",disabled:x.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:w,children:[e.jsx(P,{className:"h-3.5 w-3.5"}),a("common.previous")]}),e.jsxs("button",{type:"button",disabled:!l,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:_,children:[a("common.next"),e.jsx(I,{className:"h-3.5 w-3.5"})]})]})]})]})]})}export{U as default};
6
+ */const I=C("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function q(){const{t:a}=S(),v=[{value:"",label:a("admin.all_actions")},{value:"login",label:a("admin.action_login")},{value:"logout",label:a("admin.action_logout")},{value:"create",label:a("admin.action_create")},{value:"update",label:a("admin.action_update")},{value:"delete",label:a("admin.action_delete")},{value:"revoke",label:a("admin.action_revoke")},{value:"reset_2fa",label:a("admin.action_reset_2fa")},{value:"generate_token",label:a("admin.action_generate_token")}],[d,h]=r.useState([]),[b,u]=r.useState(!0),[o,f]=r.useState(""),[n,g]=r.useState(""),[j,c]=r.useState(void 0),[x,m]=r.useState([]),[l,N]=r.useState(void 0),i=r.useCallback(async t=>{try{u(!0);const s={limit:"50"};t&&(s.cursor=t),o&&(s.action=o),n&&(s.user=n);const p=await k.get("admin/audit-logs",{searchParams:s}).json();h(p.data),N(p.nextCursor)}catch{}finally{u(!1)}},[o,n]);r.useEffect(()=>{c(void 0),m([]),i()},[i]);const y=()=>{l&&(m(t=>[...t,j??""]),c(l),i(l))},_=()=>{if(x.length===0)return;const t=[...x],s=t.pop();m(t),c(s||void 0),i(s||void 0)},w=t=>t.startsWith("delete")||t==="revoke"?"text-red-400":t.startsWith("create")||t==="generate_token"?"text-green-400":t.startsWith("update")||t==="reset_2fa"?"text-yellow-400":t==="login"?"text-blue-400":"text-[var(--text-secondary)]";return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.audit_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.audit_subtitle")})]}),e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx(E,{value:o,onChange:f,options:v}),e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(L,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.filter_by_user"),value:n,onChange:t=>g(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),b?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(F,{rows:5})}):d.length===0?e.jsx(T,{icon:A,title:a("admin.no_audit_entries"),description:a("admin.audit_logs_appear")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"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:"pb-2 pr-4 font-normal",children:a("admin.timestamp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.user_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.action")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.resource")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.detail")}),e.jsx("th",{className:"pb-2 font-normal",children:a("admin.ip")})]})}),e.jsx("tbody",{children:d.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"whitespace-nowrap py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleString()}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.userId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:w(t.action),children:t.action})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.resource}),e.jsx("td",{className:"max-w-xs truncate py-2.5 pr-4 text-[var(--text-muted)]",children:t.detail}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:t.ip})]},t.id))})]})}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("admin.showing_entries",{count:String(d.length)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",disabled:x.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:_,children:[e.jsx(I,{className:"h-3.5 w-3.5"}),a("common.previous")]}),e.jsxs("button",{type:"button",disabled:!l,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:y,children:[a("common.next"),e.jsx(P,{className:"h-3.5 w-3.5"})]})]})]})]})]})}export{q as default};
@@ -1,4 +1,4 @@
1
- import{c as M,a as B,r as a,j as e,X as I,f as _,l as z,t as K}from"./index-bdjBPTjT.js";import{S as P}from"./Select-DobTn2ab.js";import{T as $}from"./trash-2-Z9HHaMPB.js";import{P as D}from"./plus-CS3VSUw-.js";import{E as q}from"./EmptyState-B5jMtmkr.js";import{T}from"./Skeleton-D-ZoNR01.js";import{B as F}from"./bot-KOWEPW_6.js";import{P as O}from"./pencil-DgTA8lMR.js";/**
1
+ import{c as M,a as B,r as a,j as e,X as I,f as _,l as z,t as K}from"./index-BTxGPsOB.js";import{S as P}from"./Select-cAwdx-J1.js";import{T as $}from"./trash-2-Bzd6fyHf.js";import{P as D}from"./plus-Cm_mqbAL.js";import{E as q}from"./EmptyState-BQ2BNVJS.js";import{T}from"./Skeleton-DkwMPaZ1.js";import{B as F}from"./bot-BMG_Lak4.js";import{P as O}from"./pencil-BtnOFy3d.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,8 @@
1
+ import{d as l,a as c,h as p,r as d,j as e,C as m}from"./index-BTxGPsOB.js";import{Q as v}from"./QuickAuth-CoRuLOkE.js";import{P as u}from"./plus-Cm_mqbAL.js";import{C as x}from"./copy-C0vNNRrm.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
+ > Overlord server URL: http://localhost:9000
3
+ > Personal Access Token: ov_pat_xxxxx
4
+ ✓ Connected to http://localhost:9000
5
+ ✓ Authenticated as admin (admin)`},{command:"ov login",description:"authenticate with the overlord server using a personal access token",usage:"ov login",example:`ov login
6
+ > Enter server URL: http://localhost:9000
7
+ > Enter PAT: ov_pat_xxxxx
8
+ ✓ Logged in as admin`},{command:"ov logout",description:"clear stored credentials",usage:"ov logout"},{command:"ov whoami",description:"show current authenticated user",usage:"ov whoami"},{command:"ov task create",description:"create a new task",usage:"ov task create -d <description> [-p <project>] [--on <machine>]",flags:[{flag:"-d, --description",desc:"task description (required unless -f)"},{flag:"-p, --project",desc:"project key to assign the task to"},{flag:"--on",desc:"target machine id (optional)"},{flag:"-f, --file",desc:"create task from yaml file"}],example:'ov task create -d "fix login bug" -p overlord'},{command:"ov task list",description:"list all tasks with optional filters",usage:"ov task list [--status <status>] [-p <project>]",flags:[{flag:"--status",desc:"filter by status (RUNNING, QUEUED, COMPLETED, FAILED, CANCELLED)"},{flag:"-p, --project",desc:"filter by project key"}]},{command:"ov task show <id>",description:"show detailed information about a task",usage:"ov task show <task_id>"},{command:"ov task cancel <id>",description:"cancel a running or queued task",usage:"ov task cancel <task_id>"},{command:"ov task retry <id>",description:"retry a failed task",usage:"ov task retry <task_id>"},{command:"ov task logs <id>",description:"view task logs (streams via pty if active, fetches historical otherwise)",usage:"ov task logs <task_id> [--json]",flags:[{flag:"--json",desc:"output as json"}]},{command:"ov task confirm <id>",description:"confirm a suspended task stage",usage:"ov task confirm <task_id> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to confirm (required)"}]},{command:"ov task choose <id> <option>",description:"submit a choice for a suspended task",usage:"ov task choose <task_id> <option> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to respond to (required)"}]},{command:"ov task input <id> <text>",description:"submit text input for a suspended task",usage:"ov task input <task_id> <text> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to respond to (required)"}]},{command:"ov attach <id>",description:"connect to a task pty terminal",usage:"ov attach <task_id> [--watch] [--takeover] [--session <id>]",flags:[{flag:"--watch",desc:"read-only observer mode"},{flag:"--takeover",desc:"take over pty control from current user"},{flag:"--session <id>",desc:"session id for takeover"}]},{command:"ov project list",description:"list all projects",usage:"ov project list"},{command:"ov project show <key>",description:"show project details",usage:"ov project show <project_key>"},{command:"ov machine list",description:"list all registered machines",usage:"ov machine list"},{command:"ov machine show <id>",description:"show machine details",usage:"ov machine show <machine_id>"},{command:"ov notifications",description:"view your notifications",usage:"ov notifications [--all] [--json]",flags:[{flag:"--all",desc:"show all notifications (including read)"},{flag:"--json",desc:"output as json"}]},{command:"ov notifications read <id>",description:"mark a notification as read",usage:"ov notifications read <notification_id>"},{command:"ov search <query>",description:"search across tasks, machines, and projects",usage:"ov search <query>"},{command:"ov config set <key> <value>",description:"set a configuration value",usage:"ov config set <key> <value>",flags:[{flag:"server",desc:"overlord server url"},{flag:"default-project",desc:"default project key"},{flag:"output-format",desc:"output format (table, json)"},{flag:"color",desc:"enable/disable color (true/false)"}]},{command:"ov config get <key>",description:"get a configuration value",usage:"ov config get <key>"},{command:"ov config list",description:"list all configuration values",usage:"ov config list [--json]"},{command:"ov status",description:"show server connectivity, current user, and cluster overview",usage:"ov status [--json]"},{command:"ov upgrade",description:"upgrade ov cli to the latest version",usage:"ov upgrade"}],h=[{command:"overlord install",description:"interactive server installation wizard — checks environment, configures database, creates admin account",usage:"overlord install"},{command:"overlord setup worker",description:"interactive worker setup wizard — configures connection, writes .env, registers service",usage:"overlord setup worker"},{command:"overlord start [component]",description:"start server or worker services (systemd / launchd)",usage:"overlord start [server|worker]"},{command:"overlord stop [component]",description:"stop running processes",usage:"overlord stop [server|worker]"},{command:"overlord status",description:"show process status table (pid, cpu, memory, uptime)",usage:"overlord status"},{command:"overlord logs [component]",description:"view server or worker logs",usage:"overlord logs [server|worker] [--lines <n>]"},{command:"overlord doctor",description:"run system diagnostics",usage:"overlord doctor"},{command:"overlord upgrade",description:"upgrade to latest release with sha256 verification",usage:"overlord upgrade [--version <tag>]"}];function i({text:a}){const[t,o]=d.useState(!1),{t:s}=c();return e.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(a),o(!0),setTimeout(()=>o(!1),2e3)},className:"rounded-[4px] p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",title:s("common.copy"),children:t?e.jsx(m,{className:"h-3 w-3 text-[var(--accent)]"}):e.jsx(x,{className:"h-3 w-3"})})}function n({title:a,commands:t}){const{t:o}=c();return e.jsxs("div",{children:[e.jsxs("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:["> ",a]}),e.jsx("div",{className:"space-y-3",children:t.map(s=>e.jsxs("details",{className:"group rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("summary",{className:"flex cursor-pointer items-center justify-between px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:s.command}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.description]})]})}),e.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:o("docs.usage")}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--text-primary)]",children:s.usage}),e.jsx(i,{text:s.usage})]})]}),s.flags&&s.flags.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:o("docs.flags")}),e.jsx("div",{className:"space-y-1",children:s.flags.map(r=>e.jsxs("div",{className:"flex items-start gap-3 text-xs",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:r.flag}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:r.desc})]},r.flag))})]}),s.example&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:o("docs.example")}),e.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-secondary)] whitespace-pre-wrap",children:s.example})]})]})]},s.command))})]})}function w(){const a=l(),{t}=c();return p(d.useMemo(()=>e.jsxs("button",{onClick:()=>a("/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:[e.jsx(u,{className:"h-3.5 w-3.5"}),t("access_tokens.create_token")]}),[a,t])),e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("docs.cli_tools_desc",{ov:"ov",overlord:"overlord"})})}),e.jsx(v,{mode:"cli"}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("docs.quick_start")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"1. install"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"npm install -g @overlordai/developer-cli"}),e.jsx(i,{text:"npm install -g @overlordai/developer-cli"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"2. setup"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"ov setup"}),e.jsx(i,{text:"ov setup"})]})]})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(n,{title:t("docs.developer_cli"),commands:g}),e.jsx(n,{title:t("docs.admin_cli"),commands:h})]})]})}export{w as default};
@@ -1,4 +1,4 @@
1
- import{c as k,a as _,r as s,j as e,X as S,f as w,u as E,i as M}from"./index-bdjBPTjT.js";import{S as D}from"./Select-DobTn2ab.js";import{E as O}from"./EmptyState-B5jMtmkr.js";import{T}from"./Skeleton-D-ZoNR01.js";import{P}from"./plus-CS3VSUw-.js";import{U as q}from"./users-yEz_0v7L.js";import{P as $}from"./pencil-DgTA8lMR.js";import{R as F}from"./rotate-ccw-e6dKDLQp.js";/**
1
+ import{c as k,a as _,r as s,j as e,X as S,f as w,u as E,i as M}from"./index-BTxGPsOB.js";import{S as D}from"./Select-cAwdx-J1.js";import{E as O}from"./EmptyState-BQ2BNVJS.js";import{T}from"./Skeleton-DkwMPaZ1.js";import{P}from"./plus-Cm_mqbAL.js";import{U as q}from"./users-DmYD60pt.js";import{P as $}from"./pencil-BtnOFy3d.js";import{R as F}from"./rotate-ccw-Di9lk9Jq.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{m as ne,d as oe,a as le,r as a,f as u,j as e,L as ce,t as y}from"./index-bdjBPTjT.js";import{G as m,A as d}from"./protocol-C4f2G7mk.js";import{S as W}from"./Select-DobTn2ab.js";import{U as de,A as ie,R as pe}from"./RemoveMemberConfirmDialog-Dpvy8p31.js";import{P as xe}from"./plus-CS3VSUw-.js";function ge(){const{key:o}=ne(),l=oe(),{t:r}=le(),[n,X]=a.useState(null),[N,Q]=a.useState([]),[V,Y]=a.useState(!0),[C,b]=a.useState(!1),[v,w]=a.useState(""),[j,S]=a.useState(""),[_,k]=a.useState(m.GITHUB),[T,M]=a.useState(""),[O,P]=a.useState(d.CLAUDE),[R,A]=a.useState(""),[I,U]=a.useState("50"),[D,E]=a.useState(""),[$,G]=a.useState(""),[L,B]=a.useState(""),[F,J]=a.useState("0"),[g,q]=a.useState(!1),[i,h]=a.useState(""),[Z,z]=a.useState(!1),[c,f]=a.useState(null),[ee,H]=a.useState(!1),p=a.useCallback(async()=>{if(o)try{const[t,x]=await Promise.all([u.get(`web/projects/${o}`).json(),u.get(`admin/projects/${o}/members`).json().catch(()=>[])]);if(X(t),Q(x),w(t.name),S(t.repoUrl),k(t.gitPlatform),M(t.defaultBranch),P(t.agentType),A(t.agentCommand??""),U(String(t.maxTurns)),E(t.workspaceRoot??""),G(t.setupCommands??""),B(t.testCommand??""),J(String(t.ptyOutputFilter??0)),q(t.isDefault),t.pipeline)try{h(JSON.stringify(JSON.parse(t.pipeline),null,2))}catch{h(t.pipeline)}}catch{}finally{Y(!1)}},[o]);a.useEffect(()=>{p()},[p]);async function te(t){if(t.preventDefault(),!n)return;b(!0);let x=null;if(i.trim())try{JSON.parse(i),x=i.trim()}catch{y.error(r("projects.invalid_pipeline_json")),b(!1);return}try{await u.put(`admin/projects/${n.key}`,{json:{name:v,repoUrl:j,defaultBranch:T,gitPlatform:_,agentType:O,agentCommand:R||null,maxTurns:parseInt(I,10)||50,workspaceRoot:D||null,setupCommands:$||null,testCommand:L||null,ptyOutputFilter:parseInt(F,10)||0,pipeline:x}}),y.success(r("projects.project_saved")),l(`/projects/${n.key}`)}catch(K){const se=K instanceof Error?K.message:r("projects.failed_to_save_project");y.error(se)}finally{b(!1)}}function re(){l(`/projects/${o}`)}async function ae(){if(!(!n||!c)){H(!0);try{await u.delete(`admin/projects/${n.key}/members`,{searchParams:{developerId:String(c.developerId)}}),await p()}catch{}finally{H(!1),f(null)}}}return V?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)]"})}):n?e.jsxs("form",{onSubmit:te,className:"mx-auto max-w-6xl 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/${n.key}`),children:n.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:n.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:v,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.jsx(s,{label:r("projects.repo_url"),children:e.jsx("input",{type:"text",value:j,onChange:t=>S(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.git_platform"),children:e.jsx(W,{value:_,onChange:t=>k(t),options:[{value:m.GITHUB,label:r("projects.github")},{value:m.GITLAB,label:r("projects.gitlab")},{value:m.GITEA,label:r("projects.gitea")}]})}),e.jsx(s,{label:r("projects.default_branch"),children:e.jsx("input",{type:"text",value:T,onChange:t=>M(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(W,{value:O,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=>A(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:I,onChange:t=>U(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=>E(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:$,onChange:t=>G(t.target.value),rows:3,placeholder:`npm install
1
+ import{m as ne,d as oe,a as le,r as a,f as u,j as e,L as ce,t as y}from"./index-BTxGPsOB.js";import{G as m,A as d}from"./protocol-C4f2G7mk.js";import{S as W}from"./Select-cAwdx-J1.js";import{U as de,A as ie,R as pe}from"./RemoveMemberConfirmDialog-C-UcPD2-.js";import{P as xe}from"./plus-Cm_mqbAL.js";function ge(){const{key:o}=ne(),l=oe(),{t:r}=le(),[n,X]=a.useState(null),[N,Q]=a.useState([]),[V,Y]=a.useState(!0),[C,b]=a.useState(!1),[v,w]=a.useState(""),[j,S]=a.useState(""),[_,k]=a.useState(m.GITHUB),[T,M]=a.useState(""),[O,P]=a.useState(d.CLAUDE),[R,A]=a.useState(""),[I,U]=a.useState("50"),[D,E]=a.useState(""),[$,G]=a.useState(""),[L,B]=a.useState(""),[F,J]=a.useState("0"),[g,q]=a.useState(!1),[i,h]=a.useState(""),[Z,z]=a.useState(!1),[c,f]=a.useState(null),[ee,H]=a.useState(!1),p=a.useCallback(async()=>{if(o)try{const[t,x]=await Promise.all([u.get(`web/projects/${o}`).json(),u.get(`web/projects/${o}/members`).json().catch(()=>[])]);if(X(t),Q(x),w(t.name),S(t.repoUrl),k(t.gitPlatform),M(t.defaultBranch),P(t.agentType),A(t.agentCommand??""),U(String(t.maxTurns)),E(t.workspaceRoot??""),G(t.setupCommands??""),B(t.testCommand??""),J(String(t.ptyOutputFilter??0)),q(t.isDefault),t.pipeline)try{h(JSON.stringify(JSON.parse(t.pipeline),null,2))}catch{h(t.pipeline)}}catch{}finally{Y(!1)}},[o]);a.useEffect(()=>{p()},[p]);async function te(t){if(t.preventDefault(),!n)return;b(!0);let x=null;if(i.trim())try{JSON.parse(i),x=i.trim()}catch{y.error(r("projects.invalid_pipeline_json")),b(!1);return}try{await u.put(`web/projects/${n.key}`,{json:{name:v,repoUrl:j,defaultBranch:T,gitPlatform:_,agentType:O,agentCommand:R||null,maxTurns:parseInt(I,10)||50,workspaceRoot:D||null,setupCommands:$||null,testCommand:L||null,ptyOutputFilter:parseInt(F,10)||0,pipeline:x}}),y.success(r("projects.project_saved")),l(`/projects/${n.key}`)}catch(K){const se=K instanceof Error?K.message:r("projects.failed_to_save_project");y.error(se)}finally{b(!1)}}function re(){l(`/projects/${o}`)}async function ae(){if(!(!n||!c)){H(!0);try{await u.delete(`web/projects/${n.key}/members`,{searchParams:{developerId:String(c.developerId)}}),await p()}catch{}finally{H(!1),f(null)}}}return V?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)]"})}):n?e.jsxs("form",{onSubmit:te,className:"mx-auto max-w-6xl 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/${n.key}`),children:n.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:n.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:v,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.jsx(s,{label:r("projects.repo_url"),children:e.jsx("input",{type:"text",value:j,onChange:t=>S(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.git_platform"),children:e.jsx(W,{value:_,onChange:t=>k(t),options:[{value:m.GITHUB,label:r("projects.github")},{value:m.GITLAB,label:r("projects.gitlab")},{value:m.GITEA,label:r("projects.gitea")}]})}),e.jsx(s,{label:r("projects.default_branch"),children:e.jsx("input",{type:"text",value:T,onChange:t=>M(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(W,{value:O,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=>A(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:I,onChange:t=>U(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=>E(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:$,onChange:t=>G(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:L,onChange:t=>B(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.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.pty_output_filter"),children:e.jsx("input",{type:"text",value:F,onChange:t=>J(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.jsx(s,{label:r("projects.git_clean"),children:e.jsx("button",{type:"button",onClick:()=>q(!g),className:`relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors ${g?"bg-[var(--accent)]":"bg-[var(--border)]"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${g?"translate-x-6":"translate-x-1"}`})})})]})]})]}),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(ce,{to:"/projects/"+o+"/pipeline",className:"text-xs text-[var(--accent)] hover:underline",children:r("projects.edit_pipeline")})]}),e.jsx("textarea",{value:i,onChange:t=>h(t.target.value),rows:20,spellCheck:!1,placeholder:'{"stages": [], "defaults": {}}',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(xe,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),N.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:N.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:String(t.developerId).charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-xs text-[var(--text-primary)]",children:["#",t.developerId]}),e.jsx("span",{className:"ml-2 rounded-[4px] px-1.5 py-0.5 text-[10px] font-medium",style:{color:t.role==="maintainer"?"var(--warning)":"var(--text-secondary)",background:t.role==="maintainer"?"rgba(245,158,11,0.1)":"rgba(163,163,163,0.1)"},children:t.role})]})]}),e.jsx("button",{type:"button",onClick:()=>f(t),className:"text-[var(--destructive)] hover:opacity-70 transition-opacity","aria-label":r("projects.remove_member"),children:e.jsx(de,{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:re,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:C||!v||!j,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(C?"common.saving":"projects.save_changes")})]}),e.jsx(ie,{isOpen:Z,onClose:()=>z(!1),projectKey:n.key,onAdded:p}),e.jsx(pe,{isOpen:!!c,onClose:()=>f(null),onConfirm:ae,memberName:c?String(c.developerId):"",loading:ee})]}):e.jsxs("div",{className:"mx-auto max-w-4xl 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:o,children:l}){return e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("label",{className:"w-36 shrink-0 pt-2 text-xs text-[var(--text-muted)]",children:o}),e.jsx("div",{className:"flex-1",children:l})]})}export{ge as default};
@@ -1,4 +1,4 @@
1
- import{c as o,j as e}from"./index-bdjBPTjT.js";/**
1
+ import{c as o,j as e}from"./index-BTxGPsOB.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{u as I,r as i,j as e,X as z,C as X,L as N,d as Q,a as $,f as u}from"./index-BTxGPsOB.js";import{M as h}from"./protocol-C4f2G7mk.js";import{T as A}from"./TaskStatusBadge-B6pZ1mXD.js";import{T as w}from"./Skeleton-DkwMPaZ1.js";import{C as U}from"./chevron-right-Dv5NEUXH.js";import{A as S}from"./arrow-right-B4SWX5QX.js";function W(){return[{id:"admin_create_project",title:"create your first project",description:"set up a project with a git repo and pipeline",link:"/projects",linkLabel:"go to projects",autoDetect:!0},{id:"admin_register_worker",title:"register a worker machine",description:"generate a token and set up a worker to run tasks",link:"/machines",linkLabel:"go to machines",autoDetect:!0},{id:"admin_create_developer",title:"create a developer account",description:"add team members who can create and monitor tasks",link:"/admin/developers",linkLabel:"manage developers",autoDetect:!0},{id:"admin_first_task",title:"create your first task",description:"verify the full pipeline works end-to-end",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}function Z(){return[{id:"lead_view_projects",title:"view your projects",description:"check the projects assigned to you",link:"/projects",linkLabel:"go to projects"},{id:"lead_configure_pipeline",title:"configure a pipeline",description:"set up stages for your project workflow",link:"/projects",linkLabel:"go to projects"},{id:"lead_add_member",title:"add a team member",description:"invite developers to your project",link:"/projects",linkLabel:"go to projects"},{id:"lead_first_task",title:"create your first task",description:"submit a task and watch it execute",link:"/tasks",linkLabel:"go to tasks"}]}function ee(){return[{id:"dev_install_cli",title:"install the ov cli",description:"npm install -g @overlordai/developer-cli",link:"/docs/cli",linkLabel:"cli reference"},{id:"dev_setup_cli",title:"run ov setup",description:"connect to the server and authenticate",link:"/docs/cli",linkLabel:"setup guide"},{id:"dev_view_projects",title:"explore projects",description:"browse available projects and their pipelines",link:"/projects",linkLabel:"go to projects"},{id:"dev_first_task",title:"create your first task",description:"submit a task via web or cli",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}const O="overlord_onboarding";function te(){try{const n=localStorage.getItem(O);if(n)return JSON.parse(n)}catch{}return{dismissed:!1,completed:{}}}function E(n){localStorage.setItem(O,JSON.stringify(n))}function se({data:n}){const s=I(r=>{var c;return(c=r.user)==null?void 0:c.role}),[o,a]=i.useState(te),d=s==="admin"?W():s==="lead"||s==="maintainer"?Z():ee(),l=i.useCallback(r=>{if(o.completed[r.id])return!0;if(!r.autoDetect)return!1;switch(r.id){case"admin_create_project":return n.totalProjects>0;case"admin_register_worker":return n.totalMachines>0;case"admin_create_developer":return n.totalDevelopers>1;case"admin_first_task":case"dev_first_task":return n.activeTasks>0;default:return!1}},[o.completed,n]),x=d.filter(l).length,p=x===d.length,k=i.useCallback(r=>{a(c=>{const f={...c,completed:{...c.completed,[r]:!c.completed[r]}};return E(f),f})},[]),v=i.useCallback(()=>{a(r=>{const c={...r,dismissed:!0};return E(c),c})},[]);if(o.dismissed)return null;const b=Math.round(x/d.length*100);return e.jsxs("div",{className:"mb-6 md:mb-8 rounded-[4px] border border-[var(--accent)]/30 bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:"// getting started"}),e.jsxs("span",{className:"text-[10px] text-[var(--text-muted)]",children:[x,"/",d.length," completed"]})]}),e.jsx("button",{onClick:v,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",title:"dismiss",children:e.jsx(z,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"h-0.5 bg-[var(--border)]",children:e.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-500",style:{width:`${b}%`}})}),e.jsx("div",{className:"divide-y divide-[var(--border)]",children:d.map(r=>{const c=l(r);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("button",{onClick:()=>!r.autoDetect&&k(r.id),className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors ${c?"border-[var(--accent)] bg-[var(--accent)]":"border-[var(--border)] hover:border-[var(--text-muted)]"} ${r.autoDetect?"cursor-default":"cursor-pointer"}`,children:c&&e.jsx(X,{className:"h-2.5 w-2.5 text-black"})}),e.jsxs("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:`text-xs ${c?"text-[var(--text-muted)] line-through":"text-[var(--text-primary)]"}`,children:r.title}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)] truncate",children:r.description})]}),r.link&&!c&&e.jsxs(N,{to:r.link,className:"ml-3 flex shrink-0 items-center gap-1 text-[10px] text-[var(--accent)] hover:underline",children:[r.linkLabel," ",e.jsx(U,{className:"h-3 w-3"})]})]})]},r.id)})}),p&&e.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 text-center",children:[e.jsx("span",{className:"text-xs text-[var(--accent)]",children:"all set! you're ready to go."}),e.jsx("button",{onClick:v,className:"ml-3 text-[10px] text-[var(--text-muted)] underline hover:text-[var(--text-primary)]",children:"dismiss"})]})]})}const ae=3e4,re=[{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"}],ne=["mon","tue","wed","thu","fri","sat","sun"];function L(n){const s=Date.now(),o=new Date(n).getTime(),a=s-o,d=Math.floor(a/6e4);if(d<1)return"just now";if(d<60)return`${d}m ago`;const l=Math.floor(d/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function ie(n,s){return n.length<=s?n:n.slice(0,s)+"..."}function le({dailyRates:n,overallRate:s}){const{t:o}=$(),a=ne.map((l,x)=>({label:l,value:n[x]??0})),d=Math.max(...a.map(l=>l.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:[s,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:a.map(l=>{const x=d>0?Math.max(l.value/d*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:`${x}%`,backgroundColor:l.value>=80?"var(--accent)":l.value>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[10px] text-[var(--text-muted)]",children:l.label})]},l.label)})})]})}function he(){const n=Q(),{t:s}=$(),o=I(t=>{var m;return((m=t.user)==null?void 0:m.role)==="admin"}),[a,d]=i.useState(null),[l,x]=i.useState([]),[p,k]=i.useState([]),[v,b]=i.useState([]),[r,c]=i.useState(0),[f,F]=i.useState(0),[C,K]=i.useState(!0),[P,G]=i.useState(!0),[q,B]=i.useState(!0),[H,J]=i.useState(!0),j=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/stats").json();d(t)}catch{}finally{K(!1)}},[]),g=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json();x(t)}catch{}finally{G(!1)}},[]),D=i.useCallback(async()=>{try{const t=await u.get("web/machines").json();k(t)}catch{}finally{B(!1)}},[]),M=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-activity").json();b(t)}catch{b([])}finally{J(!1)}},[]);i.useEffect(()=>{j(),g(),D(),M(),u.get("web/projects").json().then(t=>c(t.length)).catch(()=>{}),o&&u.get("admin/developers").json().then(t=>F(t.length)).catch(()=>{})},[j,g,D,M,o]);const y=i.useRef(null);i.useEffect(()=>(y.current=setInterval(()=>{j(),g()},ae),()=>{y.current&&clearInterval(y.current)}),[j,g]);const R=(a==null?void 0:a.success_rate_daily)??null,T=(a==null?void 0:a.task_success_rate_7d)??0;function V(t){switch(t){case h.ONLINE:return"var(--accent)";case h.DRAINING:return"var(--warning)";case h.OFFLINE:default:return"var(--text-muted)"}}function Y(t){switch(t){case h.ONLINE:return s("dashboard.online");case h.DRAINING:return s("dashboard.idle");case h.OFFLINE:default:return s("dashboard.offline")}}return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 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:["// ",s("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:re.map(({key:t,labelKey:m})=>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-[9px] md:text-xs text-[var(--text-muted)]",children:[s(m),":"]}),C?e.jsx("div",{className:"mt-1 h-6 md:h-8 w-12 md:w-16 animate-pulse rounded 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[t])??0})})]},t))}),e.jsx(se,{data:{activeTasks:((a==null?void 0:a.active_tasks)??0)+((a==null?void 0:a.queued_tasks)??0),totalMachines:p.length,totalProjects:r,totalDevelopers:f}}),e.jsxs("div",{className:"mb-6 grid gap-6 lg:grid-cols-3 items-stretch",children:[e.jsx("div",{className:"hidden md: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:s("dashboard.task_success_rate")})}),e.jsx("div",{className:"flex flex-1 flex-col justify-center p-5",children:C?e.jsx("div",{className:"h-24 animate-pulse rounded bg-[var(--bg-input)]"}):R?e.jsx(le,{dailyRates:R,overallRate:T}):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:[T,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("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:s("dashboard.recent_tasks")}),e.jsxs(N,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{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:s("dashboard.recent_tasks")})}),e.jsx("div",{className:"px-3 pb-3 md:p-4",children:P?e.jsx(w,{rows:4}):l.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:s("dashboard.no_tasks_yet")})]}):e.jsx("div",{className:"flex flex-col gap-2 md:gap-0",children:l.map(t=>e.jsxs("div",{onClick:()=>n(`/tasks/${t.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-[10px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",t.id," ",t.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(A,{status:t.status})})]}),e.jsx("span",{className:"text-[9px] text-[var(--text-muted)] mt-1 block",children:L(t.created_at)})]}),e.jsxs("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:["#",t.id]}),e.jsx("span",{className:"hidden md:inline flex-1 text-xs text-[var(--text-primary)] truncate",children:ie(t.description,40)}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(A,{status:t.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:L(t.created_at)})]},t.id))})})]})]}),e.jsxs("div",{className:"hidden md: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:s("dashboard.worker_status")}),e.jsxs(N,{to:"/machines",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:q?e.jsx(w,{rows:3}):p.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:s("dashboard.no_workers_registered")})]}):e.jsx("div",{className:"flex flex-col",children:p.map(t=>e.jsxs("div",{onClick:()=>n(`/machines/${t.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:t.name}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t.host??"--"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:[t.activeSlots,"/",t.maxSlots," ",s("dashboard.slots")]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs",style:{color:V(t.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),Y(t.status)]})]})]},t.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:s("dashboard.recent_activity")}),o&&e.jsxs(N,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:H?e.jsx(w,{rows:4}):v.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:s("dashboard.no_recent_activity")})]}):e.jsx("div",{className:"flex flex-col",children:v.map(t=>{const m=t.message.match(/task\s*#?(\d+)/i),_=m?m[1]:null;return e.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border-row)] py-2 last:border-b-0 ${_?"cursor-pointer hover:bg-[var(--bg-input)] transition-colors":""}`,onClick:()=>_&&n(`/tasks/${_}`),children:[e.jsx("span",{className:"shrink-0 text-xs text-[var(--text-muted)]",children:L(t.timestamp)}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:t.message})]},t.id)})})})]})]})]})}export{he as default};
@@ -1,4 +1,4 @@
1
- import{c as s,r as m,u as h,a as p,j as e,T as g,L as r,b as y,S as v,C as b}from"./index-bdjBPTjT.js";import{A as l}from"./arrow-right-t-l7E3bV.js";import{B as u}from"./bot-KOWEPW_6.js";import{U as f}from"./users-yEz_0v7L.js";import{C as j}from"./copy-fRb9wi57.js";/**
1
+ import{c as s,r as m,u as h,a as p,j as e,T as g,L as r,b as y,S as v,C as b}from"./index-BTxGPsOB.js";import{A as l}from"./arrow-right-B4SWX5QX.js";import{B as u}from"./bot-BMG_Lak4.js";import{U as f}from"./users-DmYD60pt.js";import{C as j}from"./copy-C0vNNRrm.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{d as W,e as q,u as m,a as I,r as c,j as t,N as _}from"./index-bdjBPTjT.js";function P(){var w,B;const h=W(),y=q(),x=m(e=>e.login),v=m(e=>e.requireTotpSetup),k=m(e=>e.user),{t:n}=I(),[C,S]=c.useState("credentials"),[u,F]=c.useState(""),[p,z]=c.useState(""),[i,b]=c.useState(""),[l,g]=c.useState(!1),[j,d]=c.useState(""),f=c.useRef([]);if(k&&!v){let e=(B=(w=y.state)==null?void 0:w.from)==null?void 0:B.pathname;return(e==="/totp-setup"||e==="/login")&&(e=void 0),t.jsx(_,{to:e??"/home",replace:!0})}if(v)return t.jsx(_,{to:"/totp-setup",replace:!0});const M=async e=>{var r,o;if(e.preventDefault(),d(""),!u.trim()||!p.trim()){d(n("auth.username_and_password_required"));return}g(!0);try{await x({username:u.trim(),password:p});const a=m.getState();if(a.requireTotpSetup)return;if(a.user){let s=(o=(r=y.state)==null?void 0:r.from)==null?void 0:o.pathname;(s==="/totp-setup"||s==="/login")&&(s=void 0),h(s??"/home",{replace:!0})}}catch(a){const s=a instanceof Error?a.message:n("auth.login_failed");s==="TOTP_REQUIRED"?(S("totp"),d("")):d(s)}finally{g(!1)}},J=async e=>{var r,o;if(e.preventDefault(),d(""),!i.trim()||i.trim().length!==6){d(n("auth.please_enter_valid_6_digit_code"));return}g(!0);try{if(await x({username:u.trim(),password:p,totpCode:i.trim()}),m.getState().user){let s=(o=(r=y.state)==null?void 0:r.from)==null?void 0:o.pathname;(s==="/totp-setup"||s==="/login")&&(s=void 0),h(s??"/home",{replace:!0})}}catch(a){const s=a instanceof Error?a.message:n("auth.invalid_totp_code");d(s)}finally{g(!1)}},R=()=>{S("credentials"),b(""),d("")},T=(e,r)=>{var s;const o=r.replace(/\D/g,"").slice(-1),a=i.split("");for(;a.length<6;)a.push("");a[e]=o,b(a.join("")),o&&e<5&&((s=f.current[e+1])==null||s.focus())},D=(e,r)=>{var o;r.key==="Backspace"&&!i[e]&&e>0&&((o=f.current[e-1])==null||o.focus())},E=e=>{var a;e.preventDefault();const r=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);b(r);const o=Math.min(r.length,5);(a=f.current[o])==null||a.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: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.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.username")}),t.jsx("input",{type:"text",placeholder:n("auth.enter_username"),value:u,onChange:e=>F(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:p,onChange:e=>z(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:l,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:l?"not-allowed":"pointer",opacity:l?.7:1,marginTop:"0.5rem"},children:n(l?"common.signing_in":"auth.sign_in")}),t.jsx("button",{type:"button",onClick:()=>h("/"),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_to_site")})]},"credentials"):t.jsxs("form",{onSubmit:J,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:E,children:Array.from({length:6}).map((e,r)=>t.jsx("input",{ref:o=>{f.current[r]=o},type:"text",inputMode:"numeric",maxLength:1,value:i[r]||"",onChange:o=>T(r,o.target.value),onKeyDown:o=>D(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:l||i.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:l||i.length!==6?"not-allowed":"pointer",opacity:l||i.length!==6?.7:1,marginTop:"0.5rem"},children:n(l?"common.verifying":"auth.verify")}),t.jsx("button",{type:"button",onClick:R,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{P as default};
1
+ import{d as W,e as q,u as m,a as I,r as c,j as t,N as k}from"./index-BTxGPsOB.js";function P(){var w,B;const h=W(),y=q(),x=m(e=>e.login),v=m(e=>e.requireTotpSetup),_=m(e=>e.user),{t:n}=I(),[C,S]=c.useState("credentials"),[u,F]=c.useState(""),[p,z]=c.useState(""),[i,b]=c.useState(""),[l,g]=c.useState(!1),[j,d]=c.useState(""),f=c.useRef([]);if(_&&!v){let e=(B=(w=y.state)==null?void 0:w.from)==null?void 0:B.pathname;return(e==="/totp-setup"||e==="/login")&&(e=void 0),t.jsx(k,{to:e??"/home",replace:!0})}if(v)return t.jsx(k,{to:"/totp-setup",replace:!0});const M=async e=>{var r,o;if(e.preventDefault(),d(""),!u.trim()||!p.trim()){d(n("auth.username_and_password_required"));return}g(!0);try{await x({username:u.trim(),password:p});const a=m.getState();if(a.requireTotpSetup)return;if(a.user){let s=(o=(r=y.state)==null?void 0:r.from)==null?void 0:o.pathname;(s==="/totp-setup"||s==="/login")&&(s=void 0),h(s??"/home",{replace:!0})}}catch(a){const s=a instanceof Error?a.message:n("auth.login_failed");s==="TOTP_REQUIRED"?(S("totp"),d("")):d(s)}finally{g(!1)}},J=async e=>{var r,o;if(e.preventDefault(),d(""),!i.trim()||i.trim().length!==6){d(n("auth.please_enter_valid_6_digit_code"));return}g(!0);try{if(await x({username:u.trim(),password:p,totpCode:i.trim()}),m.getState().user){let s=(o=(r=y.state)==null?void 0:r.from)==null?void 0:o.pathname;(s==="/totp-setup"||s==="/login")&&(s=void 0),h(s??"/home",{replace:!0})}}catch(a){const s=a instanceof Error?a.message:n("auth.invalid_totp_code");d(s)}finally{g(!1)}},R=()=>{S("credentials"),b(""),d("")},T=(e,r)=>{var s;const o=r.replace(/\D/g,"").slice(-1),a=i.split("");for(;a.length<6;)a.push("");a[e]=o,b(a.join("")),o&&e<5&&((s=f.current[e+1])==null||s.focus())},D=(e,r)=>{var o;r.key==="Backspace"&&!i[e]&&e>0&&((o=f.current[e-1])==null||o.focus())},E=e=>{var a;e.preventDefault();const r=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);b(r);const o=Math.min(r.length,5);(a=f.current[o])==null||a.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: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.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.username")}),t.jsx("input",{type:"text",placeholder:n("auth.enter_username"),value:u,onChange:e=>F(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:p,onChange:e=>z(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:l,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:l?"not-allowed":"pointer",opacity:l?.7:1,marginTop:"0.5rem"},children:n(l?"common.signing_in":"auth.sign_in")}),t.jsx("button",{type:"button",onClick:()=>h("/"),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:J,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:E,children:Array.from({length:6}).map((e,r)=>t.jsx("input",{ref:o=>{f.current[r]=o},type:"text",inputMode:"numeric",maxLength:1,value:i[r]||"",onChange:o=>T(r,o.target.value),onKeyDown:o=>D(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:l||i.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:l||i.length!==6?"not-allowed":"pointer",opacity:l||i.length!==6?.7:1,marginTop:"0.5rem"},children:n(l?"common.verifying":"auth.verify")}),t.jsx("button",{type:"button",onClick:R,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{P as default};
@@ -0,0 +1 @@
1
+ import{a as S,j as e,l as I,m as M,d as T,r as o,h as A,f as v,L as G,s as U}from"./index-BTxGPsOB.js";import{M as x,T as d}from"./protocol-C4f2G7mk.js";import{A as w}from"./arrow-left-B701wpRZ.js";function _({isOpen:t,onClose:r,onConfirm:a,machineName:s,isDraining:i,loading:m}){const{t:l}=S();return e.jsx(I,{isOpen:t,onClose:r,onConfirm:a,title:l(i?"machines.undrain_machine_title":"machines.drain_machine_title"),message:i?l("machines.undrain_confirm",{name:s}):l("machines.drain_confirm",{name:s}),confirmLabel:l(i?"machines.undrain":"machines.drain"),confirmVariant:i?"accent":"warning",isLoading:m})}const O={[x.ONLINE]:"var(--accent)",[x.OFFLINE]:"var(--destructive)",[x.DRAINING]:"var(--warning)"},F={[d.QUEUED]:"var(--text-muted)",[d.ASSIGNED]:"#60a5fa",[d.RUNNING]:"var(--accent)",[d.SUSPENDED]:"var(--warning)",[d.COMPLETED]:"var(--accent)",[d.FAILED]:"var(--destructive)",[d.CANCELLED]:"var(--text-muted)"};function k(t){return t?new Date(t).toLocaleString():"n/a"}function R(t){if(!t)return"never";const r=Date.now()-new Date(t).getTime(),a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const s=Math.floor(a/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function D(t){return t>80?"var(--destructive)":t>60?"var(--warning)":"var(--accent)"}function z(){const{id:t}=M(),r=T(),{t:a}=S(),[s,i]=o.useState(null),[m,l]=o.useState([]),[L,E]=o.useState(!0),[g,h]=o.useState(!1),[N,f]=o.useState(!1);A(o.useMemo(()=>!s||s.status===x.OFFLINE||s.status===x.DRAINING?null:e.jsxs("button",{onClick:()=>h(!0),className:"rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",a("machines.drain")]}),[s,a]));const u=o.useCallback(async()=>{if(t)try{const[c,$]=await Promise.all([v.get(`web/machines/${t}`).json(),v.get(`web/machines/${t}/tasks`).json().catch(()=>[])]);i(c),l($)}catch{}finally{E(!1)}},[t]);o.useEffect(()=>{u()},[u]);async function y(){if(s){f(!0);try{const c=s.status===x.DRAINING?"undrain":"drain";await v.post(`web/machines/${s.id}/${c}`),await u()}catch{}finally{f(!1),h(!1)}}}if(L)return e.jsx("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("machines.loading_machine")})});if(!s)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:a("machines.machine_not_found")}),e.jsxs("button",{onClick:()=>r("/machines"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",a("machines.back_to_machines")]})]});const b=s.status===x.DRAINING;return b?e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsx("button",{onClick:()=>r("/machines"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(w,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(G,{to:"/machines",className:"text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:a("machines.title")}),e.jsx("span",{className:"text-[var(--text-muted)]",children:"/"}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.name})]}),e.jsxs("button",{onClick:()=>h(!0),className:"rounded-[4px] border border-[var(--accent)] px-4 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:["> ",a("machines.undrain")]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:"rounded-[4px] bg-[var(--warning)]/20 px-2.5 py-1 text-xs font-medium text-[var(--warning)]",children:a("machines.draining")})}),e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)]/40 bg-[var(--warning)]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(U,{className:"h-3.5 w-3.5 text-[var(--warning)]"}),e.jsx("span",{className:"text-xs text-[var(--warning)]",children:a("machines.draining_warning")})]}),e.jsx("p",{className:"text-xs text-[var(--warning)]/70 ml-5.5",children:a("machines.draining_active_tasks")})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-4",children:[e.jsx(p,{label:a("machines.cpu"),value:s.cpuUsage,unit:"%"}),e.jsx(p,{label:a("machines.memory"),value:s.memoryUsage,unit:"%"}),e.jsx(p,{label:a("machines.disk"),value:s.diskUsage,unit:"%"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("machines.slots")}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[s.activeSlots,"/",s.maxSlots]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.active_tasks")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:m.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:a("machines.no_active_tasks")})]}):e.jsx(C,{tasks:m,navigate:r,t:a})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.capabilities")}),s.capabilities.length>0?e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:s.capabilities.map(c=>e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx("p",{className:"text-xs text-[var(--text-primary)]",children:c})},c))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_capabilities_short")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.machine_info")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(n,{label:a("machines.host"),value:s.host}),e.jsx(n,{label:a("machines.port"),value:String(s.port)}),e.jsx(n,{label:a("machines.os"),value:s.os??a("machines.unknown")}),e.jsx(n,{label:a("machines.cpu_model"),value:s.cpuModel??a("machines.n_a")}),e.jsx(n,{label:a("machines.cpu_cores"),value:s.cpuCores!=null?String(s.cpuCores):a("machines.n_a")}),e.jsx(n,{label:a("machines.memory"),value:s.memoryGb!=null?`${s.memoryGb} gb`:a("machines.n_a")}),e.jsx(n,{label:a("machines.last_heartbeat_label"),value:k(s.lastHeartbeat)}),e.jsx(n,{label:a("machines.slots"),value:`${s.activeSlots}/${s.maxSlots}`}),e.jsx(n,{label:a("machines.status_label"),value:s.status.toLowerCase()}),e.jsx(n,{label:a("machines.worker_version"),value:s.workerVersion??a("machines.n_a")})]})})]}),e.jsx(_,{isOpen:g,onClose:()=>h(!1),onConfirm:y,machineName:s.name,isDraining:b,loading:N})]})]}):e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("button",{onClick:()=>r("/machines"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(w,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),s.status!==x.OFFLINE&&e.jsxs("button",{onClick:()=>h(!0),className:"shrink-0 rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",a("machines.drain")]})]}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsxs("button",{onClick:()=>r("/machines"),className:"mb-4 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["< ",a("machines.back_to_machines")]}),e.jsxs("h1",{className:"mb-2 text-lg font-bold text-[var(--text-primary)] flex items-center gap-2",children:[s.name,e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-normal",style:{color:O[s.status]},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),s.status.toLowerCase()]})]}),e.jsx("p",{className:"mb-6 text-xs text-[var(--text-muted)]",children:a("machines.last_heartbeat",{time:R(s.lastHeartbeat)})}),e.jsxs("div",{className:"mb-6 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.resource_usage")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(j,{label:a("machines.cpu"),value:s.cpuUsage}),e.jsx(j,{label:a("machines.mem"),value:s.memoryUsage}),e.jsx(j,{label:a("machines.disk"),value:s.diskUsage})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.connection_info")}),e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(n,{label:a("machines.host"),value:s.host}),e.jsx(n,{label:a("machines.port"),value:String(s.port)}),e.jsx(n,{label:a("machines.os"),value:s.os??a("machines.unknown")}),e.jsx(n,{label:a("machines.cpu_model"),value:s.cpuModel??a("machines.n_a")}),e.jsx(n,{label:a("machines.cpu_cores"),value:s.cpuCores!=null?String(s.cpuCores):a("machines.n_a")}),e.jsx(n,{label:a("machines.memory"),value:s.memoryGb!=null?`${s.memoryGb} gb`:a("machines.n_a")}),e.jsx(n,{label:a("machines.last_heartbeat_label"),value:k(s.lastHeartbeat)}),e.jsx(n,{label:a("machines.slots"),value:`${s.activeSlots}/${s.maxSlots}`})]})]})]}),s.capabilities.length>0&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.capabilities")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.capabilities.map(c=>e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)]",children:c},c))})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsxs("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:[a("machines.current_tasks")," (",m.length,")"]}),m.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:a("machines.no_active_tasks")})]}):e.jsx(C,{tasks:m,navigate:r,t:a})]}),e.jsx(_,{isOpen:g,onClose:()=>h(!1),onConfirm:y,machineName:s.name,isDraining:b,loading:N})]})]})}function C({tasks:t,navigate:r,t:a}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.id")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.description")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.status_label")}),e.jsx("th",{className:"py-2 text-left font-normal text-[var(--text-muted)]",children:a("machines.stage")})]})}),e.jsx("tbody",{children:t.map(s=>e.jsxs("tr",{onClick:()=>r(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] hover:bg-[var(--bg-input)] transition-colors",children:[e.jsxs("td",{className:"py-2 pr-4 text-[var(--text-primary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2 pr-4 text-[var(--text-secondary)]",children:s.description}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("span",{style:{color:F[s.status]},children:["● ",s.status.toLowerCase()]})}),e.jsx("td",{className:"py-2 text-[var(--text-secondary)]",children:s.currentStage??"-"})]},s.id))})]})})}function p({label:t,value:r,unit:a}){return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[r,a]}),e.jsx("div",{className:"mt-3 h-1.5 w-full rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${r}%`,backgroundColor:D(r)}})})]})}function j({label:t,value:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-[var(--text-secondary)]",children:t}),e.jsxs("span",{className:"text-[var(--text-primary)]",children:[r,"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${r}%`,backgroundColor:D(r)}})})]})}function n({label:t,value:r}){return e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:t}),e.jsx("span",{className:"truncate text-[var(--text-primary)]",children:r})]})}export{z as default};