@lovelybunch/api 1.0.78-alpha.2 → 1.0.78-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes/api/v1/jobs/[id]/route.d.ts +16 -16
- package/dist/routes/api/v1/jobs/route.d.ts +16 -16
- package/dist/routes/api/v1/knowledge/route.js +13 -3
- package/dist/routes/api/v1/slack/route.d.ts +6 -6
- package/package.json +4 -4
- package/static/assets/{ActivityPage-B83wvBeD.js → ActivityPage-CO2m97Hz.js} +1 -1
- package/static/assets/{AgentsContextEditPage-CgHVDbMV.js → AgentsContextEditPage-B9pcC3Y4.js} +1 -1
- package/static/assets/{AgentsContextPage-DMf6khxC.js → AgentsContextPage-CWsGDD4F.js} +1 -1
- package/static/assets/{ApiKeysSettingsPage-DzwmYsom.js → ApiKeysSettingsPage-CPckUylF.js} +1 -1
- package/static/assets/{AuthSettingsPage-B5auAs_s.js → AuthSettingsPage-CaiYl7fx.js} +1 -1
- package/static/assets/{CallbackPage-Cxc5lXE4.js → CallbackPage-C73ggs1e.js} +1 -1
- package/static/assets/{CoconutCallbackPage-D7Xkrh70.js → CoconutCallbackPage-Bhc_sIuJ.js} +1 -1
- package/static/assets/{CodePage-D37jAzN1.js → CodePage-7zrLYTBq.js} +1 -1
- package/static/assets/{CollapsibleSection-Bp5C0iRa.js → CollapsibleSection-DD6cnVaM.js} +1 -1
- package/static/assets/{DashboardPage-DvWWsMjr.js → DashboardPage-BiVDSLAm.js} +1 -1
- package/static/assets/{GitPage-yXgpwI2f.js → GitPage-C7n82d8O.js} +1 -1
- package/static/assets/{GitSettingsPage-B5bgtLBU.js → GitSettingsPage-D2R-zg9d.js} +1 -1
- package/static/assets/{IdentityPage-Dpr6Z5Id.js → IdentityPage-B3gUyFXr.js} +1 -1
- package/static/assets/{ImplementationStepsEditor-B2e4ML0a.js → ImplementationStepsEditor-DmrYGdZB.js} +1 -1
- package/static/assets/{IntegrationsSettingsPage-CHknhE_l.js → IntegrationsSettingsPage-V6t85OD_.js} +1 -1
- package/static/assets/{JobDetailPage-BnuDmxZF.js → JobDetailPage-BUmQGshi.js} +1 -1
- package/static/assets/{KnowledgeDetailPage-DFxjt46s.js → KnowledgeDetailPage-DzpoOs9C.js} +1 -1
- package/static/assets/{KnowledgeEditPage-Bu1l5VHq.js → KnowledgeEditPage-C9zyCfr6.js} +1 -1
- package/static/assets/{KnowledgePage-CzPB44SA.js → KnowledgePage-C56_NMA9.js} +1 -1
- package/static/assets/{LoginPage-D_ZO_RBy.js → LoginPage-DZpAjZmK.js} +1 -1
- package/static/assets/{MailInboxPage-CXlwKTvH.js → MailInboxPage-BvOBQvF3.js} +1 -1
- package/static/assets/{MailProcessingModal-_C2SsbSm.js → MailProcessingModal-CCGrVGDs.js} +1 -1
- package/static/assets/{MailReadPage-BtgLL4bW.js → MailReadPage-CycqG4oj.js} +1 -1
- package/static/assets/{MailSentPage-nhZKfZOk.js → MailSentPage-DpwRNrju.js} +1 -1
- package/static/assets/{McpSettingsPage-C6PdoBPD.js → McpSettingsPage-pJ41THOO.js} +1 -1
- package/static/assets/{MemoryEditPage-BpioH6_S.js → MemoryEditPage-DobGCRrl.js} +1 -1
- package/static/assets/{MemoryPage-DrPL8CG7.js → MemoryPage-BrFnh8rC.js} +1 -1
- package/static/assets/{NewKnowledgePage-rqgKv0VA.js → NewKnowledgePage-CTFx_YTk.js} +1 -1
- package/static/assets/{NewSkillPage-0pSUX9z9.js → NewSkillPage-D_FfkSKi.js} +1 -1
- package/static/assets/{NewTaskPage-BpCJGis6.js → NewTaskPage-CehAYsyJ.js} +1 -1
- package/static/assets/{NotFoundPage-sSYe1QSz.js → NotFoundPage-wcJQI6_Y.js} +1 -1
- package/static/assets/{NotificationsSettingsPage-CS_ZT6t0.js → NotificationsSettingsPage-_9Dum2JJ.js} +1 -1
- package/static/assets/{PromptsSettingsPage-DTq8cZqP.js → PromptsSettingsPage-BBIP8PWS.js} +1 -1
- package/static/assets/{ResourceDetailPage-DYriLbDS.js → ResourceDetailPage-C7goHk6o.js} +1 -1
- package/static/assets/{ResourcesPage-D8QBQrZP.js → ResourcesPage-ZH5lSPaG.js} +1 -1
- package/static/assets/{RoleEditPage-Ci_1L_e_.js → RoleEditPage-JJnQ7UXW.js} +1 -1
- package/static/assets/{RolePage-DMJ7_wD0.js → RolePage-C-gQnpzL.js} +1 -1
- package/static/assets/{RulesSettingsPage-CuB55bRV.js → RulesSettingsPage-Bc05Q6j8.js} +1 -1
- package/static/assets/{RunDetailPage-CBW-swIi.js → RunDetailPage-BhWthPVR.js} +1 -1
- package/static/assets/{SchedulePage-BIklILDy.js → SchedulePage-zvr5ce8N.js} +1 -1
- package/static/assets/{SkillDetailPage-D-1PWQiM.js → SkillDetailPage-5DhKM3NY.js} +1 -1
- package/static/assets/{SkillEditPage-BZB-YL56.js → SkillEditPage-1V1ADtPe.js} +1 -1
- package/static/assets/{SkillsPage-BezXmUjc.js → SkillsPage-6VQCj1hf.js} +1 -1
- package/static/assets/{SkillsSettingsPage-Cqo9_iDG.js → SkillsSettingsPage-C7lqSbBf.js} +1 -1
- package/static/assets/{SourceInput-TEQpt4P-.js → SourceInput-CeltF2kQ.js} +1 -1
- package/static/assets/{TagInput-DBUiVBgy.js → TagInput-DUR8EcF5.js} +1 -1
- package/static/assets/{TaskDetailPage-Dq0gDy_e.js → TaskDetailPage-HqNWYvGE.js} +1 -1
- package/static/assets/{TaskEditPage-CWGvjTjo.js → TaskEditPage-Cy6_oKRU.js} +1 -1
- package/static/assets/{TasksPage-BIPx8Qde.js → TasksPage-DHdwWucP.js} +1 -1
- package/static/assets/{TeamEditPage-BlNa1eMV.js → TeamEditPage-DZHs9LwL.js} +1 -1
- package/static/assets/{TeamPage-D1usM-fA.js → TeamPage-C10th6Xi.js} +1 -1
- package/static/assets/{TerminalPage-CLh6hap0.js → TerminalPage-BajLCwBP.js} +1 -1
- package/static/assets/{TerminalSessionPage-DaHcsdNf.js → TerminalSessionPage-dJGlApIY.js} +1 -1
- package/static/assets/{UserPreferencesPage-CL-nPXv7.js → UserPreferencesPage-crzoMvn3.js} +1 -1
- package/static/assets/{UserSettingsPage-BGIalWgn.js → UserSettingsPage-B4eeW2b9.js} +1 -1
- package/static/assets/{UtilitiesPage-ewlEzigp.js → UtilitiesPage-ZnNRIlEg.js} +1 -1
- package/static/assets/{alert-0GENnoy_.js → alert-a0XoDY__.js} +1 -1
- package/static/assets/{arrow-down-Bfya-JPw.js → arrow-down-DwCDIVHH.js} +1 -1
- package/static/assets/{arrow-left-CY9PaWRG.js → arrow-left-D4GyWema.js} +1 -1
- package/static/assets/{arrow-up-BAAEIUsa.js → arrow-up-ClZJeJXS.js} +1 -1
- package/static/assets/{arrow-up-down-0F-DzXlw.js → arrow-up-down-ozcTje6W.js} +1 -1
- package/static/assets/{badge-D1sVaZJG.js → badge-CgbZdX-R.js} +1 -1
- package/static/assets/{browser-modal-CELhtOVM.js → browser-modal-CV9x_ILy.js} +1 -1
- package/static/assets/{card-D2eA49nP.js → card-bSzcwVEz.js} +1 -1
- package/static/assets/{chevron-left-Cbc591ge.js → chevron-left-Dnm2Bv2g.js} +1 -1
- package/static/assets/{chevron-up-DD_GdI6e.js → chevron-up-znuSUWjo.js} +1 -1
- package/static/assets/{chevrons-up-CQ8ZAERh.js → chevrons-up-DyHcV7KP.js} +1 -1
- package/static/assets/{circle-alert-DsESVtwL.js → circle-alert-Dn8B5NPI.js} +1 -1
- package/static/assets/{circle-check-BXiPFdlh.js → circle-check-2Hh5KJn8.js} +1 -1
- package/static/assets/{circle-check-big-HtBmMXFt.js → circle-check-big-HUp82Tz-.js} +1 -1
- package/static/assets/{circle-play-KOICOGsB.js → circle-play-BG4sTHV2.js} +1 -1
- package/static/assets/{circle-x-B_4fmWCG.js → circle-x-DBrbnMPA.js} +1 -1
- package/static/assets/{clipboard-ByOf6HYl.js → clipboard-B6OwO-az.js} +1 -1
- package/static/assets/{clock-CdH0GtRs.js → clock-B36ytcOX.js} +1 -1
- package/static/assets/{code-7mdwwNlt.js → code-CK8i3Xlg.js} +1 -1
- package/static/assets/{download-Bh7rihtL.js → download-C_C3f7cE.js} +1 -1
- package/static/assets/{external-link-DGl8WNOe.js → external-link-kQIXuJh_.js} +1 -1
- package/static/assets/{eye-C_ckl4MB.js → eye-DTyfbeQg.js} +1 -1
- package/static/assets/{folder-git-2-C9MVgN94.js → folder-git-2-CKR2HcNZ.js} +1 -1
- package/static/assets/{globe-BvwRv4le.js → globe--bHEtjre.js} +1 -1
- package/static/assets/{index-CzcqLknE.js → index-9Y0fmmy7.js} +1 -1
- package/static/assets/{index-CCq3bqJI.js → index-B52hVXHu.js} +1 -1
- package/static/assets/{index-Bx26Q2JC.js → index-B81KYk3Z.js} +6 -6
- package/static/assets/{index-BjiLTiAs.js → index-Bg80D0Z0.js} +1 -1
- package/static/assets/{index-CLD_gdRP.js → index-CD6zflLk.js} +1 -1
- package/static/assets/{index-C611wGVc.js → index-CJBq79WW.js} +1 -1
- package/static/assets/{index-DrTHjwZ8.js → index-CRSpx2tQ.js} +1 -1
- package/static/assets/{index-ja6BPXln.js → index-CTZ51lNe.js} +1 -1
- package/static/assets/{index-Ci5Lsqgb.js → index-C_zW1Hi0.js} +1 -1
- package/static/assets/{index-DFPcCMnD.js → index-CvrVx0kf.js} +1 -1
- package/static/assets/{index-Dx8evZfS.js → index-DMKQFm-M.js} +1 -1
- package/static/assets/{index-D1CqgHy0.js → index-DOgqHj1l.js} +1 -1
- package/static/assets/{index-BD57V9U9.js → index-DXkvtMiO.js} +1 -1
- package/static/assets/{index-5M1EX2JZ.js → index-ObZJu-Zv.js} +1 -1
- package/static/assets/{index-BUOPcczo.js → index-QgKSm0gN.js} +1 -1
- package/static/assets/{index-DH0iEeh5.js → index-UKy_jk8q.js} +1 -1
- package/static/assets/{index-CjU4ihqi.js → index-XJ0Ck2RG.js} +1 -1
- package/static/assets/{index-CnEgD2Gk.js → index-ffbhzKxY.js} +1 -1
- package/static/assets/{index-CjL8t7WM.js → index-nRow2q03.js} +1 -1
- package/static/assets/{info-_JNAJSs5.js → info-wSiZMXgL.js} +1 -1
- package/static/assets/{label-fHWG59jZ.js → label-CHP4q6u3.js} +1 -1
- package/static/assets/{markdown-editor-Dmq8d9Xs.js → markdown-editor-DSI9T1tt.js} +3 -3
- package/static/assets/{message-square-BaejhTPJ.js → message-square-D1sMYX2G.js} +1 -1
- package/static/assets/{paperclip-xnYUFZwQ.js → paperclip-plxfUm0D.js} +1 -1
- package/static/assets/{pause-plM13_Um.js → pause-B2JeikEI.js} +1 -1
- package/static/assets/{play-DR4AKc9R.js → play-l7Mu5YPO.js} +1 -1
- package/static/assets/{radio-group-CE9meIEG.js → radio-group-DxYoqBDN.js} +1 -1
- package/static/assets/{refresh-cw-CLSROYiq.js → refresh-cw-BTHxZiES.js} +1 -1
- package/static/assets/{search-VcMqZsDm.js → search-Cpy49h7H.js} +1 -1
- package/static/assets/{select-ChtjmmOf.js → select-CG6kgyUu.js} +1 -1
- package/static/assets/{server-DVlnoAGu.js → server-DzOL5RbP.js} +1 -1
- package/static/assets/{switch-BMBFkcUU.js → switch-7YpWWyAq.js} +1 -1
- package/static/assets/{tabs-DE4DShnU.js → tabs-DJk1ZrWh.js} +1 -1
- package/static/assets/{tag-czmQSC6D.js → tag-BvoXF-sG.js} +1 -1
- package/static/assets/{terminal-preview-B8UB7Pz6.js → terminal-preview-d_BZ8s8s.js} +1 -1
- package/static/assets/{triangle-alert-RuOrTU7H.js → triangle-alert-P6aKUDal.js} +1 -1
- package/static/assets/{use-terminal-C3O4m83z.js → use-terminal-BXYq-vfY.js} +1 -1
- package/static/assets/{video-BEV0GqmB.js → video-PACu7StA.js} +1 -1
- package/static/index.html +1 -1
|
@@ -9,8 +9,7 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
9
9
|
}, 404, "json">) | (Response & import("hono").TypedResponse<{
|
|
10
10
|
success: true;
|
|
11
11
|
data: {
|
|
12
|
-
|
|
13
|
-
name: string;
|
|
12
|
+
tags?: string[];
|
|
14
13
|
status: ScheduledJobStatus;
|
|
15
14
|
schedule: {
|
|
16
15
|
type: "cron";
|
|
@@ -24,26 +23,27 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
24
23
|
timezone?: string;
|
|
25
24
|
anchorHour?: number;
|
|
26
25
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
model: string;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
30
28
|
metadata: {
|
|
31
29
|
createdAt: string;
|
|
32
30
|
updatedAt: string;
|
|
33
31
|
lastRunAt?: string;
|
|
34
32
|
nextRunAt?: string;
|
|
35
33
|
};
|
|
36
|
-
|
|
34
|
+
description?: string;
|
|
35
|
+
model: string;
|
|
36
|
+
prompt: string;
|
|
37
|
+
mcpServers?: string[];
|
|
37
38
|
contextPaths?: string[];
|
|
38
39
|
agentId?: string;
|
|
39
40
|
agentIds?: string[];
|
|
40
|
-
mcpServers?: string[];
|
|
41
41
|
runs: {
|
|
42
42
|
error?: string;
|
|
43
|
-
id: string;
|
|
44
43
|
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
45
44
|
jobId: string;
|
|
46
45
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
46
|
+
id: string;
|
|
47
47
|
startedAt: string;
|
|
48
48
|
finishedAt?: string;
|
|
49
49
|
}[];
|
|
@@ -70,8 +70,7 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
70
70
|
}, 400, "json">) | (Response & import("hono").TypedResponse<{
|
|
71
71
|
success: true;
|
|
72
72
|
data: {
|
|
73
|
-
|
|
74
|
-
name: string;
|
|
73
|
+
tags?: string[];
|
|
75
74
|
status: ScheduledJobStatus;
|
|
76
75
|
schedule: {
|
|
77
76
|
type: "cron";
|
|
@@ -85,26 +84,27 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
85
84
|
timezone?: string;
|
|
86
85
|
anchorHour?: number;
|
|
87
86
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
model: string;
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
91
89
|
metadata: {
|
|
92
90
|
createdAt: string;
|
|
93
91
|
updatedAt: string;
|
|
94
92
|
lastRunAt?: string;
|
|
95
93
|
nextRunAt?: string;
|
|
96
94
|
};
|
|
97
|
-
|
|
95
|
+
description?: string;
|
|
96
|
+
model: string;
|
|
97
|
+
prompt: string;
|
|
98
|
+
mcpServers?: string[];
|
|
98
99
|
contextPaths?: string[];
|
|
99
100
|
agentId?: string;
|
|
100
101
|
agentIds?: string[];
|
|
101
|
-
mcpServers?: string[];
|
|
102
102
|
runs: {
|
|
103
103
|
error?: string;
|
|
104
|
-
id: string;
|
|
105
104
|
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
106
105
|
jobId: string;
|
|
107
106
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
107
|
+
id: string;
|
|
108
108
|
startedAt: string;
|
|
109
109
|
finishedAt?: string;
|
|
110
110
|
}[];
|
|
@@ -11,8 +11,7 @@ export declare function withLightweightRuns<T extends {
|
|
|
11
11
|
export declare function GET(c: Context): Promise<(Response & import("hono").TypedResponse<{
|
|
12
12
|
success: true;
|
|
13
13
|
data: {
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
14
|
+
tags?: string[];
|
|
16
15
|
status: ScheduledJobStatus;
|
|
17
16
|
schedule: {
|
|
18
17
|
type: "cron";
|
|
@@ -26,26 +25,27 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
26
25
|
timezone?: string;
|
|
27
26
|
anchorHour?: number;
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
model: string;
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
32
30
|
metadata: {
|
|
33
31
|
createdAt: string;
|
|
34
32
|
updatedAt: string;
|
|
35
33
|
lastRunAt?: string;
|
|
36
34
|
nextRunAt?: string;
|
|
37
35
|
};
|
|
38
|
-
|
|
36
|
+
description?: string;
|
|
37
|
+
model: string;
|
|
38
|
+
prompt: string;
|
|
39
|
+
mcpServers?: string[];
|
|
39
40
|
contextPaths?: string[];
|
|
40
41
|
agentId?: string;
|
|
41
42
|
agentIds?: string[];
|
|
42
|
-
mcpServers?: string[];
|
|
43
43
|
runs: {
|
|
44
44
|
error?: string;
|
|
45
|
-
id: string;
|
|
46
45
|
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
47
46
|
jobId: string;
|
|
48
47
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
48
|
+
id: string;
|
|
49
49
|
startedAt: string;
|
|
50
50
|
finishedAt?: string;
|
|
51
51
|
}[];
|
|
@@ -66,8 +66,7 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
|
|
|
66
66
|
}, 400, "json">) | (Response & import("hono").TypedResponse<{
|
|
67
67
|
success: true;
|
|
68
68
|
data: {
|
|
69
|
-
|
|
70
|
-
name: string;
|
|
69
|
+
tags?: string[];
|
|
71
70
|
status: ScheduledJobStatus;
|
|
72
71
|
schedule: {
|
|
73
72
|
type: "cron";
|
|
@@ -81,26 +80,27 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
|
|
|
81
80
|
timezone?: string;
|
|
82
81
|
anchorHour?: number;
|
|
83
82
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
model: string;
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
87
85
|
metadata: {
|
|
88
86
|
createdAt: string;
|
|
89
87
|
updatedAt: string;
|
|
90
88
|
lastRunAt?: string;
|
|
91
89
|
nextRunAt?: string;
|
|
92
90
|
};
|
|
93
|
-
|
|
91
|
+
description?: string;
|
|
92
|
+
model: string;
|
|
93
|
+
prompt: string;
|
|
94
|
+
mcpServers?: string[];
|
|
94
95
|
contextPaths?: string[];
|
|
95
96
|
agentId?: string;
|
|
96
97
|
agentIds?: string[];
|
|
97
|
-
mcpServers?: string[];
|
|
98
98
|
runs: {
|
|
99
99
|
error?: string;
|
|
100
|
-
id: string;
|
|
101
100
|
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
102
101
|
jobId: string;
|
|
103
102
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
103
|
+
id: string;
|
|
104
104
|
startedAt: string;
|
|
105
105
|
finishedAt?: string;
|
|
106
106
|
}[];
|
|
@@ -3,7 +3,7 @@ import { promises as fs } from 'fs';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import matter from 'gray-matter';
|
|
5
5
|
import filenameRoute from './[filename]/index.js';
|
|
6
|
-
import { listKnowledge } from '@lovelybunch/core';
|
|
6
|
+
import { listKnowledge, sanitizeProvidedFilename } from '@lovelybunch/core';
|
|
7
7
|
import { getLogger, KnowledgeKinds } from '@lovelybunch/core/logging';
|
|
8
8
|
import { requireAuth } from '../../../../middleware/auth.js';
|
|
9
9
|
// Helper function to generate a simple summary from content
|
|
@@ -104,12 +104,22 @@ app.post('/', async (c) => {
|
|
|
104
104
|
}
|
|
105
105
|
const knowledgePath = getKnowledgePath();
|
|
106
106
|
await fs.mkdir(knowledgePath, { recursive: true });
|
|
107
|
-
|
|
107
|
+
let filename;
|
|
108
|
+
if (typeof body.filename === 'string' && body.filename.trim().length > 0) {
|
|
109
|
+
const sanitized = sanitizeProvidedFilename(body.filename);
|
|
110
|
+
if (!sanitized) {
|
|
111
|
+
return c.json({ success: false, error: 'Invalid filename' }, 400);
|
|
112
|
+
}
|
|
113
|
+
filename = sanitized;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
filename = generateFilename(body.title);
|
|
117
|
+
}
|
|
108
118
|
const filePath = path.join(knowledgePath, filename);
|
|
109
119
|
// Check if file already exists
|
|
110
120
|
try {
|
|
111
121
|
await fs.access(filePath);
|
|
112
|
-
return c.json({ success: false, error: 'A document with this
|
|
122
|
+
return c.json({ success: false, error: 'A document with this filename already exists' }, 409);
|
|
113
123
|
}
|
|
114
124
|
catch {
|
|
115
125
|
// File doesn't exist, which is what we want
|
|
@@ -7,6 +7,9 @@ export declare function getConfig(c: Context): Promise<(Response & import("hono"
|
|
|
7
7
|
success: true;
|
|
8
8
|
data: {
|
|
9
9
|
enabled: boolean;
|
|
10
|
+
channelId: string;
|
|
11
|
+
channelName: string;
|
|
12
|
+
siteUrl: string;
|
|
10
13
|
notifications: {
|
|
11
14
|
proposals: {
|
|
12
15
|
created: boolean;
|
|
@@ -21,9 +24,6 @@ export declare function getConfig(c: Context): Promise<(Response & import("hono"
|
|
|
21
24
|
merge: boolean;
|
|
22
25
|
};
|
|
23
26
|
};
|
|
24
|
-
channelId: string;
|
|
25
|
-
channelName: string;
|
|
26
|
-
siteUrl: string;
|
|
27
27
|
hasBotToken: boolean;
|
|
28
28
|
hasSigningSecret: boolean;
|
|
29
29
|
};
|
|
@@ -39,6 +39,9 @@ export declare function updateConfig(c: Context): Promise<(Response & import("ho
|
|
|
39
39
|
success: true;
|
|
40
40
|
data: {
|
|
41
41
|
enabled: boolean;
|
|
42
|
+
channelId: string;
|
|
43
|
+
channelName: string;
|
|
44
|
+
siteUrl: string;
|
|
42
45
|
notifications: {
|
|
43
46
|
proposals: {
|
|
44
47
|
created: boolean;
|
|
@@ -53,9 +56,6 @@ export declare function updateConfig(c: Context): Promise<(Response & import("ho
|
|
|
53
56
|
merge: boolean;
|
|
54
57
|
};
|
|
55
58
|
};
|
|
56
|
-
channelId: string;
|
|
57
|
-
channelName: string;
|
|
58
|
-
siteUrl: string;
|
|
59
59
|
hasBotToken: boolean;
|
|
60
60
|
hasSigningSecret: boolean;
|
|
61
61
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovelybunch/api",
|
|
3
|
-
"version": "1.0.78-alpha.
|
|
3
|
+
"version": "1.0.78-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/server-with-static.js",
|
|
6
6
|
"exports": {
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"sharp": "^0.33.5",
|
|
41
41
|
"ws": "^8.18.0",
|
|
42
42
|
"zod": "^3.23.0",
|
|
43
|
-
"@lovelybunch/core": "1.0.78-alpha.
|
|
44
|
-
"@lovelybunch/types": "1.0.78-alpha.
|
|
45
|
-
"@lovelybunch/mcp": "1.0.78-alpha.
|
|
43
|
+
"@lovelybunch/core": "1.0.78-alpha.3",
|
|
44
|
+
"@lovelybunch/types": "1.0.78-alpha.3",
|
|
45
|
+
"@lovelybunch/mcp": "1.0.78-alpha.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/adm-zip": "^0.5.7",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,A as p,j as e,v,bN as y,B as N,n as w,C as b}from"./index-
|
|
1
|
+
import{r as a,A as p,j as e,v,bN as y,B as N,n as w,C as b}from"./index-B81KYk3Z.js";import{C as c,a as d,b as k,c as C}from"./card-bSzcwVEz.js";import{B as m}from"./badge-CgbZdX-R.js";import{R as E}from"./refresh-cw-BTHxZiES.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(v,{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(y,{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};
|
package/static/assets/{AgentsContextEditPage-CgHVDbMV.js → AgentsContextEditPage-B9pcC3Y4.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as p,a as j,r as n,A as l,j as e,B as h,L as v,a5 as N}from"./index-
|
|
1
|
+
import{u as p,a as j,r as n,A as l,j as e,B as h,L as v,a5 as N}from"./index-B81KYk3Z.js";import{C as m,a as x,b as C,c as S}from"./card-bSzcwVEz.js";import{M as w}from"./markdown-editor-DSI9T1tt.js";import{A as y}from"./arrow-left-D4GyWema.js";import{C as A}from"./circle-check-big-HUp82Tz-.js";import"./index-ObZJu-Zv.js";function F(){const f=p(),{toast:t}=j(),[a,i]=n.useState(""),[g,r]=n.useState(!0),[o,c]=n.useState(!1);n.useEffect(()=>{fetch(`${l}/api/v1/context/agents`).then(s=>s.json()).then(s=>{s.success&&i(s.document.content.trim()),r(!1)}).catch(s=>{console.error("Failed to load context:",s),t({title:"Error",description:"Failed to load agents definition",variant:"destructive"}),r(!1)})},[t]);const u=async()=>{c(!0);try{const d=await(await fetch(`${l}/api/v1/context/agents`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:a,metadata:{}})})).json();if(d.success)t({title:"Success",description:"Agents definition saved successfully",action:e.jsx(A,{className:"h-4 w-4"})}),f("/context/agents");else throw new Error(d.error||"Failed to save")}catch(s){console.error("Save error:",s),t({title:"Error",description:"Failed to save agents definition",variant:"destructive"})}finally{c(!1)}};return g?e.jsx("div",{className:"space-y-6",children:e.jsx(m,{children:e.jsx(x,{className:"pt-6",children:e.jsx("div",{className:"text-center",children:e.jsx("p",{children:"Loading..."})})})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Edit Agents Definition"}),e.jsx("p",{className:"text-muted-foreground text-sm hidden sm:block",children:"Define agents, their capabilities, and configurations"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(h,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(v,{to:"/context/agents",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(y,{className:"w-4 h-4"})})}),e.jsxs(h,{onClick:u,disabled:o,size:"sm",children:[e.jsx(N,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:o?"Saving...":"Save"})]})]})]}),e.jsxs(m,{children:[e.jsx(C,{children:e.jsx(S,{children:"Agents Documentation"})}),e.jsx(x,{children:e.jsx(w,{value:a,onChange:s=>i(s||""),placeholder:`Write your agents definition in markdown...
|
|
2
2
|
|
|
3
3
|
## Agent Definitions
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g,r as t,A as N,j as e,v,az as C,B as a,L as d,a2 as l,M as w,ay as y,au as E}from"./index-
|
|
1
|
+
import{a as g,r as t,A as N,j as e,v,az as C,B as a,L as d,a2 as l,M as w,ay as y,au as E}from"./index-B81KYk3Z.js";import{C as i,a as c,b}from"./card-bSzcwVEz.js";import{c as A}from"./clipboard-B9ndUJKl.js";function D(){const{toast:r}=g(),[o,m]=t.useState(null),[x,h]=t.useState(!0),[u,n]=t.useState(!1);t.useEffect(()=>{fetch(`${N}/api/v1/context/agents`).then(s=>{if(s.ok)return s.json();throw new Error("Not found")}).then(s=>{s.success?(m(s.document),n(!0)):n(!1)}).catch(()=>{n(!1)}).finally(()=>{h(!1)})},[]);const p=async()=>{const s=".nut/context/agents.md";try{await A(s),r({title:"Copied!",description:`Path ${s} copied to clipboard`})}catch(f){console.error("Failed to copy path:",f),r({title:"Error",description:"Failed to copy path to clipboard",variant:"destructive"})}},j=()=>{const s=new CustomEvent("discuss-in-chat",{detail:{type:"context",id:"agents-md",filename:"agents.md",name:"agents.md",path:".nut/context/agents.md"}});window.dispatchEvent(s)};return x?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(v,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading agents definition..."})]})})})}):!u||!o?e.jsx("div",{className:"space-y-6",children:e.jsx(i,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(C,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Agents Definition Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Agents definition will appear here once created."}),e.jsx(a,{className:"mt-4",asChild:!0,children:e.jsxs(d,{to:"/context/agents/edit",children:[e.jsx(l,{className:"h-4 w-4 mr-2"}),"Create Agents Definition"]})})]})})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Agents"}),e.jsx("p",{className:"text-muted-foreground",children:"Agent definitions and configurations"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{variant:"outline",size:"sm",onClick:j,children:[e.jsx(w,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Discuss"})]}),e.jsxs(a,{variant:"outline",size:"sm",onClick:p,children:[e.jsx(y,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Copy Path"})]}),e.jsx(a,{size:"sm",asChild:!0,children:e.jsxs(d,{to:"/context/agents/edit",children:[e.jsx(l,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})})]})]}),e.jsxs(i,{children:[e.jsx(b,{className:"pb-0"}),e.jsx(c,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(E,{children:o.content||"No content available"})})})]})]})}export{D as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as R,r as t,E as y,j as e,B as a,P as X,bH as Y,Q as J,D as j,b as g,d as v,f,g as A,I as F,a1 as N,ai as Q,w as i}from"./index-
|
|
1
|
+
import{t as R,r as t,E as y,j as e,B as a,P as X,bH as Y,Q as J,D as j,b as g,d as v,f,g as A,I as F,a1 as N,ai as Q,w as i}from"./index-B81KYk3Z.js";import{C as W,b as G,c as V,d as Z,a as _}from"./card-bSzcwVEz.js";import{L as w}from"./label-CHP4q6u3.js";import{B as ee}from"./badge-CgbZdX-R.js";import{A as I,a as C}from"./alert-a0XoDY__.js";import{I as L}from"./info-wSiZMXgL.js";import{C as se}from"./circle-alert-Dn8B5NPI.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
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(W,{children:[e.jsx(G,{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(Q,{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,4 +1,4 @@
|
|
|
1
|
-
import{c as te,t as me,r as n,E as l,j as e,bB as _,i as H,D as q,a0 as z,B as d,b as B,d as Y,f as K,g as Q,I as x,a1 as G,J as ge,N as je,Q as pe,R as ve,U as fe,V as we,W as ye,Y as Ce,_ as Ne,$ as Se,w as r}from"./index-
|
|
1
|
+
import{c as te,t as me,r as n,E as l,j as e,bB as _,i as H,D as q,a0 as z,B as d,b as B,d as Y,f as K,g as Q,I as x,a1 as G,J as ge,N as je,Q as pe,R as ve,U as fe,V as we,W as ye,Y as Ce,_ as Ne,$ as Se,w as r}from"./index-B81KYk3Z.js";import{C as m,b as g,c as j,d as p,a as v}from"./card-bSzcwVEz.js";import{L as c}from"./label-CHP4q6u3.js";import{S as X,a as Z,b as ee,c as se,d as a}from"./select-CG6kgyUu.js";import{S as N}from"./switch-7YpWWyAq.js";import{B as F}from"./badge-CgbZdX-R.js";import{C as be}from"./circle-alert-Dn8B5NPI.js";import"./index-ObZJu-Zv.js";import"./chevron-up-znuSUWjo.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,j as e,v as x,A as f}from"./index-
|
|
1
|
+
import{r as m,j as e,v as x,A as f}from"./index-B81KYk3Z.js";import{C as w}from"./circle-check-2Hh5KJn8.js";import{C as b}from"./circle-x-DBrbnMPA.js";const r="coconut/github-auth-state";function j(s){try{window.opener&&window.opener.postMessage({type:"github-auth",...s},window.location.origin)}catch{}}const y=()=>{const[s,d]=m.useState("pending"),[h,p]=m.useState("Authorizing GitHub…");return m.useEffect(()=>{const a=new URLSearchParams(window.location.search),u=a.get("error"),l=a.get("token"),n=a.get("expires_at")||a.get("expiresAt"),c=a.get("state"),o=t=>{j(t),d(t.success?"success":"error"),p(t.message),setTimeout(()=>{try{window.close()}catch{}},1200)};if(u){localStorage.removeItem(r),o({success:!1,message:decodeURIComponent(u)});return}if(!l||!n||!c){localStorage.removeItem(r),o({success:!1,message:"Missing authorization parameters. Please try again."});return}const g=localStorage.getItem(r);if(!g||g!==c){localStorage.removeItem(r),o({success:!1,message:"Authorization state mismatch. Please start again."});return}(async()=>{try{const t=await fetch(`${f}/api/v1/git/providers/github/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l,expiresAt:n,state:c})}),i=await t.json();if(!t.ok||!i.success)throw new Error(i?.error?.message||"Failed to store GitHub token");localStorage.removeItem(r),o({success:!0,message:"GitHub connected successfully!",expiresAt:i.data?.expiresAt||n})}catch(t){localStorage.removeItem(r),o({success:!1,message:t?.message||"Failed to store GitHub token. Please try again."})}})()},[]),e.jsx("div",{className:"flex h-screen items-center justify-center bg-background px-6",children:e.jsxs("div",{className:"max-w-sm rounded-lg border bg-card p-6 text-center shadow-sm",children:[e.jsxs("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:[s==="pending"&&e.jsx(x,{className:"h-6 w-6 animate-spin text-muted-foreground"}),s==="success"&&e.jsx(w,{className:"h-6 w-6 text-green-600"}),s==="error"&&e.jsx(b,{className:"h-6 w-6 text-red-600"})]}),e.jsx("h1",{className:"text-lg font-semibold",children:"GitHub Authorization"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:h}),s!=="pending"&&e.jsx("p",{className:"mt-4 text-xs text-muted-foreground",children:"You can close this window and return to Coconut."})]})})};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as E,x as S,t as j,r as i,j as e,v,y as p,z as y,E as C,O as k,w as N}from"./index-
|
|
1
|
+
import{u as E,x as S,t as j,r as i,j as e,v,y as p,z as y,E as C,O as k,w as N}from"./index-B81KYk3Z.js";function I(){const c=E(),[a]=S(),{oauth:t,refreshUser:u,isLoading:l}=j(),[w,r]=i.useState("working"),[b,s]=i.useState(null),d=i.useRef(!1);return i.useEffect(()=>{if(d.current||l)return;d.current=!0,(async()=>{const g=a.get("code"),h=a.get("error");if(h){r("error"),s(a.get("error_description")||h);return}if(!g){r("error"),s("Missing authorization code in callback URL");return}if(!t.enabled||!t.clientId||!t.issuer){r("error"),s("OAuth is not enabled on this coconut");return}let o=null;try{o=sessionStorage.getItem(p)}catch{o=null}if(!o){r("error"),s("Missing PKCE verifier - please start sign-in again");return}try{const n=await y({issuer:t.issuer,clientId:t.clientId,code:g,verifier:o});if(!n.id_token)throw new Error('Clerk did not return an id_token (is the "openid" scope registered for this client?)');const m=await C("/api/v1/auth/oauth/exchange",{method:"POST",body:JSON.stringify({idToken:n.id_token})});if(!m.success)throw new Error(m.error||"Server rejected OAuth token");try{sessionStorage.removeItem(p)}catch{}await u();let f="/";try{const x=sessionStorage.getItem(k);x&&(sessionStorage.removeItem(k),f=x)}catch{}N({title:"Welcome back",description:"Signed in with Coconut"}),c(f,{replace:!0})}catch(n){console.error("OAuth callback failed:",n),r("error"),s(n?.message||"OAuth callback failed")}})()},[l,c,t,u,a]),e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background to-muted p-4",children:e.jsx("div",{className:"max-w-sm text-center space-y-4",children:w==="working"?e.jsxs(e.Fragment,{children:[e.jsx(v,{className:"h-8 w-8 animate-spin text-muted-foreground mx-auto"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Finishing sign-in with Coconut..."})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-lg font-semibold",children:"Sign-in failed"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:b||"Something went wrong completing OAuth sign-in."}),e.jsx("button",{type:"button",className:"text-sm underline",onClick:()=>c("/login",{replace:!0}),children:"Back to login"})]})})})}export{I as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as ce,a as de,r as i,j as e,B as r,T as oe,n as M,X as me,F as xe,a2 as he,D as ue,b as fe,d as pe,f as je,k as ge,a8 as B,a9 as R,aa as H,ab as L,ac as O,ad as G,o as ve,A as T}from"./index-Bx26Q2JC.js";import{C as g,b as Ne,a as _,c as ye}from"./card-D2eA49nP.js";import{B as U}from"./badge-D1sVaZJG.js";import{u as we}from"./use-terminal-C3O4m83z.js";import{T as Se}from"./terminal-preview-B8UB7Pz6.js";import{S as Ce,a as be,b as ke,c as Ae,d as w}from"./select-ChtjmmOf.js";import{b as De,e as Me,d as Te,c as Ie,a as $e}from"./pipeline-builders-DrEjlsbH.js";import{R as Ee}from"./refresh-cw-CLSROYiq.js";import{C as Pe,a as ze}from"./chevrons-up-CQ8ZAERh.js";import{P as Fe}from"./play-DR4AKc9R.js";import{C as Be}from"./code-7mdwwNlt.js";import{C as Re}from"./chevron-up-DD_GdI6e.js";import{S as He}from"./server-DVlnoAGu.js";import"./xterm-DTxiCjtJ.js";import"./index-5M1EX2JZ.js";const Le=c=>c?Array.isArray(c)?c.filter(x=>typeof x=="string").map(x=>x.trim()).filter(Boolean):typeof c=="string"?c.split(",").map(x=>x.trim()).filter(Boolean):[]:[];function ts(){const c=ce(),{sessions:x,loading:b,error:I,refreshSessions:S,createSession:V,destroySession:K}=we(),{toast:v}=de(),[$,W]=i.useState([]),[q,X]=i.useState(!0),[j,k]=i.useState(()=>({})),[A,N]=i.useState(!1),[f,J]=i.useState("claude"),[E,Q]=i.useState(""),[D,P]=i.useState(!1),[h,Y]=i.useState([]),[p,y]=i.useState([]),[Z,ee]=i.useState({}),[u,se]=i.useState([]),[o,C]=i.useState([]),te=s=>{const t=Date.now(),a=new Date(s).getTime(),n=Math.max(0,Math.floor((t-a)/1e3));if(n<60)return`${n}s ago`;const d=Math.floor(n/60);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`};i.useEffect(()=>{(async()=>{try{const t=await fetch(`${T}/api/v1/tasks`);if(t.ok){const a=await t.json(),n=a.data||a;W(Array.isArray(n)?n:[])}}catch(t){console.error("Error loading tasks:",t)}finally{X(!1)}})()},[]),i.useEffect(()=>{S()},[S]),i.useEffect(()=>{if(!A)return;(async()=>{try{const t=await fetch(`${T}/api/v1/mcp`);if(t.ok){const a=await t.json();a?.success&&Array.isArray(a.servers)&&(Y(a.servers),y(n=>n.filter(d=>a.servers.includes(d))),a.mcpServers&&typeof a.mcpServers=="object"&&ee(a.mcpServers))}}catch(t){console.error("Failed to load MCP servers",t)}try{const t=await fetch(`${T}/api/v1/skills`);if(t.ok){const a=await t.json(),d=(Array.isArray(a?.documents)?a.documents:[]).map(l=>({id:l.id,name:l?.metadata?.name||l.id,mcpServers:Le(l?.metadata?.metadata?.mcpServers)}));se(d),C(l=>l.filter(F=>d.some(le=>le.id===F)))}}catch(t){console.error("Failed to load skills",t)}})()},[A]),i.useEffect(()=>{o.length!==0&&y(s=>{const t=new Set(s),a=h.length>0?new Set(h):void 0;return o.forEach(n=>{const d=u.find(l=>l.id===n);d&&d.mcpServers.forEach(l=>{(!a||a.has(l))&&t.add(l)})}),Array.from(t)})},[o,u,h]);const m=i.useMemo(()=>x.filter(s=>s.taskId?.startsWith("cp-")||s.taskId?.startsWith("ag-")).sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[x]);i.useEffect(()=>{k(s=>{const t={...s};return m.forEach(a=>{a.id in t||(t[a.id]=!0)}),t})},[m]);const z=i.useMemo(()=>$.filter(s=>s.status==="draft"||s.status==="ready").sort((s,t)=>new Date(t.metadata.createdAt).getTime()-new Date(s.metadata.createdAt).getTime()).slice(0,3),[$]),ae=()=>{const s=m.every(a=>j[a.id]),t={};m.forEach(a=>{t[a.id]=!s}),k(t)},ie=m.length>0&&m.every(s=>j[s.id]),ne=async s=>{await K(s)?(v({title:"Session closed",description:s}),setTimeout(()=>S(),100)):v({title:"Failed to close session",description:s,variant:"destructive"})},re=async()=>{P(!0);try{const s=`session-${Date.now()}`,t={taskId:s,contextType:"change-task",cliAgent:f,mcpServersMap:Z,selectedMcpServers:p,skills:u,selectedSkillIds:o,automationEnabled:!1,customInstruction:E.trim(),includeDefaultInstructions:!1};let a="";f==="claude"?a=De(t):f==="gemini"?a=Me(t):f==="codex"?a=Te(t):f==="droid"?a=Ie(t):f==="kiro"&&(a=$e(t)),await V(s,a)?(v({title:"Coding session started",description:`Session ${s} created`}),N(!1),c(`/terminal/${s}`)):v({title:"Failed to start session",description:"Could not create terminal session",variant:"destructive"})}catch(s){console.error("Error starting coding session:",s),v({title:"Error",description:"Failed to start coding session",variant:"destructive"})}finally{P(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Agents"}),e.jsx("p",{className:"text-muted-foreground hidden sm:block",children:"Manage agents and their active sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>S(),disabled:b,children:[e.jsx(Ee,{className:`h-4 w-4 sm:mr-2 ${b?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),m.length>0&&e.jsx(r,{variant:"outline",size:"sm",onClick:ae,children:ie?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Hide All"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ze,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Show All"})]})}),e.jsxs(r,{size:"sm",onClick:()=>N(!0),children:[e.jsx(Fe,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Interactive Session"})]})]})]}),I&&e.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("div",{className:"text-red-600",children:I})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Sessions"}),b?e.jsx("div",{className:"space-y-2",children:[...Array(2)].map((s,t)=>e.jsx(g,{className:"p-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-4 w-4 rounded bg-muted animate-pulse"}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-40 bg-muted rounded animate-pulse mb-2"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]})]}),e.jsx("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"})]})},t))}):m.length===0?e.jsx(g,{className:"p-8",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx(Be,{className:"h-12 w-12 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No active sessions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Get started by launching an"," ",e.jsx("button",{onClick:()=>N(!0),className:"text-primary hover:underline font-medium",children:"Interactive Session"})," ","or working on a"," ",e.jsx("button",{onClick:()=>c("/tasks"),className:"text-primary hover:underline font-medium",children:"New Task"})]})]})]})}):e.jsx("div",{className:"space-y-2",children:m.slice(0,10).map(s=>e.jsxs(g,{className:"p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(oe,{className:"h-4 w-4 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm",children:s.taskId}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Session ",s.id.split("-").slice(-1)[0].substring(0,8)," • Last activity ",te(s.lastActivity)]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("div",{className:`flex items-center gap-1 ${s.connected?"text-green-600":"text-gray-400"}`,title:s.connected?"Connected":"Disconnected",children:e.jsx("div",{className:`w-2 h-2 rounded-full ${s.connected?"bg-green-500":"bg-gray-400"}`})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>{k(t=>({...t,[s.id]:!t[s.id]}))},"aria-label":j[s.id]?"Hide preview":"Show preview",title:j[s.id]?"Hide preview":"Show preview",children:j[s.id]?e.jsx(Re,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>c(`/terminal/${s.taskId}`),children:"Open"}),e.jsx(r,{size:"icon",variant:"destructive",onClick:()=>ne(s.id),title:"Close session","aria-label":"Close session",children:e.jsx(me,{className:"h-4 w-4"})})]})]}),j[s.id]&&e.jsx("div",{className:"mt-2 w-full p-2 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>c(`/terminal/${s.taskId}`),title:"Click to open full terminal session",children:e.jsx(Se,{sessionId:s.id,heightPx:160,maxScrollback:200})})]},s.id))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"New Tasks"}),q?e.jsx("div",{className:"space-y-3",children:[...Array(3)].map((s,t)=>e.jsx(g,{children:e.jsx(Ne,{className:"py-3",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-2/3 animate-pulse"}),e.jsx("div",{className:"h-3 bg-muted rounded w-1/3 animate-pulse"})]}),e.jsx("div",{className:"h-5 bg-muted rounded w-16 animate-pulse"})]})})},t))}):z.length===0?e.jsx(g,{children:e.jsx(_,{className:"flex items-center justify-center py-6",children:e.jsx("div",{className:"text-center text-sm text-gray-500",children:"No draft or approved tasks found"})})}):e.jsx("div",{className:"space-y-2",children:z.map(s=>e.jsx(g,{className:"hover:shadow-md transition-all cursor-pointer hover:border-primary/50",onClick:()=>c(`/terminal/${s.id}`),children:e.jsx(_,{className:"py-4",children:e.jsx("div",{className:"flex justify-between items-start gap-4",children:e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(ye,{className:"text-base leading-tight",children:s.title||s.intent}),e.jsxs("div",{className:"flex gap-1 ml-3 flex-shrink-0",children:[s.priority&&e.jsx(U,{variant:s.priority==="high"||s.priority==="critical"?"destructive":s.priority==="medium"?"secondary":"outline",className:"text-xs",children:s.priority}),e.jsx(U,{variant:"default",className:"text-xs",children:s.status})]})]}),s.content&&e.jsxs("div",{className:"text-sm text-muted-foreground leading-relaxed",children:[s.content.split(`
|
|
1
|
+
import{u as ce,a as de,r as i,j as e,B as r,T as oe,n as M,X as me,F as xe,a2 as he,D as ue,b as fe,d as pe,f as je,k as ge,a8 as B,a9 as R,aa as H,ab as L,ac as O,ad as G,o as ve,A as T}from"./index-B81KYk3Z.js";import{C as g,b as Ne,a as _,c as ye}from"./card-bSzcwVEz.js";import{B as U}from"./badge-CgbZdX-R.js";import{u as we}from"./use-terminal-BXYq-vfY.js";import{T as Se}from"./terminal-preview-d_BZ8s8s.js";import{S as Ce,a as be,b as ke,c as Ae,d as w}from"./select-CG6kgyUu.js";import{b as De,e as Me,d as Te,c as Ie,a as $e}from"./pipeline-builders-DrEjlsbH.js";import{R as Ee}from"./refresh-cw-BTHxZiES.js";import{C as Pe,a as ze}from"./chevrons-up-DyHcV7KP.js";import{P as Fe}from"./play-l7Mu5YPO.js";import{C as Be}from"./code-CK8i3Xlg.js";import{C as Re}from"./chevron-up-znuSUWjo.js";import{S as He}from"./server-DzOL5RbP.js";import"./xterm-DTxiCjtJ.js";import"./index-ObZJu-Zv.js";const Le=c=>c?Array.isArray(c)?c.filter(x=>typeof x=="string").map(x=>x.trim()).filter(Boolean):typeof c=="string"?c.split(",").map(x=>x.trim()).filter(Boolean):[]:[];function ts(){const c=ce(),{sessions:x,loading:b,error:I,refreshSessions:S,createSession:V,destroySession:K}=we(),{toast:v}=de(),[$,W]=i.useState([]),[q,X]=i.useState(!0),[j,k]=i.useState(()=>({})),[A,N]=i.useState(!1),[f,J]=i.useState("claude"),[E,Q]=i.useState(""),[D,P]=i.useState(!1),[h,Y]=i.useState([]),[p,y]=i.useState([]),[Z,ee]=i.useState({}),[u,se]=i.useState([]),[o,C]=i.useState([]),te=s=>{const t=Date.now(),a=new Date(s).getTime(),n=Math.max(0,Math.floor((t-a)/1e3));if(n<60)return`${n}s ago`;const d=Math.floor(n/60);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`};i.useEffect(()=>{(async()=>{try{const t=await fetch(`${T}/api/v1/tasks`);if(t.ok){const a=await t.json(),n=a.data||a;W(Array.isArray(n)?n:[])}}catch(t){console.error("Error loading tasks:",t)}finally{X(!1)}})()},[]),i.useEffect(()=>{S()},[S]),i.useEffect(()=>{if(!A)return;(async()=>{try{const t=await fetch(`${T}/api/v1/mcp`);if(t.ok){const a=await t.json();a?.success&&Array.isArray(a.servers)&&(Y(a.servers),y(n=>n.filter(d=>a.servers.includes(d))),a.mcpServers&&typeof a.mcpServers=="object"&&ee(a.mcpServers))}}catch(t){console.error("Failed to load MCP servers",t)}try{const t=await fetch(`${T}/api/v1/skills`);if(t.ok){const a=await t.json(),d=(Array.isArray(a?.documents)?a.documents:[]).map(l=>({id:l.id,name:l?.metadata?.name||l.id,mcpServers:Le(l?.metadata?.metadata?.mcpServers)}));se(d),C(l=>l.filter(F=>d.some(le=>le.id===F)))}}catch(t){console.error("Failed to load skills",t)}})()},[A]),i.useEffect(()=>{o.length!==0&&y(s=>{const t=new Set(s),a=h.length>0?new Set(h):void 0;return o.forEach(n=>{const d=u.find(l=>l.id===n);d&&d.mcpServers.forEach(l=>{(!a||a.has(l))&&t.add(l)})}),Array.from(t)})},[o,u,h]);const m=i.useMemo(()=>x.filter(s=>s.taskId?.startsWith("cp-")||s.taskId?.startsWith("ag-")).sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[x]);i.useEffect(()=>{k(s=>{const t={...s};return m.forEach(a=>{a.id in t||(t[a.id]=!0)}),t})},[m]);const z=i.useMemo(()=>$.filter(s=>s.status==="draft"||s.status==="ready").sort((s,t)=>new Date(t.metadata.createdAt).getTime()-new Date(s.metadata.createdAt).getTime()).slice(0,3),[$]),ae=()=>{const s=m.every(a=>j[a.id]),t={};m.forEach(a=>{t[a.id]=!s}),k(t)},ie=m.length>0&&m.every(s=>j[s.id]),ne=async s=>{await K(s)?(v({title:"Session closed",description:s}),setTimeout(()=>S(),100)):v({title:"Failed to close session",description:s,variant:"destructive"})},re=async()=>{P(!0);try{const s=`session-${Date.now()}`,t={taskId:s,contextType:"change-task",cliAgent:f,mcpServersMap:Z,selectedMcpServers:p,skills:u,selectedSkillIds:o,automationEnabled:!1,customInstruction:E.trim(),includeDefaultInstructions:!1};let a="";f==="claude"?a=De(t):f==="gemini"?a=Me(t):f==="codex"?a=Te(t):f==="droid"?a=Ie(t):f==="kiro"&&(a=$e(t)),await V(s,a)?(v({title:"Coding session started",description:`Session ${s} created`}),N(!1),c(`/terminal/${s}`)):v({title:"Failed to start session",description:"Could not create terminal session",variant:"destructive"})}catch(s){console.error("Error starting coding session:",s),v({title:"Error",description:"Failed to start coding session",variant:"destructive"})}finally{P(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Agents"}),e.jsx("p",{className:"text-muted-foreground hidden sm:block",children:"Manage agents and their active sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>S(),disabled:b,children:[e.jsx(Ee,{className:`h-4 w-4 sm:mr-2 ${b?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),m.length>0&&e.jsx(r,{variant:"outline",size:"sm",onClick:ae,children:ie?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Hide All"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ze,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Show All"})]})}),e.jsxs(r,{size:"sm",onClick:()=>N(!0),children:[e.jsx(Fe,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Interactive Session"})]})]})]}),I&&e.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("div",{className:"text-red-600",children:I})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Sessions"}),b?e.jsx("div",{className:"space-y-2",children:[...Array(2)].map((s,t)=>e.jsx(g,{className:"p-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-4 w-4 rounded bg-muted animate-pulse"}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-40 bg-muted rounded animate-pulse mb-2"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]})]}),e.jsx("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"})]})},t))}):m.length===0?e.jsx(g,{className:"p-8",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx(Be,{className:"h-12 w-12 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No active sessions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Get started by launching an"," ",e.jsx("button",{onClick:()=>N(!0),className:"text-primary hover:underline font-medium",children:"Interactive Session"})," ","or working on a"," ",e.jsx("button",{onClick:()=>c("/tasks"),className:"text-primary hover:underline font-medium",children:"New Task"})]})]})]})}):e.jsx("div",{className:"space-y-2",children:m.slice(0,10).map(s=>e.jsxs(g,{className:"p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(oe,{className:"h-4 w-4 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm",children:s.taskId}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Session ",s.id.split("-").slice(-1)[0].substring(0,8)," • Last activity ",te(s.lastActivity)]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("div",{className:`flex items-center gap-1 ${s.connected?"text-green-600":"text-gray-400"}`,title:s.connected?"Connected":"Disconnected",children:e.jsx("div",{className:`w-2 h-2 rounded-full ${s.connected?"bg-green-500":"bg-gray-400"}`})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>{k(t=>({...t,[s.id]:!t[s.id]}))},"aria-label":j[s.id]?"Hide preview":"Show preview",title:j[s.id]?"Hide preview":"Show preview",children:j[s.id]?e.jsx(Re,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>c(`/terminal/${s.taskId}`),children:"Open"}),e.jsx(r,{size:"icon",variant:"destructive",onClick:()=>ne(s.id),title:"Close session","aria-label":"Close session",children:e.jsx(me,{className:"h-4 w-4"})})]})]}),j[s.id]&&e.jsx("div",{className:"mt-2 w-full p-2 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>c(`/terminal/${s.taskId}`),title:"Click to open full terminal session",children:e.jsx(Se,{sessionId:s.id,heightPx:160,maxScrollback:200})})]},s.id))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"New Tasks"}),q?e.jsx("div",{className:"space-y-3",children:[...Array(3)].map((s,t)=>e.jsx(g,{children:e.jsx(Ne,{className:"py-3",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-2/3 animate-pulse"}),e.jsx("div",{className:"h-3 bg-muted rounded w-1/3 animate-pulse"})]}),e.jsx("div",{className:"h-5 bg-muted rounded w-16 animate-pulse"})]})})},t))}):z.length===0?e.jsx(g,{children:e.jsx(_,{className:"flex items-center justify-center py-6",children:e.jsx("div",{className:"text-center text-sm text-gray-500",children:"No draft or approved tasks found"})})}):e.jsx("div",{className:"space-y-2",children:z.map(s=>e.jsx(g,{className:"hover:shadow-md transition-all cursor-pointer hover:border-primary/50",onClick:()=>c(`/terminal/${s.id}`),children:e.jsx(_,{className:"py-4",children:e.jsx("div",{className:"flex justify-between items-start gap-4",children:e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(ye,{className:"text-base leading-tight",children:s.title||s.intent}),e.jsxs("div",{className:"flex gap-1 ml-3 flex-shrink-0",children:[s.priority&&e.jsx(U,{variant:s.priority==="high"||s.priority==="critical"?"destructive":s.priority==="medium"?"secondary":"outline",className:"text-xs",children:s.priority}),e.jsx(U,{variant:"default",className:"text-xs",children:s.status})]})]}),s.content&&e.jsxs("div",{className:"text-sm text-muted-foreground leading-relaxed",children:[s.content.split(`
|
|
2
2
|
`).slice(0,2).join(" ").substring(0,150),s.content.length>150?"...":""]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.id," • by ",s.author.name," • ",new Date(s.metadata.createdAt).toLocaleDateString()]}),e.jsxs("div",{className:"flex gap-2",onClick:t=>t.stopPropagation(),children:[e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>c(`/tasks/${s.id}`),className:"h-7 px-2 text-xs",children:[e.jsx(xe,{className:"h-3 w-3 mr-1"})," View"]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>c(`/tasks/${s.id}/edit`),className:"h-7 px-2 text-xs",children:[e.jsx(he,{className:"h-3 w-3 mr-1"})," Edit"]})]})]})]})})})},s.id))})]}),e.jsx(ue,{open:A,onOpenChange:N,children:e.jsxs(fe,{className:"max-w-lg",children:[e.jsxs(pe,{children:[e.jsx(je,{children:"Start Agent"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Start an interactive session"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Agent"}),e.jsxs(Ce,{value:f,onValueChange:s=>J(s),children:[e.jsx(be,{className:"w-full",children:e.jsx(ke,{placeholder:"Select coding agent"})}),e.jsxs(Ae,{children:[e.jsx(w,{value:"claude",children:"Claude Code"}),e.jsx(w,{value:"gemini",children:"Google Gemini"}),e.jsx(w,{value:"codex",children:"OpenAI Codex"}),e.jsx(w,{value:"droid",children:"Factory Droid"}),e.jsx(w,{value:"kiro",children:"Kiro"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4"}),"Skills"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[o.length," of ",u.length," selected"]})]}),e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsxs(r,{variant:"outline",className:"w-full justify-between",children:[o.length===0?"Select skills...":o.length===u.length?"All skills selected":`${o.length} skill${o.length!==1?"s":""} selected`,e.jsx(M,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(H,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(L,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Skills"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),C(u.map(t=>t.id))},children:"All"}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),C([])},children:"None"})]})]}),e.jsx(O,{}),u.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No skills found"}):u.map(s=>e.jsx(G,{checked:o.includes(s.id),onCheckedChange:t=>{C(a=>t?a.includes(s.id)?a:[...a,s.id]:a.filter(n=>n!==s.id))},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:s.name}),s.mcpServers.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP servers: ",s.mcpServers.join(", ")]}),s.mcpServers.length===0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Inherits available MCP servers"})]})},s.id))]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(He,{className:"h-4 w-4"}),"MCP Servers"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[p.length," of ",h.length," selected"]})]}),e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsxs(r,{variant:"outline",className:"w-full justify-between",children:[p.length===0?"Select MCP servers...":p.length===h.length?"All servers selected":`${p.length} server${p.length!==1?"s":""} selected`,e.jsx(M,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(H,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(L,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Servers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),y(h)},children:"All"}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),y([])},children:"None"})]})]}),e.jsx(O,{}),h.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No MCP servers found"}):h.map(s=>e.jsx(G,{checked:p.includes(s),onCheckedChange:t=>{y(a=>t?a.includes(s)?a:[...a,s]:a.filter(n=>n!==s))},children:s},s))]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Additional Instructions (optional)"}),e.jsx(ve,{value:E,onChange:s=>Q(s.target.value),placeholder:"Add any custom instructions for the coding agent...",rows:4,className:"resize-none"})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(r,{variant:"outline",onClick:()=>N(!1),disabled:D,children:"Cancel"}),e.jsx(r,{onClick:re,disabled:D,children:D?"Starting...":"Start Session"})]})]})]})})]})}export{ts as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,j as e,e as a,n as m}from"./index-
|
|
1
|
+
import{r as x,j as e,e as a,n as m}from"./index-B81KYk3Z.js";function u({title:n,description:t,icon:r,defaultOpen:o=!1,children:i,className:l}){const[s,d]=x.useState(o);return e.jsxs("div",{className:a("rounded-lg border bg-card text-card-foreground",l),children:[e.jsxs("button",{type:"button",onClick:()=>d(c=>!c),className:"flex w-full items-center justify-between gap-4 px-4 py-3 text-left","aria-expanded":s,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r,e.jsxs("div",{children:[e.jsx("p",{className:"font-medium leading-tight",children:n}),t&&e.jsx("p",{className:"text-sm text-muted-foreground leading-snug",children:t})]})]}),e.jsx(m,{className:a("h-4 w-4 shrink-0 transition-transform duration-200",s?"rotate-180":"rotate-0")})]}),s&&e.jsx("div",{className:"border-t px-4 py-4",children:i})]})}export{u as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as b,u as Re,a as Le,r as l,j as e,D as De,b as Ie,d as te,e as f,f as ae,g as ne,S as re,B as d,C as le,I as B,h as G,i as Pe,G as _e,F as qe,k as ue,Z as We,l as ze,m as Fe,T as ce,n as Ve,o as Be,L as v,P as Ee,M as Ke,K as A,p as g,q as $e,A as Ge}from"./index-
|
|
1
|
+
import{c as b,u as Re,a as Le,r as l,j as e,D as De,b as Ie,d as te,e as f,f as ae,g as ne,S as re,B as d,C as le,I as B,h as G,i as Pe,G as _e,F as qe,k as ue,Z as We,l as ze,m as Fe,T as ce,n as Ve,o as Be,L as v,P as Ee,M as Ke,K as A,p as g,q as $e,A as Ge}from"./index-B81KYk3Z.js";import{C as h,a as u,b as R,c as L,d as ie}from"./card-bSzcwVEz.js";import{B as He}from"./badge-CgbZdX-R.js";import{g as Oe}from"./status-utils-PwF3DXLL.js";import{L as Ye}from"./label-CHP4q6u3.js";import{S as oe,a as de,b as me,c as xe,d as E}from"./select-CG6kgyUu.js";import{u as Qe}from"./use-terminal-BXYq-vfY.js";import{T as Ue}from"./terminal-preview-d_BZ8s8s.js";import{C as Ze}from"./circle-check-2Hh5KJn8.js";import{C as Je}from"./chevron-left-Dnm2Bv2g.js";import{S as Xe}from"./search-Cpy49h7H.js";import{G as es}from"./globe--bHEtjre.js";import{C as ss}from"./code-CK8i3Xlg.js";import{F as ts}from"./folder-git-2-CKR2HcNZ.js";import{E as as}from"./external-link-kQIXuJh_.js";import{P as ns}from"./play-l7Mu5YPO.js";import{C as rs}from"./clock-B36ytcOX.js";import{C as ls}from"./circle-check-big-HUp82Tz-.js";import"./index-ObZJu-Zv.js";import"./chevron-up-znuSUWjo.js";import"./xterm-DTxiCjtJ.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as le,A as l,bK as ws,r as n,a as vs,ag as ys,j as e,L as ee,l as Fe,B as o,G as D,ae as Ns,X as Cs,I as k,n as Me,Q as Be,D as se,b as te,d as ae,f as re,g as ne,bH as ks,a1 as Oe}from"./index-
|
|
1
|
+
import{c as le,A as l,bK as ws,r as n,a as vs,ag as ys,j as e,L as ee,l as Fe,B as o,G as D,ae as Ns,X as Cs,I as k,n as Me,Q as Be,D as se,b as te,d as ae,f as re,g as ne,bH as ks,a1 as Oe}from"./index-B81KYk3Z.js";import{C as ie}from"./card-bSzcwVEz.js";import{L as Re}from"./label-CHP4q6u3.js";import{T as Ss,a as Ps,b as Ge,c as We}from"./tabs-DJk1ZrWh.js";import{C as Ts}from"./circle-check-2Hh5KJn8.js";import{C as As}from"./circle-x-DBrbnMPA.js";import{A as Ds}from"./arrow-down-DwCDIVHH.js";import{A as Es}from"./arrow-up-ClZJeJXS.js";import{R as ze}from"./refresh-cw-BTHxZiES.js";import{C as ce}from"./circle-alert-Dn8B5NPI.js";import{C as Ue}from"./chevron-up-znuSUWjo.js";import{F as oe}from"./folder-git-2-CKR2HcNZ.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as He,r,a as Te,A as u,j as e,bB as he,B as o,Q as Fe,v as De,bH as ze,I as U,D as W,b as B,d as q,f as J,g as K,a1 as Y}from"./index-
|
|
1
|
+
import{c as He,r,a as Te,A as u,j as e,bB as he,B as o,Q as Fe,v as De,bH as ze,I as U,D as W,b as B,d as q,f as J,g as K,a1 as Y}from"./index-B81KYk3Z.js";import{C as xe,b as pe,c as ge,d as fe,a as be}from"./card-bSzcwVEz.js";import{L as f}from"./label-CHP4q6u3.js";import{R as Me,a as je}from"./radio-group-DxYoqBDN.js";import{R as A}from"./refresh-cw-BTHxZiES.js";import{E as ve}from"./external-link-kQIXuJh_.js";import{C as Oe}from"./circle-check-2Hh5KJn8.js";import{C as Ie}from"./circle-x-DBrbnMPA.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ge,a as ve,r as u,j as e,v as se,B as x,a5 as fe,a4 as Ne,bz as Te,i as be,Z as Ce,bA as Se,I as c,o as O,ae,P as E,bB as ne,Q as we,A as ie}from"./index-
|
|
1
|
+
import{c as ge,a as ve,r as u,j as e,v as se,B as x,a5 as fe,a4 as Ne,bz as Te,i as be,Z as Ce,bA as Se,I as c,o as O,ae,P as E,bB as ne,Q as we,A as ie}from"./index-B81KYk3Z.js";import{C as y,b as j,c as g,d as v,a as f,e as Ae}from"./card-bSzcwVEz.js";import{L as o}from"./label-CHP4q6u3.js";import{B as re}from"./badge-CgbZdX-R.js";import{S as ke,a as Ie,b as Oe,c as Fe,d as Pe}from"./select-CG6kgyUu.js";import{A as Ee,a as Me}from"./alert-a0XoDY__.js";import{T as De,a as Le,b as C,c as S}from"./tabs-DJk1ZrWh.js";import{E as Ue}from"./eye-DTyfbeQg.js";import{C as _e,a as Re}from"./clipboard-B6OwO-az.js";import"./index-ObZJu-Zv.js";import"./chevron-up-znuSUWjo.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as u,j as e,e as p,B as c,Q as x,I as j,P as v}from"./index-
|
|
1
|
+
import{c as u,j as e,e as p,B as c,Q as x,I as j,P as v}from"./index-B81KYk3Z.js";import{L as r}from"./label-CHP4q6u3.js";import{S,a as y,b,c as f,d as k}from"./select-CG6kgyUu.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|