@lovelybunch/api 1.0.75-alpha.13 → 1.0.75-alpha.14

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 (118) hide show
  1. package/dist/lib/mail/mail-runner.d.ts +30 -0
  2. package/dist/lib/mail/mail-runner.js +108 -3
  3. package/dist/lib/storage/file-storage.js +2 -7
  4. package/dist/routes/api/v1/mail/index.js +4 -1
  5. package/dist/routes/api/v1/mail/route.d.ts +42 -0
  6. package/dist/routes/api/v1/mail/route.js +78 -0
  7. package/dist/routes/api/v1/slack/route.d.ts +6 -6
  8. package/dist/routes/api/v1/tasks/[id]/route.d.ts +2 -236
  9. package/dist/routes/api/v1/tasks/route.d.ts +2 -236
  10. package/dist/routes/api/v1/tasks/route.js +2 -8
  11. package/package.json +4 -4
  12. package/static/assets/{ActivityPage-BwJ7fLWq.js → ActivityPage-Ch44od-j.js} +1 -1
  13. package/static/assets/{ApiKeysSettingsPage-mKPYHrbG.js → ApiKeysSettingsPage-DuT2DLgr.js} +2 -2
  14. package/static/assets/{ArchitectureEditPage-CnF2W_T8.js → ArchitectureEditPage-DvJkcnEG.js} +1 -1
  15. package/static/assets/{ArchitecturePage-BaGE12Uz.js → ArchitecturePage-DqSclgRT.js} +1 -1
  16. package/static/assets/{AuthSettingsPage-B1_TL7WY.js → AuthSettingsPage-yM2zFEcv.js} +2 -2
  17. package/static/assets/{CallbackPage-Byf97nZK.js → CallbackPage-Bytr8RS8.js} +1 -1
  18. package/static/assets/{CodePage-C0hGkcdC.js → CodePage-BlGPi7uk.js} +1 -1
  19. package/static/assets/{CollapsibleSection-BTQLspUE.js → CollapsibleSection-irzuq21b.js} +1 -1
  20. package/static/assets/{DashboardPage-YArLaSEp.js → DashboardPage-DdA0uFZr.js} +1 -1
  21. package/static/assets/{GitPage-6DGf2Yb2.js → GitPage-Cl_rMV7q.js} +1 -1
  22. package/static/assets/{GitSettingsPage-BPFC022b.js → GitSettingsPage-B6bQRTLV.js} +1 -1
  23. package/static/assets/{IdentityPage-BdLn29tv.js → IdentityPage-CTsJJ_nR.js} +1 -1
  24. package/static/assets/{ImplementationStepsEditor-nSp4uTSC.js → ImplementationStepsEditor-D1q30m-M.js} +2 -2
  25. package/static/assets/{IntegrationsSettingsPage-C-Xqzlyi.js → IntegrationsSettingsPage-au7RbHgk.js} +1 -1
  26. package/static/assets/{JobDetailPage-DlFsVN9_.js → JobDetailPage-CDRH2EOg.js} +1 -1
  27. package/static/assets/KnowledgeDetailPage-DpvktyWP.js +1 -0
  28. package/static/assets/{KnowledgeEditPage-Dx68IG0a.js → KnowledgeEditPage-bHrMagf9.js} +1 -1
  29. package/static/assets/KnowledgePage-CHu-yTF2.js +3 -0
  30. package/static/assets/{LoginPage-Cea--t3a.js → LoginPage-Dxep5Whg.js} +1 -1
  31. package/static/assets/MailInboxPage-3enQ9yud.js +1 -0
  32. package/static/assets/MailProcessingModal-BN-hk7rN.js +6 -0
  33. package/static/assets/MailReadPage-Dg6oDlFh.js +1 -0
  34. package/static/assets/{MailSentPage-DveMCrm1.js → MailSentPage-Dig5IXdR.js} +1 -1
  35. package/static/assets/McpSettingsPage-CNwqGqLg.js +1 -0
  36. package/static/assets/{NewKnowledgePage-D_u_1sQi.js → NewKnowledgePage-Czxn4P1j.js} +1 -1
  37. package/static/assets/{NewSkillPage-DqibSZhY.js → NewSkillPage-CqaO2xNS.js} +1 -1
  38. package/static/assets/{NewTaskPage-DWbH-3Vk.js → NewTaskPage-CYITUYtu.js} +2 -2
  39. package/static/assets/NotFoundPage-BEQ3ZHqV.js +6 -0
  40. package/static/assets/{NotificationsSettingsPage-CL0ph697.js → NotificationsSettingsPage-HuOKal9l.js} +1 -1
  41. package/static/assets/{ProjectEditPage-BbN-CUvi.js → ProjectEditPage-CeHWqhRX.js} +1 -1
  42. package/static/assets/{ProjectPage-sepCO80y.js → ProjectPage-YTFg8Fkd.js} +1 -1
  43. package/static/assets/{PromptsSettingsPage-Cif2VMDl.js → PromptsSettingsPage-DPTo5b4l.js} +1 -1
  44. package/static/assets/{ResourceDetailPage-xHcmXDDt.js → ResourceDetailPage-CA_ZCk6v.js} +1 -1
  45. package/static/assets/{ResourcesPage-CJC07ag1.js → ResourcesPage-6kcr9x0O.js} +1 -1
  46. package/static/assets/RoleEditPage-CULuINfL.js +13 -0
  47. package/static/assets/{RolePage-qxwbXbGA.js → RolePage-BhJl9l-G.js} +1 -1
  48. package/static/assets/{RulesSettingsPage-BtrNsENs.js → RulesSettingsPage-CYhp9PHk.js} +3 -3
  49. package/static/assets/SchedulePage-vUZaPVX6.js +4 -0
  50. package/static/assets/{SkillDetailPage-DO67DAR3.js → SkillDetailPage-BT1Gp3Hh.js} +1 -1
  51. package/static/assets/{SkillEditPage-QvIWlVgE.js → SkillEditPage-CV2BMeF_.js} +1 -1
  52. package/static/assets/{SkillsPage-BLJFdLWk.js → SkillsPage-fT1CoBCE.js} +2 -2
  53. package/static/assets/{SkillsSettingsPage-BKArD_RN.js → SkillsSettingsPage-TiwaPPcd.js} +1 -1
  54. package/static/assets/{SourceInput-DRz0yu8C.js → SourceInput-B790vfwY.js} +1 -1
  55. package/static/assets/{TagInput-BJbcCU-Z.js → TagInput-Btfjq6aa.js} +1 -1
  56. package/static/assets/TaskDetailPage-BMGupUYM.js +16 -0
  57. package/static/assets/{TaskEditPage-BigoTtEt.js → TaskEditPage-CQz9UIZL.js} +1 -1
  58. package/static/assets/TasksPage-NbDKSkOe.js +17 -0
  59. package/static/assets/{TerminalPage-CmcMWc-0.js → TerminalPage-CQLCoRdq.js} +1 -1
  60. package/static/assets/{TerminalSessionPage-BD85W3Y8.js → TerminalSessionPage-doL1BiJi.js} +1 -1
  61. package/static/assets/{UserPreferencesPage-Cir8iHV7.js → UserPreferencesPage-D2CiwL2m.js} +1 -1
  62. package/static/assets/UserSettingsPage-iSTGwM80.js +1 -0
  63. package/static/assets/{UtilitiesPage-eit9YbF2.js → UtilitiesPage-B-ZW4kdp.js} +1 -1
  64. package/static/assets/{alert-y_ZN3v8G.js → alert-15F3-9XX.js} +1 -1
  65. package/static/assets/{arrow-down-CDO_FBBg.js → arrow-down-BrqEvvfv.js} +1 -1
  66. package/static/assets/{arrow-left-DSdiSF-4.js → arrow-left-CaqvCoIB.js} +1 -1
  67. package/static/assets/{arrow-up-DD3J0gOT.js → arrow-up-DNzaGmlT.js} +1 -1
  68. package/static/assets/arrow-up-down-DCe7-ihF.js +6 -0
  69. package/static/assets/{badge-DEdGwxT7.js → badge-BnmevczT.js} +1 -1
  70. package/static/assets/{browser-modal-DmW_vKAc.js → browser-modal-ChaWEpHZ.js} +1 -1
  71. package/static/assets/{card-D2IL9dFO.js → card-NkV5eOu8.js} +1 -1
  72. package/static/assets/{chevron-left-C6c6KPNR.js → chevron-left-Blz556B2.js} +1 -1
  73. package/static/assets/{chevron-up-85UlHYRP.js → chevron-up-rbFu97ce.js} +1 -1
  74. package/static/assets/{chevrons-up-BRQ6LS9m.js → chevrons-up-BQMlE7rT.js} +1 -1
  75. package/static/assets/{circle-alert-DS3JTzTX.js → circle-alert-B_3aezfy.js} +1 -1
  76. package/static/assets/{circle-check-BYnFgi54.js → circle-check-Di9E8LZ0.js} +1 -1
  77. package/static/assets/{circle-check-big-CY4XVZX5.js → circle-check-big-DeInZUEL.js} +1 -1
  78. package/static/assets/{circle-play-DZRonULa.js → circle-play-_KPAQa5u.js} +1 -1
  79. package/static/assets/{circle-x-y-VLhhlk.js → circle-x-Dqvz_3qq.js} +1 -1
  80. package/static/assets/{clipboard-BgAFTdDB.js → clipboard-CbMUHSIJ.js} +1 -1
  81. package/static/assets/{clock-BSV-PWC8.js → clock-DYK-k9QO.js} +1 -1
  82. package/static/assets/{download-BAwvn93i.js → download-DvfDST0e.js} +1 -1
  83. package/static/assets/{external-link-CUVrRJUy.js → external-link-4402xHJm.js} +1 -1
  84. package/static/assets/{eye-B0ROJhbz.js → eye-C96SnuaK.js} +1 -1
  85. package/static/assets/{folder-git-2-sZcm0AKa.js → folder-git-2-DM9e4LLF.js} +1 -1
  86. package/static/assets/index-DIPJXXxG.css +2 -0
  87. package/static/assets/{index-Dg1fqsBK.js → index-SVcL57hQ.js} +98 -98
  88. package/static/assets/{info-DaYx3WZu.js → info-C4HFkLJI.js} +1 -1
  89. package/static/assets/label-MGLxVQcy.js +1 -0
  90. package/static/assets/{markdown-editor-BjPIrCIB.js → markdown-editor-8DjKwEtI.js} +1 -1
  91. package/static/assets/{message-square-C4zc7NY1.js → message-square-C3VNiI6M.js} +1 -1
  92. package/static/assets/{paperclip-DjxwDxFr.js → paperclip-o6t1e21X.js} +1 -1
  93. package/static/assets/{pause-CnhJnDBC.js → pause-pAcTJVOC.js} +1 -1
  94. package/static/assets/{play-CqmnqjTk.js → play-Dn69nfRB.js} +1 -1
  95. package/static/assets/{radio-group-DYfSGjrJ.js → radio-group-C_JhFin5.js} +1 -1
  96. package/static/assets/{refresh-cw-Bph91vei.js → refresh-cw-oOjEruv4.js} +1 -1
  97. package/static/assets/{search-pTEzH58w.js → search-Ck3r4Ru-.js} +1 -1
  98. package/static/assets/{select-B2bDLBT8.js → select-DY8bp_yH.js} +1 -1
  99. package/static/assets/{switch-CUtIrWkC.js → switch-CyhPMHQO.js} +1 -1
  100. package/static/assets/{tabs-NT4Nw7xd.js → tabs-Cjt4N6XC.js} +1 -1
  101. package/static/assets/{tag-BGmTkjx-.js → tag-CajsrbmJ.js} +1 -1
  102. package/static/assets/{terminal-preview-BwYbZ-N2.js → terminal-preview-DkoSzVhy.js} +1 -1
  103. package/static/assets/{use-terminal-D_zORiG8.js → use-terminal-CJMIUQKK.js} +1 -1
  104. package/static/assets/{video-CdNAQkyo.js → video-Db8h41sP.js} +1 -1
  105. package/static/assets/{zap-BRkfEy3x.js → zap-BQyXK_jX.js} +1 -1
  106. package/static/index.html +2 -2
  107. package/static/assets/KnowledgeDetailPage-CSdmwigy.js +0 -1
  108. package/static/assets/KnowledgePage-BJqb3hbW.js +0 -8
  109. package/static/assets/MailInboxPage-CsJtIvkf.js +0 -1
  110. package/static/assets/MailReadPage-DMLvEBZ6.js +0 -1
  111. package/static/assets/McpSettingsPage-D5YFsGWq.js +0 -1
  112. package/static/assets/RoleEditPage-C_k6HckV.js +0 -13
  113. package/static/assets/SchedulePage-vjKLtnVK.js +0 -4
  114. package/static/assets/TaskDetailPage-Dcerr70C.js +0 -1
  115. package/static/assets/TasksPage-BfNWUfKe.js +0 -17
  116. package/static/assets/UserSettingsPage-B_nleEc5.js +0 -1
  117. package/static/assets/index-CkH7-cOr.css +0 -2
  118. package/static/assets/label-xXCWeKDL.js +0 -1
@@ -29,111 +29,6 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
29
29
  error?: string;
30
30
  executedAt?: string;
31
31
  }[];
32
- evidence: {
33
- type: "test" | "benchmark" | "screenshot" | "log" | "other";
34
- description: string;
35
- data: any;
36
- timestamp: string;
37
- }[];
38
- policies: {
39
- id: string;
40
- name: string;
41
- description: string;
42
- status: "pending" | "passed" | "failed" | "skipped";
43
- message?: string;
44
- checkedAt?: string;
45
- }[];
46
- featureFlags: {
47
- id: string;
48
- version: string;
49
- name: string;
50
- description: string;
51
- type: import("@lovelybunch/core").FeatureFlagType;
52
- defaultValue: any;
53
- scopes: string[];
54
- targets: {
55
- audience: string;
56
- value: any;
57
- percentage?: number;
58
- }[];
59
- killSwitch: boolean;
60
- dependencies: string[];
61
- createdAt: string;
62
- updatedAt: string;
63
- }[];
64
- experiments: {
65
- id: string;
66
- name: string;
67
- hypothesis: string;
68
- variants: {
69
- id: string;
70
- name: string;
71
- description: string;
72
- allocation: number;
73
- config: {
74
- [x: string]: any;
75
- };
76
- }[];
77
- allocation: {
78
- method: "random" | "deterministic" | "weighted";
79
- seed?: string;
80
- totalAllocation: number;
81
- };
82
- successMetrics: string[];
83
- guardrailMetrics: {
84
- name: string;
85
- threshold: number;
86
- comparison: "greater" | "less" | "equal";
87
- action: "alert" | "pause" | "stop";
88
- }[];
89
- stopRules: {
90
- metric: string;
91
- condition: string;
92
- action: "stop" | "pause";
93
- }[];
94
- analysisConfig: {
95
- confidenceLevel: number;
96
- minimumSampleSize: number;
97
- testType: "two-tailed" | "one-tailed";
98
- };
99
- status: import("@lovelybunch/core").ExperimentStatus;
100
- startedAt?: string;
101
- endedAt?: string;
102
- }[];
103
- telemetryContracts: {
104
- eventName: string;
105
- version: string;
106
- schema: {
107
- [x: string]: any;
108
- };
109
- piiFields: {
110
- field: string;
111
- classification: "none" | "quasi" | "sensitive" | "highly-sensitive";
112
- handling: "clear" | "hash" | "encrypt" | "remove";
113
- }[];
114
- samplingRate: number;
115
- retentionPolicy: {
116
- duration: number;
117
- archiveAfter?: number;
118
- deleteAfter: number;
119
- };
120
- approvals: {
121
- approver: string;
122
- approvedAt: string;
123
- comment?: string;
124
- }[];
125
- }[];
126
- releasePlan: {
127
- strategy: "immediate" | "gradual" | "scheduled" | "gated";
128
- stages?: {
129
- name: string;
130
- percentage: number;
131
- duration?: number;
132
- criteria?: string[];
133
- }[];
134
- schedule?: string;
135
- rollbackPlan?: string;
136
- };
137
32
  status: import("@lovelybunch/core").TaskStatus;
138
33
  comments?: {
139
34
  id: string;
@@ -145,21 +40,9 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
145
40
  createdAt: string;
146
41
  updatedAt: string;
147
42
  reviewers: string[];
148
- aiInteractions: {
149
- id: string;
150
- timestamp: string;
151
- model: string;
152
- prompt: string;
153
- response: string;
154
- tokens: {
155
- prompt: number;
156
- completion: number;
157
- total: number;
158
- };
159
- cost?: number;
160
- }[];
161
43
  tags?: string[];
162
44
  priority?: "low" | "medium" | "high" | "critical";
45
+ readiness?: number;
163
46
  };
164
47
  };
165
48
  }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
@@ -193,111 +76,6 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
193
76
  error?: string;
194
77
  executedAt?: string;
195
78
  }[];
196
- evidence: {
197
- type: "test" | "benchmark" | "screenshot" | "log" | "other";
198
- description: string;
199
- data: any;
200
- timestamp: string;
201
- }[];
202
- policies: {
203
- id: string;
204
- name: string;
205
- description: string;
206
- status: "pending" | "passed" | "failed" | "skipped";
207
- message?: string;
208
- checkedAt?: string;
209
- }[];
210
- featureFlags: {
211
- id: string;
212
- version: string;
213
- name: string;
214
- description: string;
215
- type: import("@lovelybunch/core").FeatureFlagType;
216
- defaultValue: any;
217
- scopes: string[];
218
- targets: {
219
- audience: string;
220
- value: any;
221
- percentage?: number;
222
- }[];
223
- killSwitch: boolean;
224
- dependencies: string[];
225
- createdAt: string;
226
- updatedAt: string;
227
- }[];
228
- experiments: {
229
- id: string;
230
- name: string;
231
- hypothesis: string;
232
- variants: {
233
- id: string;
234
- name: string;
235
- description: string;
236
- allocation: number;
237
- config: {
238
- [x: string]: any;
239
- };
240
- }[];
241
- allocation: {
242
- method: "random" | "deterministic" | "weighted";
243
- seed?: string;
244
- totalAllocation: number;
245
- };
246
- successMetrics: string[];
247
- guardrailMetrics: {
248
- name: string;
249
- threshold: number;
250
- comparison: "greater" | "less" | "equal";
251
- action: "alert" | "pause" | "stop";
252
- }[];
253
- stopRules: {
254
- metric: string;
255
- condition: string;
256
- action: "stop" | "pause";
257
- }[];
258
- analysisConfig: {
259
- confidenceLevel: number;
260
- minimumSampleSize: number;
261
- testType: "two-tailed" | "one-tailed";
262
- };
263
- status: import("@lovelybunch/core").ExperimentStatus;
264
- startedAt?: string;
265
- endedAt?: string;
266
- }[];
267
- telemetryContracts: {
268
- eventName: string;
269
- version: string;
270
- schema: {
271
- [x: string]: any;
272
- };
273
- piiFields: {
274
- field: string;
275
- classification: "none" | "quasi" | "sensitive" | "highly-sensitive";
276
- handling: "clear" | "hash" | "encrypt" | "remove";
277
- }[];
278
- samplingRate: number;
279
- retentionPolicy: {
280
- duration: number;
281
- archiveAfter?: number;
282
- deleteAfter: number;
283
- };
284
- approvals: {
285
- approver: string;
286
- approvedAt: string;
287
- comment?: string;
288
- }[];
289
- }[];
290
- releasePlan: {
291
- strategy: "immediate" | "gradual" | "scheduled" | "gated";
292
- stages?: {
293
- name: string;
294
- percentage: number;
295
- duration?: number;
296
- criteria?: string[];
297
- }[];
298
- schedule?: string;
299
- rollbackPlan?: string;
300
- };
301
79
  status: import("@lovelybunch/core").TaskStatus;
302
80
  comments?: {
303
81
  id: string;
@@ -309,21 +87,9 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
309
87
  createdAt: string;
310
88
  updatedAt: string;
311
89
  reviewers: string[];
312
- aiInteractions: {
313
- id: string;
314
- timestamp: string;
315
- model: string;
316
- prompt: string;
317
- response: string;
318
- tokens: {
319
- prompt: number;
320
- completion: number;
321
- total: number;
322
- };
323
- cost?: number;
324
- }[];
325
90
  tags?: string[];
326
91
  priority?: "low" | "medium" | "high" | "critical";
92
+ readiness?: number;
327
93
  };
328
94
  };
329
95
  }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
@@ -24,111 +24,6 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
24
24
  error?: string;
25
25
  executedAt?: string;
26
26
  }[];
27
- evidence: {
28
- type: "test" | "benchmark" | "screenshot" | "log" | "other";
29
- description: string;
30
- data: any;
31
- timestamp: string;
32
- }[];
33
- policies: {
34
- id: string;
35
- name: string;
36
- description: string;
37
- status: "pending" | "passed" | "failed" | "skipped";
38
- message?: string;
39
- checkedAt?: string;
40
- }[];
41
- featureFlags: {
42
- id: string;
43
- version: string;
44
- name: string;
45
- description: string;
46
- type: import("@lovelybunch/types").FeatureFlagType;
47
- defaultValue: any;
48
- scopes: string[];
49
- targets: {
50
- audience: string;
51
- value: any;
52
- percentage?: number;
53
- }[];
54
- killSwitch: boolean;
55
- dependencies: string[];
56
- createdAt: string;
57
- updatedAt: string;
58
- }[];
59
- experiments: {
60
- id: string;
61
- name: string;
62
- hypothesis: string;
63
- variants: {
64
- id: string;
65
- name: string;
66
- description: string;
67
- allocation: number;
68
- config: {
69
- [x: string]: any;
70
- };
71
- }[];
72
- allocation: {
73
- method: "random" | "deterministic" | "weighted";
74
- seed?: string;
75
- totalAllocation: number;
76
- };
77
- successMetrics: string[];
78
- guardrailMetrics: {
79
- name: string;
80
- threshold: number;
81
- comparison: "greater" | "less" | "equal";
82
- action: "alert" | "pause" | "stop";
83
- }[];
84
- stopRules: {
85
- metric: string;
86
- condition: string;
87
- action: "stop" | "pause";
88
- }[];
89
- analysisConfig: {
90
- confidenceLevel: number;
91
- minimumSampleSize: number;
92
- testType: "two-tailed" | "one-tailed";
93
- };
94
- status: import("@lovelybunch/types").ExperimentStatus;
95
- startedAt?: string;
96
- endedAt?: string;
97
- }[];
98
- telemetryContracts: {
99
- eventName: string;
100
- version: string;
101
- schema: {
102
- [x: string]: any;
103
- };
104
- piiFields: {
105
- field: string;
106
- classification: "none" | "quasi" | "sensitive" | "highly-sensitive";
107
- handling: "clear" | "hash" | "encrypt" | "remove";
108
- }[];
109
- samplingRate: number;
110
- retentionPolicy: {
111
- duration: number;
112
- archiveAfter?: number;
113
- deleteAfter: number;
114
- };
115
- approvals: {
116
- approver: string;
117
- approvedAt: string;
118
- comment?: string;
119
- }[];
120
- }[];
121
- releasePlan: {
122
- strategy: "immediate" | "gradual" | "scheduled" | "gated";
123
- stages?: {
124
- name: string;
125
- percentage: number;
126
- duration?: number;
127
- criteria?: string[];
128
- }[];
129
- schedule?: string;
130
- rollbackPlan?: string;
131
- };
132
27
  status: import("@lovelybunch/types").TaskStatus;
133
28
  comments?: {
134
29
  id: string;
@@ -140,21 +35,9 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
140
35
  createdAt: string;
141
36
  updatedAt: string;
142
37
  reviewers: string[];
143
- aiInteractions: {
144
- id: string;
145
- timestamp: string;
146
- model: string;
147
- prompt: string;
148
- response: string;
149
- tokens: {
150
- prompt: number;
151
- completion: number;
152
- total: number;
153
- };
154
- cost?: number;
155
- }[];
156
38
  tags?: string[];
157
39
  priority?: "low" | "medium" | "high" | "critical";
40
+ readiness?: number;
158
41
  };
159
42
  }[];
160
43
  }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
@@ -188,111 +71,6 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
188
71
  error?: string;
189
72
  executedAt?: string;
190
73
  }[];
191
- evidence: {
192
- type: "test" | "benchmark" | "screenshot" | "log" | "other";
193
- description: string;
194
- data: any;
195
- timestamp: string;
196
- }[];
197
- policies: {
198
- id: string;
199
- name: string;
200
- description: string;
201
- status: "pending" | "passed" | "failed" | "skipped";
202
- message?: string;
203
- checkedAt?: string;
204
- }[];
205
- featureFlags: {
206
- id: string;
207
- version: string;
208
- name: string;
209
- description: string;
210
- type: import("@lovelybunch/types").FeatureFlagType;
211
- defaultValue: any;
212
- scopes: string[];
213
- targets: {
214
- audience: string;
215
- value: any;
216
- percentage?: number;
217
- }[];
218
- killSwitch: boolean;
219
- dependencies: string[];
220
- createdAt: string;
221
- updatedAt: string;
222
- }[];
223
- experiments: {
224
- id: string;
225
- name: string;
226
- hypothesis: string;
227
- variants: {
228
- id: string;
229
- name: string;
230
- description: string;
231
- allocation: number;
232
- config: {
233
- [x: string]: any;
234
- };
235
- }[];
236
- allocation: {
237
- method: "random" | "deterministic" | "weighted";
238
- seed?: string;
239
- totalAllocation: number;
240
- };
241
- successMetrics: string[];
242
- guardrailMetrics: {
243
- name: string;
244
- threshold: number;
245
- comparison: "greater" | "less" | "equal";
246
- action: "alert" | "pause" | "stop";
247
- }[];
248
- stopRules: {
249
- metric: string;
250
- condition: string;
251
- action: "stop" | "pause";
252
- }[];
253
- analysisConfig: {
254
- confidenceLevel: number;
255
- minimumSampleSize: number;
256
- testType: "two-tailed" | "one-tailed";
257
- };
258
- status: import("@lovelybunch/types").ExperimentStatus;
259
- startedAt?: string;
260
- endedAt?: string;
261
- }[];
262
- telemetryContracts: {
263
- eventName: string;
264
- version: string;
265
- schema: {
266
- [x: string]: any;
267
- };
268
- piiFields: {
269
- field: string;
270
- classification: "none" | "quasi" | "sensitive" | "highly-sensitive";
271
- handling: "clear" | "hash" | "encrypt" | "remove";
272
- }[];
273
- samplingRate: number;
274
- retentionPolicy: {
275
- duration: number;
276
- archiveAfter?: number;
277
- deleteAfter: number;
278
- };
279
- approvals: {
280
- approver: string;
281
- approvedAt: string;
282
- comment?: string;
283
- }[];
284
- }[];
285
- releasePlan: {
286
- strategy: "immediate" | "gradual" | "scheduled" | "gated";
287
- stages?: {
288
- name: string;
289
- percentage: number;
290
- duration?: number;
291
- criteria?: string[];
292
- }[];
293
- schedule?: string;
294
- rollbackPlan?: string;
295
- };
296
74
  status: import("@lovelybunch/types").TaskStatus;
297
75
  comments?: {
298
76
  id: string;
@@ -304,21 +82,9 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
304
82
  createdAt: string;
305
83
  updatedAt: string;
306
84
  reviewers: string[];
307
- aiInteractions: {
308
- id: string;
309
- timestamp: string;
310
- model: string;
311
- prompt: string;
312
- response: string;
313
- tokens: {
314
- prompt: number;
315
- completion: number;
316
- total: number;
317
- };
318
- cost?: number;
319
- }[];
320
85
  tags?: string[];
321
86
  priority?: "low" | "medium" | "high" | "critical";
87
+ readiness?: number;
322
88
  };
323
89
  };
324
90
  }, 201, "json">) | (Response & import("hono").TypedResponse<{
@@ -81,20 +81,14 @@ export async function POST(c) {
81
81
  type: 'human'
82
82
  },
83
83
  planSteps: body.planSteps || [],
84
- evidence: body.evidence || [],
85
- policies: body.policies || [],
86
- featureFlags: body.featureFlags || [],
87
- experiments: body.experiments || [],
88
- telemetryContracts: body.telemetryContracts || [],
89
- releasePlan: body.releasePlan || { strategy: 'immediate' },
90
84
  status: body.status || 'draft',
91
85
  metadata: {
92
86
  createdAt: now,
93
87
  updatedAt: now,
94
88
  reviewers: body.metadata?.reviewers || [],
95
- aiInteractions: body.metadata?.aiInteractions || [],
96
89
  tags: body.metadata?.tags || [],
97
- priority: body.metadata?.priority || 'medium'
90
+ priority: body.metadata?.priority || 'medium',
91
+ ...(body.metadata?.readiness != null && { readiness: body.metadata.readiness }),
98
92
  },
99
93
  productSpecRef: body.productSpecRef
100
94
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovelybunch/api",
3
- "version": "1.0.75-alpha.13",
3
+ "version": "1.0.75-alpha.14",
4
4
  "type": "module",
5
5
  "main": "dist/server-with-static.js",
6
6
  "exports": {
@@ -37,9 +37,9 @@
37
37
  "@ai-sdk/anthropic": "^3.0.41",
38
38
  "@hono/node-server": "^1.13.7",
39
39
  "@hono/node-ws": "^1.0.6",
40
- "@lovelybunch/core": "^1.0.75-alpha.13",
41
- "@lovelybunch/mcp": "^1.0.75-alpha.13",
42
- "@lovelybunch/types": "^1.0.75-alpha.13",
40
+ "@lovelybunch/core": "^1.0.75-alpha.14",
41
+ "@lovelybunch/mcp": "^1.0.75-alpha.14",
42
+ "@lovelybunch/types": "^1.0.75-alpha.14",
43
43
  "adm-zip": "^0.5.16",
44
44
  "ai": "^6.0.79",
45
45
  "arctic": "^1.9.2",
@@ -1 +1 @@
1
- import{r as a,A as p,j as e,x as y,bw as v,B as N,p as w,C as b}from"./index-Dg1fqsBK.js";import{C as c,a as d,b as k,c as C}from"./card-D2IL9dFO.js";import{B as m}from"./badge-DEdGwxT7.js";import{R as E}from"./refresh-cw-Bph91vei.js";const A=5e3;function $(){const[n,o]=a.useState([]),[i,x]=a.useState(!0),[h,u]=a.useState(new Set),l=a.useCallback(async()=>{x(!0);try{const s=await fetch(`${p}/api/v1/events?limit=${A}`);if(!s.ok)throw new Error("Failed to load events");const t=await s.json();o(Array.isArray(t.items)?[...t.items].reverse():[])}catch(s){console.error("Failed to load events:",s),o([])}finally{x(!1)}},[]),g=a.useCallback(s=>{u(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},[]);a.useEffect(()=>{l()},[l]);const f=s=>{if(!s)return"Unknown time";try{return new Date(s).toLocaleString()}catch{return s}},j=s=>{switch(s?.toLowerCase()){case"error":return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";case"warn":case"warning":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case"info":return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case"debug":return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}};return i?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(y,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading events..."})]})})})]}):n.length===0?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(v,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Events Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Activity events will appear here as they occur."})]})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsxs("p",{className:"text-muted-foreground",children:["View system activity and events (",n.length," events)"]})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>void l(),disabled:i,children:[e.jsx(E,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})]}),e.jsx("div",{className:"space-y-3",children:n.map(s=>{const t=h.has(s.seq);return e.jsxs(c,{className:"transition-colors",children:[e.jsx(k,{className:"py-3 cursor-pointer hover:bg-muted/30",onClick:()=>g(s.seq),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[t?e.jsx(w,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}):e.jsx(b,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(C,{className:"text-sm font-medium",children:["#",s.seq]}),s.kind&&e.jsx(m,{variant:"outline",className:"text-xs",children:s.kind}),s.level&&e.jsx(m,{className:`text-xs ${j(s.level)}`,children:s.level})]}),s.message&&e.jsx("p",{className:`text-sm text-muted-foreground ${t?"":"truncate"}`,children:s.message})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:f(s.ts)})]})}),t&&e.jsx(d,{className:"pt-0 pb-4",children:e.jsx("pre",{className:"text-xs bg-muted p-3 rounded-md overflow-x-auto",children:JSON.stringify(s,null,2)})})]},s.seq)})})]})}export{$ as default};
1
+ import{r as a,A as p,j as e,x as y,bw as v,B as N,p as w,C as b}from"./index-SVcL57hQ.js";import{C as c,a as d,b as k,c as C}from"./card-NkV5eOu8.js";import{B as m}from"./badge-BnmevczT.js";import{R as E}from"./refresh-cw-oOjEruv4.js";const A=5e3;function $(){const[n,o]=a.useState([]),[i,x]=a.useState(!0),[h,u]=a.useState(new Set),l=a.useCallback(async()=>{x(!0);try{const s=await fetch(`${p}/api/v1/events?limit=${A}`);if(!s.ok)throw new Error("Failed to load events");const t=await s.json();o(Array.isArray(t.items)?[...t.items].reverse():[])}catch(s){console.error("Failed to load events:",s),o([])}finally{x(!1)}},[]),g=a.useCallback(s=>{u(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},[]);a.useEffect(()=>{l()},[l]);const f=s=>{if(!s)return"Unknown time";try{return new Date(s).toLocaleString()}catch{return s}},j=s=>{switch(s?.toLowerCase()){case"error":return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";case"warn":case"warning":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case"info":return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case"debug":return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}};return i?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(y,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading events..."})]})})})]}):n.length===0?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(v,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Events Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Activity events will appear here as they occur."})]})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsxs("p",{className:"text-muted-foreground",children:["View system activity and events (",n.length," events)"]})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>void l(),disabled:i,children:[e.jsx(E,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})]}),e.jsx("div",{className:"space-y-3",children:n.map(s=>{const t=h.has(s.seq);return e.jsxs(c,{className:"transition-colors",children:[e.jsx(k,{className:"py-3 cursor-pointer hover:bg-muted/30",onClick:()=>g(s.seq),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[t?e.jsx(w,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}):e.jsx(b,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(C,{className:"text-sm font-medium",children:["#",s.seq]}),s.kind&&e.jsx(m,{variant:"outline",className:"text-xs",children:s.kind}),s.level&&e.jsx(m,{className:`text-xs ${j(s.level)}`,children:s.level})]}),s.message&&e.jsx("p",{className:`text-sm text-muted-foreground ${t?"":"truncate"}`,children:s.message})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:f(s.ts)})]})}),t&&e.jsx(d,{className:"pt-0 pb-4",children:e.jsx("pre",{className:"text-xs bg-muted p-3 rounded-md overflow-x-auto",children:JSON.stringify(s,null,2)})})]},s.seq)})})]})}export{$ as default};
@@ -1,2 +1,2 @@
1
- import{w as R,r as t,b2 as y,j as e,B as a,P as X,b3 as Y,O as J,D as j,b as g,d as v,f,g as A,I as F,a1 as N,ai as W,y as i}from"./index-Dg1fqsBK.js";import{C as G,b as Q,c as V,d as Z,a as _}from"./card-D2IL9dFO.js";import{L as w}from"./label-xXCWeKDL.js";import{B as ee}from"./badge-DEdGwxT7.js";import{A as I,a as C}from"./alert-y_ZN3v8G.js";import{I as L}from"./info-DaYx3WZu.js";import{C as se}from"./circle-alert-DS3JTzTX.js";function oe(){const{authEnabled:n}=R(),[P,k]=t.useState([]),[b,K]=t.useState(!0),[O,l]=t.useState(!1),[M,d]=t.useState(!1),[x,D]=t.useState(""),[h,E]=t.useState("never"),[c,S]=t.useState(null),[m,o]=t.useState(null);t.useEffect(()=>{p()},[]);const p=async()=>{K(!0);try{const s=await y("/api/v1/api-keys");s.success&&k(s.data?.apiKeys||[])}catch(s){console.error("Failed to load API keys:",s),k([])}finally{K(!1)}},U=async()=>{if(!x.trim()){i({title:"Error",description:"Please provide a name for the API key",variant:"destructive"});return}try{const s={name:x,scopes:["*"]};h!=="never"&&(s.expiresIn=h);const r=await y("/api/v1/api-keys",{method:"POST",body:JSON.stringify(s)});r.success&&(S(r.data),l(!1),d(!0),D(""),E("never"),await p(),i({title:"API Key Created",description:"Make sure to copy your API key now. You won't be able to see it again!"}))}catch(s){console.error("Failed to create API key:",s),i({title:"Error",description:"Failed to create API key",variant:"destructive"})}},B=async s=>{try{(await y(`/api/v1/api-keys/${s}`,{method:"DELETE"})).success&&(await p(),o(null),i({title:"API Key Deleted",description:"The API key has been permanently deleted"}))}catch(r){console.error("Failed to delete API key:",r),i({title:"Error",description:"Failed to delete API key",variant:"destructive"})}},H=async s=>{try{await navigator.clipboard.writeText(s),i({title:"Copied",description:"API key copied to clipboard"})}catch{i({title:"Error",description:"Failed to copy to clipboard",variant:"destructive"})}},u=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),$=s=>s?new Date(s)<new Date:!1,q=typeof window<"u"?window.location.origin:"http://localhost:3000",z=c?`curl -H "X-API-Key: ${c.key}" \\
2
- + ${q}/api/v1/tasks`:"",T=n?null:e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["Authentication is currently disabled. API keys will only be required once you enable authentication in the ",e.jsx("a",{href:"/settings/authentication",className:"underline",children:"Authentication settings"}),"."]})]});return!n&&b?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access"})]}),T]}):b?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access to your Coconut instance"})]}),T,n&&e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["API keys provide programmatic access to your Coconut instance. Use them in CI/CD pipelines or automation scripts by including the key in the ",e.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:"X-API-Key"})," header."]})]}),e.jsxs(G,{children:[e.jsx(Q,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Active API Keys"}),e.jsx(Z,{children:"API keys you've created for programmatic access"})]}),e.jsxs(a,{onClick:()=>l(!0),disabled:!n,children:[e.jsx(X,{className:"mr-2 h-4 w-4"}),"Create API Key"]})]})}),e.jsx(_,{children:P.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Y,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),e.jsx("p",{children:"No API keys yet"}),e.jsx("p",{className:"text-sm",children:"Create an API key to get started with programmatic access"})]}):e.jsx("div",{className:"space-y-4",children:P.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"font-medium",children:s.name}),$(s.expiresAt)&&e.jsx(ee,{variant:"destructive",children:"Expired"})]}),e.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:s.keyPreview}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Created: ",u(s.createdAt)]}),s.expiresAt&&e.jsxs("span",{children:["Expires: ",u(s.expiresAt)]}),s.lastUsedAt&&e.jsxs("span",{children:["Last used: ",u(s.lastUsedAt)]})]})]}),e.jsx(a,{variant:"ghost",size:"icon",onClick:()=>o(s.id),children:e.jsx(J,{className:"h-4 w-4 text-destructive"})})]},s.id))})})]}),e.jsx(j,{open:O,onOpenChange:l,children:e.jsxs(g,{children:[e.jsxs(v,{children:[e.jsx(f,{children:"Create API Key"}),e.jsx(A,{children:"Create a new API key for programmatic access. The key will only be shown once."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"keyName",children:"Name"}),e.jsx(F,{id:"keyName",placeholder:"CI/CD Pipeline",value:x,onChange:s=>D(s.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A descriptive name to identify this API key"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"keyExpiry",children:"Expiration"}),e.jsxs("select",{id:"keyExpiry",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:h,onChange:s=>E(s.target.value),children:[e.jsx("option",{value:"never",children:"Never"}),e.jsx("option",{value:"30d",children:"30 days"}),e.jsx("option",{value:"90d",children:"90 days"}),e.jsx("option",{value:"1y",children:"1 year"})]})]})]}),e.jsxs(N,{children:[e.jsx(a,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(a,{onClick:U,disabled:!n,children:"Create API Key"})]})]})}),e.jsx(j,{open:M,onOpenChange:d,children:e.jsxs(g,{className:"sm:max-w-[600px]",children:[e.jsxs(v,{children:[e.jsx(f,{children:"API Key Created"}),e.jsx(A,{children:"Make sure to copy your API key now. You won't be able to see it again!"})]}),e.jsxs(I,{variant:"destructive",className:"my-4",children:[e.jsx(se,{className:"h-4 w-4"}),e.jsx(C,{children:"This is the only time you will see this key. Store it securely."})]}),c&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{children:"API Key"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{readOnly:!0,value:c.key,className:"font-mono text-sm"}),e.jsx(a,{variant:"outline",size:"icon",onClick:()=>H(c.key),children:e.jsx(W,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"mb-2",children:"Usage example:"}),e.jsx("pre",{className:"bg-muted p-3 rounded-md whitespace-pre-wrap break-words",children:e.jsx("code",{className:"font-mono text-xs",children:z})})]})]}),e.jsx(N,{children:e.jsx(a,{onClick:()=>{d(!1),S(null)},children:"I've Saved My Key"})})]})}),e.jsx(j,{open:!!m,onOpenChange:s=>!s&&o(null),children:e.jsxs(g,{children:[e.jsxs(v,{children:[e.jsx(f,{children:"Delete API Key"}),e.jsx(A,{children:"Are you sure you want to delete this API key? This action cannot be undone and any scripts using this key will stop working."})]}),e.jsxs(N,{children:[e.jsx(a,{variant:"outline",onClick:()=>o(null),children:"Cancel"}),e.jsx(a,{variant:"destructive",onClick:()=>m&&B(m),children:"Delete API Key"})]})]})})]})}export{oe as default};
1
+ import{w as R,r as t,b2 as y,j as e,B as a,P as X,b3 as Y,N as J,D as j,b as g,d as v,f,g as A,I as F,_ as N,ah as W,y as i}from"./index-SVcL57hQ.js";import{C as _,b as G,c as Q,d as V,a as Z}from"./card-NkV5eOu8.js";import{L as w}from"./label-MGLxVQcy.js";import{B as ee}from"./badge-BnmevczT.js";import{A as I,a as C}from"./alert-15F3-9XX.js";import{I as L}from"./info-C4HFkLJI.js";import{C as se}from"./circle-alert-B_3aezfy.js";function oe(){const{authEnabled:n}=R(),[P,k]=t.useState([]),[b,K]=t.useState(!0),[O,l]=t.useState(!1),[M,d]=t.useState(!1),[x,D]=t.useState(""),[h,E]=t.useState("never"),[c,S]=t.useState(null),[m,o]=t.useState(null);t.useEffect(()=>{p()},[]);const p=async()=>{K(!0);try{const s=await y("/api/v1/api-keys");s.success&&k(s.data?.apiKeys||[])}catch(s){console.error("Failed to load API keys:",s),k([])}finally{K(!1)}},U=async()=>{if(!x.trim()){i({title:"Error",description:"Please provide a name for the API key",variant:"destructive"});return}try{const s={name:x,scopes:["*"]};h!=="never"&&(s.expiresIn=h);const r=await y("/api/v1/api-keys",{method:"POST",body:JSON.stringify(s)});r.success&&(S(r.data),l(!1),d(!0),D(""),E("never"),await p(),i({title:"API Key Created",description:"Make sure to copy your API key now. You won't be able to see it again!"}))}catch(s){console.error("Failed to create API key:",s),i({title:"Error",description:"Failed to create API key",variant:"destructive"})}},B=async s=>{try{(await y(`/api/v1/api-keys/${s}`,{method:"DELETE"})).success&&(await p(),o(null),i({title:"API Key Deleted",description:"The API key has been permanently deleted"}))}catch(r){console.error("Failed to delete API key:",r),i({title:"Error",description:"Failed to delete API key",variant:"destructive"})}},H=async s=>{try{await navigator.clipboard.writeText(s),i({title:"Copied",description:"API key copied to clipboard"})}catch{i({title:"Error",description:"Failed to copy to clipboard",variant:"destructive"})}},u=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),$=s=>s?new Date(s)<new Date:!1,q=typeof window<"u"?window.location.origin:"http://localhost:3000",z=c?`curl -H "X-API-Key: ${c.key}" \\
2
+ + ${q}/api/v1/tasks`:"",T=n?null:e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["Authentication is currently disabled. API keys will only be required once you enable authentication in the ",e.jsx("a",{href:"/settings/authentication",className:"underline",children:"Authentication settings"}),"."]})]});return!n&&b?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access"})]}),T]}):b?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access to your Coconut instance"})]}),T,n&&e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["API keys provide programmatic access to your Coconut instance. Use them in CI/CD pipelines or automation scripts by including the key in the ",e.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:"X-API-Key"})," header."]})]}),e.jsxs(_,{children:[e.jsx(G,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Q,{children:"Active API Keys"}),e.jsx(V,{children:"API keys you've created for programmatic access"})]}),e.jsxs(a,{onClick:()=>l(!0),disabled:!n,children:[e.jsx(X,{className:"mr-2 h-4 w-4"}),"Create API Key"]})]})}),e.jsx(Z,{children:P.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Y,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),e.jsx("p",{children:"No API keys yet"}),e.jsx("p",{className:"text-sm",children:"Create an API key to get started with programmatic access"})]}):e.jsx("div",{className:"space-y-4",children:P.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"font-medium",children:s.name}),$(s.expiresAt)&&e.jsx(ee,{variant:"destructive",children:"Expired"})]}),e.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:s.keyPreview}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Created: ",u(s.createdAt)]}),s.expiresAt&&e.jsxs("span",{children:["Expires: ",u(s.expiresAt)]}),s.lastUsedAt&&e.jsxs("span",{children:["Last used: ",u(s.lastUsedAt)]})]})]}),e.jsx(a,{variant:"ghost",size:"icon",onClick:()=>o(s.id),children:e.jsx(J,{className:"h-4 w-4 text-destructive"})})]},s.id))})})]}),e.jsx(j,{open:O,onOpenChange:l,children:e.jsxs(g,{children:[e.jsxs(v,{children:[e.jsx(f,{children:"Create API Key"}),e.jsx(A,{children:"Create a new API key for programmatic access. The key will only be shown once."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"keyName",children:"Name"}),e.jsx(F,{id:"keyName",placeholder:"CI/CD Pipeline",value:x,onChange:s=>D(s.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A descriptive name to identify this API key"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"keyExpiry",children:"Expiration"}),e.jsxs("select",{id:"keyExpiry",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:h,onChange:s=>E(s.target.value),children:[e.jsx("option",{value:"never",children:"Never"}),e.jsx("option",{value:"30d",children:"30 days"}),e.jsx("option",{value:"90d",children:"90 days"}),e.jsx("option",{value:"1y",children:"1 year"})]})]})]}),e.jsxs(N,{children:[e.jsx(a,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(a,{onClick:U,disabled:!n,children:"Create API Key"})]})]})}),e.jsx(j,{open:M,onOpenChange:d,children:e.jsxs(g,{className:"sm:max-w-[600px]",children:[e.jsxs(v,{children:[e.jsx(f,{children:"API Key Created"}),e.jsx(A,{children:"Make sure to copy your API key now. You won't be able to see it again!"})]}),e.jsxs(I,{variant:"destructive",className:"my-4",children:[e.jsx(se,{className:"h-4 w-4"}),e.jsx(C,{children:"This is the only time you will see this key. Store it securely."})]}),c&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{children:"API Key"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{readOnly:!0,value:c.key,className:"font-mono text-sm"}),e.jsx(a,{variant:"outline",size:"icon",onClick:()=>H(c.key),children:e.jsx(W,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"mb-2",children:"Usage example:"}),e.jsx("pre",{className:"bg-muted p-3 rounded-md whitespace-pre-wrap break-words",children:e.jsx("code",{className:"font-mono text-xs",children:z})})]})]}),e.jsx(N,{children:e.jsx(a,{onClick:()=>{d(!1),S(null)},children:"I've Saved My Key"})})]})}),e.jsx(j,{open:!!m,onOpenChange:s=>!s&&o(null),children:e.jsxs(g,{children:[e.jsxs(v,{children:[e.jsx(f,{children:"Delete API Key"}),e.jsx(A,{children:"Are you sure you want to delete this API key? This action cannot be undone and any scripts using this key will stop working."})]}),e.jsxs(N,{children:[e.jsx(a,{variant:"outline",onClick:()=>o(null),children:"Cancel"}),e.jsx(a,{variant:"destructive",onClick:()=>m&&B(m),children:"Delete API Key"})]})]})})]})}export{oe as default};