@lovelybunch/api 1.0.76 → 1.0.77-alpha.0
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/lib/terminal/terminal-manager.js +2 -1
- package/dist/routes/api/v1/events/status/route.d.ts +1 -1
- package/dist/routes/api/v1/jobs/[id]/route.d.ts +16 -16
- package/dist/routes/api/v1/jobs/[id]/run/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/[id]/runs/[runId]/route.d.ts +2 -2
- package/dist/routes/api/v1/jobs/route.d.ts +16 -16
- package/dist/routes/api/v1/jobs/status/route.d.ts +1 -1
- package/dist/routes/api/v1/mail/route.d.ts +3 -3
- package/dist/routes/api/v1/slack/route.d.ts +6 -6
- package/dist/routes/api/v1/tasks/[id]/route.d.ts +4 -4
- package/dist/routes/api/v1/tasks/[id]/steps/[stepId]/route.d.ts +2 -2
- package/dist/routes/api/v1/tasks/route.d.ts +1 -1
- package/dist/server-with-static.js +23 -17
- package/dist/server.js +1 -0
- package/package.json +24 -23
- package/static/assets/{ActivityPage-sJEQn6DK.js → ActivityPage-rASRHKYj.js} +1 -1
- package/static/assets/{AgentsContextEditPage-DU3qIXk9.js → AgentsContextEditPage-CMWD-7mS.js} +1 -1
- package/static/assets/{AgentsContextPage-tJ-LhFYb.js → AgentsContextPage-VfMmxxr6.js} +1 -1
- package/static/assets/{ApiKeysSettingsPage-Bg84BQHV.js → ApiKeysSettingsPage-DxtuyXwn.js} +1 -1
- package/static/assets/{AuthSettingsPage-Bwr7uP3z.js → AuthSettingsPage-CWTpS6BA.js} +2 -2
- package/static/assets/{CallbackPage-BFn0Np2S.js → CallbackPage-CjlTVuif.js} +1 -1
- package/static/assets/{CodePage-kp4s3wCJ.js → CodePage-DwjtGxQi.js} +1 -1
- package/static/assets/{CollapsibleSection-CNs1mvsZ.js → CollapsibleSection-LrQJlSxD.js} +1 -1
- package/static/assets/{DashboardPage-DMJSzzgD.js → DashboardPage-DnyFyDO0.js} +2 -2
- package/static/assets/{GitPage-uqene8zj.js → GitPage-o37iQMYQ.js} +1 -1
- package/static/assets/{GitSettingsPage-CLswbZsT.js → GitSettingsPage-O0fe5kxm.js} +1 -1
- package/static/assets/{IdentityPage-BDTPXEo7.js → IdentityPage-KWjruliO.js} +1 -1
- package/static/assets/{ImplementationStepsEditor-D4cvhPhz.js → ImplementationStepsEditor-h_Mxu1tF.js} +1 -1
- package/static/assets/{IntegrationsSettingsPage-o7NXZGt9.js → IntegrationsSettingsPage-DeFQd6af.js} +1 -1
- package/static/assets/{JobDetailPage-DuEiPz6X.js → JobDetailPage-HOLpF7Sx.js} +1 -1
- package/static/assets/{KnowledgeDetailPage-DFVud_VC.js → KnowledgeDetailPage-C5egPQ54.js} +1 -1
- package/static/assets/KnowledgeEditPage-DrdvEGuR.js +1 -0
- package/static/assets/{KnowledgePage-B2zI3xwW.js → KnowledgePage-CK5rtZcv.js} +1 -1
- package/static/assets/{LoginPage-CUJRxwXy.js → LoginPage-DajEouCN.js} +1 -1
- package/static/assets/MailInboxPage-CewILL7o.js +1 -0
- package/static/assets/{MailProcessingModal-BJIdHOqK.js → MailProcessingModal-B1ZLXyYl.js} +1 -1
- package/static/assets/MailReadPage--LnQ743i.js +1 -0
- package/static/assets/MailSentPage-BqO4iBq6.js +1 -0
- package/static/assets/{McpSettingsPage-BZcCGkGM.js → McpSettingsPage-BZ6GJOtk.js} +1 -1
- package/static/assets/{MemoryEditPage-DXSQoCT4.js → MemoryEditPage-BLfdKEDu.js} +1 -1
- package/static/assets/{MemoryPage-oBnyuvSf.js → MemoryPage-BV0RlvUS.js} +1 -1
- package/static/assets/{NewKnowledgePage-deMsezK8.js → NewKnowledgePage-SrBhXpH6.js} +1 -1
- package/static/assets/{NewSkillPage-DRYWdrlV.js → NewSkillPage-vt-0rIkv.js} +1 -1
- package/static/assets/{NewTaskPage-B6xdic5_.js → NewTaskPage-CBUpwIFP.js} +1 -1
- package/static/assets/{NotFoundPage-Bxu9uKFO.js → NotFoundPage-CWF5qOC0.js} +1 -1
- package/static/assets/{NotificationsSettingsPage-CLgtsCVM.js → NotificationsSettingsPage-3ZvMrqiq.js} +1 -1
- package/static/assets/{PromptsSettingsPage-BWaELCjG.js → PromptsSettingsPage-pHKoiUPI.js} +1 -1
- package/static/assets/{ResourceDetailPage-CMPDRdVM.js → ResourceDetailPage-CE4iDbv7.js} +1 -1
- package/static/assets/{ResourcesPage-DspYILfG.js → ResourcesPage-4_5NA4RF.js} +1 -1
- package/static/assets/{RoleEditPage-DXtzicVZ.js → RoleEditPage-4sSELIRX.js} +1 -1
- package/static/assets/{RolePage-DafGURGp.js → RolePage-Ds17xn4X.js} +1 -1
- package/static/assets/{RulesSettingsPage-E8V9cexV.js → RulesSettingsPage-DnyGaden.js} +1 -1
- package/static/assets/{RunDetailPage-DsxkqFst.js → RunDetailPage-D2ajvKfh.js} +1 -1
- package/static/assets/SchedulePage-oEGct1B1.js +4 -0
- package/static/assets/{SkillDetailPage-CWkqSfuT.js → SkillDetailPage-mSypV_JK.js} +1 -1
- package/static/assets/{SkillEditPage-DwyebzFV.js → SkillEditPage-DeI8uu3S.js} +1 -1
- package/static/assets/{SkillsPage-CauK65X_.js → SkillsPage-Bb_dEdun.js} +1 -1
- package/static/assets/{SkillsSettingsPage-DXMRv3jR.js → SkillsSettingsPage-CMWf2O9y.js} +1 -1
- package/static/assets/SourceInput-CtyUOXOG.js +1 -0
- package/static/assets/{TagInput-Ct-WRvTs.js → TagInput-C0NyMxlY.js} +1 -1
- package/static/assets/{TaskDetailPage-CApk2iBh.js → TaskDetailPage-6DDI0juh.js} +1 -1
- package/static/assets/{TaskEditPage-NgOVShfK.js → TaskEditPage-Btc1NXtR.js} +1 -1
- package/static/assets/{TasksPage-BoPrP_Rl.js → TasksPage-C9TYvqRz.js} +1 -1
- package/static/assets/{TeamEditPage-ChY6mYm8.js → TeamEditPage-CLvNy6Ss.js} +1 -1
- package/static/assets/{TeamPage-DH-dJhFG.js → TeamPage-DSWax4fa.js} +1 -1
- package/static/assets/{TerminalPage-CRhcscF2.js → TerminalPage-DNDHEYJZ.js} +1 -1
- package/static/assets/{TerminalSessionPage-CSCQg2sn.js → TerminalSessionPage-nNCw_oDE.js} +1 -1
- package/static/assets/{UserPreferencesPage-DxCSWJnS.js → UserPreferencesPage-jc1SA79x.js} +1 -1
- package/static/assets/{UserSettingsPage-DKkOLNPV.js → UserSettingsPage-pr6n15Pz.js} +1 -1
- package/static/assets/{UtilitiesPage-CBNSvixW.js → UtilitiesPage-CjLb989o.js} +1 -1
- package/static/assets/{alert-Dw_RSroN.js → alert-BtkLXQ3p.js} +1 -1
- package/static/assets/{arrow-down-UClxXzT-.js → arrow-down-DnNLmXEs.js} +1 -1
- package/static/assets/{arrow-left-DWmf9YJp.js → arrow-left-B9NBHEkS.js} +1 -1
- package/static/assets/{arrow-up-down-Btc3okb3.js → arrow-up-down-DIuMvAne.js} +1 -1
- package/static/assets/{arrow-up-fLCh7Hvh.js → arrow-up-eMUJY7J9.js} +1 -1
- package/static/assets/{badge-vIqE5SOP.js → badge-BbfU_aPt.js} +1 -1
- package/static/assets/{browser-modal-DgMJTsMd.js → browser-modal-J9l3o5os.js} +1 -1
- package/static/assets/{card-DPLdBoa5.js → card-CL5bB4cs.js} +1 -1
- package/static/assets/{chevron-left-CiNaLX-v.js → chevron-left-B-7K6MNx.js} +1 -1
- package/static/assets/{chevron-up-DFd-7wxW.js → chevron-up-BwTmMEW2.js} +1 -1
- package/static/assets/{chevrons-up-BfU70OcQ.js → chevrons-up-jI6nxhrz.js} +1 -1
- package/static/assets/{circle-alert-Mv00T-P2.js → circle-alert-vJFSz39V.js} +1 -1
- package/static/assets/{circle-check-xMiP6SLO.js → circle-check-D2LVHMl-.js} +1 -1
- package/static/assets/{circle-check-big-BEY1IoIP.js → circle-check-big-BwQ_q1N7.js} +1 -1
- package/static/assets/{circle-play-iZZwaGbV.js → circle-play-CLKDBkrK.js} +1 -1
- package/static/assets/{circle-x-z3iynaE7.js → circle-x-CuUVLiI-.js} +1 -1
- package/static/assets/{clipboard-C8wZRPDH.js → clipboard-BHOFelnW.js} +1 -1
- package/static/assets/{clock-C_9shc08.js → clock-D-X3KCw6.js} +1 -1
- package/static/assets/{code-DH-sRhus.js → code-DqYaanki.js} +1 -1
- package/static/assets/{download-CE8b59ER.js → download-DeEju9jg.js} +1 -1
- package/static/assets/{external-link-DPyKt8NE.js → external-link-CrRz0sU-.js} +1 -1
- package/static/assets/{eye-BpGD-yoS.js → eye-Cx9ZGkg5.js} +1 -1
- package/static/assets/{folder-git-2-BIw4zbmy.js → folder-git-2-Cizv1NA6.js} +1 -1
- package/static/assets/{globe-CUo7eHKN.js → globe-lpD9Jv31.js} +1 -1
- package/static/assets/{index-jaRIZ6SY.js → index-BCYTbJRb.js} +1 -1
- package/static/assets/{index-CTouvf2d.js → index-BL-5Bhtg.js} +1 -1
- package/static/assets/{index-BaR4iUzg.js → index-BPdWQ0rI.js} +1 -1
- package/static/assets/{index-B07hel4U.js → index-BVrOTqTm.js} +1 -1
- package/static/assets/{index-iB8oed57.js → index-BknCCMZK.js} +1 -1
- package/static/assets/{index-CpJ0uBf3.js → index-BvZJRqTz.js} +1 -1
- package/static/assets/{index-UXL5-kaP.js → index-ByTA2ZiD.js} +6 -6
- package/static/assets/{index-ClO9-JVh.js → index-CMaK0hpv.js} +1 -1
- package/static/assets/{index-Bkt1rQVV.js → index-CkT4WgqR.js} +1 -1
- package/static/assets/{index-DnZKG-_7.js → index-CuLP7P_G.js} +1 -1
- package/static/assets/{index-CsBxEWw5.js → index-D12O6wM3.js} +1 -1
- package/static/assets/{index-DZAYfTI2.js → index-DIt703WU.js} +1 -1
- package/static/assets/{index-CGbmjmEy.js → index-DK1gGyTZ.js} +1 -1
- package/static/assets/index-DVMcu9sQ.css +1 -0
- package/static/assets/{index-Bfb3OTwj.js → index-Dc9Njo8L.js} +1 -1
- package/static/assets/{index-BCwmQxLC.js → index-DgAcL75U.js} +1 -1
- package/static/assets/{index-C65b3D5_.js → index-Djzp98Vj.js} +1 -1
- package/static/assets/{index-BOKaM9K-.js → index-Dnj5cWsp.js} +1 -1
- package/static/assets/{index-Dkr9CBL7.js → index-Hy3cH93B.js} +1 -1
- package/static/assets/{index-Cdwx6Zps.js → index-ihWq-CVE.js} +1 -1
- package/static/assets/{info-D-UNBNx2.js → info-DxhTCbw1.js} +1 -1
- package/static/assets/{label-8VKluf9w.js → label-Dp0-28_O.js} +1 -1
- package/static/assets/{markdown-editor-DBdRsbP2.js → markdown-editor-DUmrf1eN.js} +3 -3
- package/static/assets/{message-square-CO8kDUed.js → message-square-BPOApeM3.js} +1 -1
- package/static/assets/{paperclip-DlLXZbru.js → paperclip-Bfjc1WLZ.js} +1 -1
- package/static/assets/{pause-zSiaxJBu.js → pause-Bfz-QQZp.js} +1 -1
- package/static/assets/{pipeline-builders-Bkf0wt_O.js → pipeline-builders-DrEjlsbH.js} +1 -1
- package/static/assets/{play-DVBhRokt.js → play-fOwEoIcu.js} +1 -1
- package/static/assets/{radio-group-CThYUcA4.js → radio-group-B8RB7N01.js} +1 -1
- package/static/assets/{refresh-cw-tXYl1ePu.js → refresh-cw-Cj_5MZiJ.js} +1 -1
- package/static/assets/{search-BxF7Wwex.js → search-BgbqRUnf.js} +1 -1
- package/static/assets/{select-CyHFRA1Y.js → select-CfwLZl55.js} +1 -1
- package/static/assets/{server-lRxThHjr.js → server-u9FLHclt.js} +1 -1
- package/static/assets/{switch-BUpDbrux.js → switch-CX_Inx_p.js} +1 -1
- package/static/assets/{tabs-DkvCmQEX.js → tabs-Bj0YyeRI.js} +1 -1
- package/static/assets/{tag-CkcZNLnh.js → tag-rYG4CdRx.js} +1 -1
- package/static/assets/terminal-preview-BNm5-Umi.js +1 -0
- package/static/assets/{triangle-alert-CmjG_mbF.js → triangle-alert-C0ovMJwZ.js} +1 -1
- package/static/assets/{use-terminal-D3iV7-iC.js → use-terminal-D1UnvAVs.js} +1 -1
- package/static/assets/{video-CY_dOujm.js → video-CuyRES-H.js} +1 -1
- package/static/index.html +2 -2
- package/static/assets/KnowledgeEditPage-XG6HKK7E.js +0 -1
- package/static/assets/MailInboxPage-BlCG-tba.js +0 -1
- package/static/assets/MailReadPage-MoNo_gmW.js +0 -1
- package/static/assets/MailSentPage-QzpuIJmT.js +0 -1
- package/static/assets/SchedulePage-B2YvNDHr.js +0 -4
- package/static/assets/SourceInput-C0iKqbQ1.js +0 -1
- package/static/assets/index-BcCuKdbf.css +0 -1
- package/static/assets/terminal-preview-CLWDhoOZ.js +0 -1
|
@@ -2,6 +2,7 @@ import * as pty from 'node-pty';
|
|
|
2
2
|
import { WebSocket } from 'ws';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import fs from 'fs';
|
|
5
|
+
import { randomBytes } from 'crypto';
|
|
5
6
|
import { fileURLToPath } from 'url';
|
|
6
7
|
import { createInitScript } from './context-helper.js';
|
|
7
8
|
import { getShellPath, getShellArgs, prepareShellInit } from './shell-utils.js';
|
|
@@ -48,7 +49,7 @@ export class TerminalManager {
|
|
|
48
49
|
ensureSpawnHelperPermissions();
|
|
49
50
|
spawnHelperFixed = true;
|
|
50
51
|
}
|
|
51
|
-
const sessionId = `${taskId}-${Date.now()}-${
|
|
52
|
+
const sessionId = `${taskId}-${Date.now()}-${randomBytes(9).toString('base64url')}`;
|
|
52
53
|
// Get the project root directory
|
|
53
54
|
let projectRoot;
|
|
54
55
|
if (process.env.NODE_ENV === 'development' && process.env.GAIT_DEV_ROOT) {
|
|
@@ -7,9 +7,9 @@ import { Context } from "hono";
|
|
|
7
7
|
* Get logging system status and configuration
|
|
8
8
|
*/
|
|
9
9
|
export declare function GET(c: Context): Promise<(Response & import("hono").TypedResponse<{
|
|
10
|
-
[x: string]: any;
|
|
11
10
|
currentFile: string;
|
|
12
11
|
sizeBytes: number;
|
|
12
|
+
lastSeq: number;
|
|
13
13
|
rotateBytes: number;
|
|
14
14
|
logsDir: string;
|
|
15
15
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
@@ -21,12 +21,9 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
21
21
|
timezone?: string;
|
|
22
22
|
anchorHour?: number;
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
status: ScheduledJobStatus;
|
|
25
25
|
id: string;
|
|
26
26
|
name: string;
|
|
27
|
-
prompt: string;
|
|
28
|
-
model: string;
|
|
29
|
-
status: ScheduledJobStatus;
|
|
30
27
|
metadata: {
|
|
31
28
|
createdAt: string;
|
|
32
29
|
updatedAt: string;
|
|
@@ -34,16 +31,19 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
34
31
|
nextRunAt?: string;
|
|
35
32
|
};
|
|
36
33
|
tags?: string[];
|
|
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
|
-
error?: string;
|
|
43
|
-
id: string;
|
|
44
|
-
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
45
42
|
jobId: string;
|
|
46
43
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
44
|
+
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
45
|
+
error?: string;
|
|
46
|
+
id: string;
|
|
47
47
|
startedAt: string;
|
|
48
48
|
finishedAt?: string;
|
|
49
49
|
}[];
|
|
@@ -82,12 +82,9 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
82
82
|
timezone?: string;
|
|
83
83
|
anchorHour?: number;
|
|
84
84
|
};
|
|
85
|
-
|
|
85
|
+
status: ScheduledJobStatus;
|
|
86
86
|
id: string;
|
|
87
87
|
name: string;
|
|
88
|
-
prompt: string;
|
|
89
|
-
model: string;
|
|
90
|
-
status: ScheduledJobStatus;
|
|
91
88
|
metadata: {
|
|
92
89
|
createdAt: string;
|
|
93
90
|
updatedAt: string;
|
|
@@ -95,16 +92,19 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
95
92
|
nextRunAt?: string;
|
|
96
93
|
};
|
|
97
94
|
tags?: string[];
|
|
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
|
-
error?: string;
|
|
104
|
-
id: string;
|
|
105
|
-
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
106
103
|
jobId: string;
|
|
107
104
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
105
|
+
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
106
|
+
error?: string;
|
|
107
|
+
id: string;
|
|
108
108
|
startedAt: string;
|
|
109
109
|
finishedAt?: string;
|
|
110
110
|
}[];
|
|
@@ -12,8 +12,8 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
|
|
|
12
12
|
run: {
|
|
13
13
|
id: string;
|
|
14
14
|
jobId: string;
|
|
15
|
-
trigger: import("
|
|
16
|
-
status: import("
|
|
15
|
+
trigger: import("node_modules/@lovelybunch/types/src/index.js").ScheduledJobTrigger;
|
|
16
|
+
status: import("node_modules/@lovelybunch/types/src/index.js").ScheduledJobRunStatus;
|
|
17
17
|
startedAt: string;
|
|
18
18
|
finishedAt?: string;
|
|
19
19
|
outputPath?: string;
|
|
@@ -10,8 +10,8 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
10
10
|
data: {
|
|
11
11
|
id: string;
|
|
12
12
|
jobId: string;
|
|
13
|
-
trigger: import("
|
|
14
|
-
status: import("
|
|
13
|
+
trigger: import("node_modules/@lovelybunch/types/src/index.js").ScheduledJobTrigger;
|
|
14
|
+
status: import("node_modules/@lovelybunch/types/src/index.js").ScheduledJobRunStatus;
|
|
15
15
|
startedAt: string;
|
|
16
16
|
finishedAt?: string;
|
|
17
17
|
outputPath?: string;
|
|
@@ -23,12 +23,9 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
23
23
|
timezone?: string;
|
|
24
24
|
anchorHour?: number;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
status: ScheduledJobStatus;
|
|
27
27
|
id: string;
|
|
28
28
|
name: string;
|
|
29
|
-
prompt: string;
|
|
30
|
-
model: string;
|
|
31
|
-
status: ScheduledJobStatus;
|
|
32
29
|
metadata: {
|
|
33
30
|
createdAt: string;
|
|
34
31
|
updatedAt: string;
|
|
@@ -36,16 +33,19 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
36
33
|
nextRunAt?: string;
|
|
37
34
|
};
|
|
38
35
|
tags?: string[];
|
|
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
|
-
error?: string;
|
|
45
|
-
id: string;
|
|
46
|
-
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
47
44
|
jobId: string;
|
|
48
45
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
46
|
+
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
47
|
+
error?: string;
|
|
48
|
+
id: string;
|
|
49
49
|
startedAt: string;
|
|
50
50
|
finishedAt?: string;
|
|
51
51
|
}[];
|
|
@@ -78,12 +78,9 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
|
|
|
78
78
|
timezone?: string;
|
|
79
79
|
anchorHour?: number;
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
status: ScheduledJobStatus;
|
|
82
82
|
id: string;
|
|
83
83
|
name: string;
|
|
84
|
-
prompt: string;
|
|
85
|
-
model: string;
|
|
86
|
-
status: ScheduledJobStatus;
|
|
87
84
|
metadata: {
|
|
88
85
|
createdAt: string;
|
|
89
86
|
updatedAt: string;
|
|
@@ -91,16 +88,19 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
|
|
|
91
88
|
nextRunAt?: string;
|
|
92
89
|
};
|
|
93
90
|
tags?: string[];
|
|
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
|
-
error?: string;
|
|
100
|
-
id: string;
|
|
101
|
-
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
102
99
|
jobId: string;
|
|
103
100
|
trigger: import("@lovelybunch/types").ScheduledJobTrigger;
|
|
101
|
+
status: import("@lovelybunch/types").ScheduledJobRunStatus;
|
|
102
|
+
error?: string;
|
|
103
|
+
id: string;
|
|
104
104
|
startedAt: string;
|
|
105
105
|
finishedAt?: string;
|
|
106
106
|
}[];
|
|
@@ -7,7 +7,7 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
7
7
|
runningCount: number;
|
|
8
8
|
jobs: {
|
|
9
9
|
id: string;
|
|
10
|
-
status: import("
|
|
10
|
+
status: import("node_modules/@lovelybunch/types/src/index.js").ScheduledJobStatus;
|
|
11
11
|
nextRunAt?: string;
|
|
12
12
|
lastRunAt?: string;
|
|
13
13
|
timerActive: boolean;
|
|
@@ -116,7 +116,7 @@ export declare function setMailStatusHandler(c: Context): Promise<(Response & im
|
|
|
116
116
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
117
117
|
success: false;
|
|
118
118
|
error: any;
|
|
119
|
-
},
|
|
119
|
+
}, 404 | 500, "json">)>;
|
|
120
120
|
/**
|
|
121
121
|
* POST /api/v1/mail/:id/reply
|
|
122
122
|
* Reply to an email
|
|
@@ -154,7 +154,7 @@ export declare function replyMailHandler(c: Context): Promise<(Response & import
|
|
|
154
154
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
155
155
|
success: false;
|
|
156
156
|
error: any;
|
|
157
|
-
},
|
|
157
|
+
}, 404 | 500, "json">)>;
|
|
158
158
|
/**
|
|
159
159
|
* POST /api/v1/mail/send
|
|
160
160
|
* Send an email (coming soon)
|
|
@@ -217,7 +217,7 @@ export declare function setMailActionHandler(c: Context): Promise<(Response & im
|
|
|
217
217
|
}, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
|
|
218
218
|
success: false;
|
|
219
219
|
error: any;
|
|
220
|
-
},
|
|
220
|
+
}, 404 | 500, "json">)>;
|
|
221
221
|
/**
|
|
222
222
|
* GET /api/v1/mail/:id/processing
|
|
223
223
|
* Get processing status and log tail for an email
|
|
@@ -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
|
};
|
|
@@ -13,7 +13,7 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
13
13
|
intent?: string;
|
|
14
14
|
content?: string;
|
|
15
15
|
author: {
|
|
16
|
-
type: import("
|
|
16
|
+
type: import("node_modules/@lovelybunch/types/src/index.js").AuthorType;
|
|
17
17
|
id: string;
|
|
18
18
|
name: string;
|
|
19
19
|
email?: string;
|
|
@@ -29,7 +29,7 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
|
|
|
29
29
|
error?: string;
|
|
30
30
|
executedAt?: string;
|
|
31
31
|
}[];
|
|
32
|
-
status: import("
|
|
32
|
+
status: import("node_modules/@lovelybunch/types/src/index.js").TaskStatus;
|
|
33
33
|
comments?: {
|
|
34
34
|
id: string;
|
|
35
35
|
author: string;
|
|
@@ -60,7 +60,7 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
60
60
|
intent?: string;
|
|
61
61
|
content?: string;
|
|
62
62
|
author: {
|
|
63
|
-
type: import("
|
|
63
|
+
type: import("node_modules/@lovelybunch/types/src/index.js").AuthorType;
|
|
64
64
|
id: string;
|
|
65
65
|
name: string;
|
|
66
66
|
email?: string;
|
|
@@ -76,7 +76,7 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
76
76
|
error?: string;
|
|
77
77
|
executedAt?: string;
|
|
78
78
|
}[];
|
|
79
|
-
status: import("
|
|
79
|
+
status: import("node_modules/@lovelybunch/types/src/index.js").TaskStatus;
|
|
80
80
|
comments?: {
|
|
81
81
|
id: string;
|
|
82
82
|
author: string;
|
|
@@ -19,7 +19,7 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
19
19
|
intent?: string;
|
|
20
20
|
content?: string;
|
|
21
21
|
author: {
|
|
22
|
-
type: import("
|
|
22
|
+
type: import("node_modules/@lovelybunch/types/src/index.js").AuthorType;
|
|
23
23
|
id: string;
|
|
24
24
|
name: string;
|
|
25
25
|
email?: string;
|
|
@@ -35,7 +35,7 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
|
|
|
35
35
|
error?: string;
|
|
36
36
|
executedAt?: string;
|
|
37
37
|
}[];
|
|
38
|
-
status: import("
|
|
38
|
+
status: import("node_modules/@lovelybunch/types/src/index.js").TaskStatus;
|
|
39
39
|
comments?: {
|
|
40
40
|
id: string;
|
|
41
41
|
author: string;
|
|
@@ -14,7 +14,7 @@ import { Context } from 'hono';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function GET(c: Context): Promise<(Response & import("hono").TypedResponse<{
|
|
16
16
|
offset: number;
|
|
17
|
-
data:
|
|
17
|
+
data: import("hono/utils/types").JSONValue[];
|
|
18
18
|
limit: number;
|
|
19
19
|
totalCount: number;
|
|
20
20
|
count: number;
|
|
@@ -16,6 +16,11 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
16
16
|
const __dirname = path.dirname(__filename);
|
|
17
17
|
// Load environment variables from .env file in project root
|
|
18
18
|
dotenvConfig({ path: path.resolve(__dirname, '../../../.env') });
|
|
19
|
+
const verbose = process.env.COCONUT_VERBOSE === '1' || process.env.COCONUT_VERBOSE === 'true';
|
|
20
|
+
function vlog(...args) {
|
|
21
|
+
if (verbose)
|
|
22
|
+
console.log(...args);
|
|
23
|
+
}
|
|
19
24
|
// Helper: Find .nut directory by traversing up from cwd
|
|
20
25
|
// Only returns a .nut directory if it contains config.json
|
|
21
26
|
function findNutDirectorySync() {
|
|
@@ -33,7 +38,7 @@ function findNutDirectorySync() {
|
|
|
33
38
|
}
|
|
34
39
|
// Initialize logger with config from .nut/config.json or use OS app data directory
|
|
35
40
|
// This must happen BEFORE importing route handlers (they call getLogger at module level)
|
|
36
|
-
|
|
41
|
+
vlog('🔍 Initializing activity logging...');
|
|
37
42
|
try {
|
|
38
43
|
const nutDir = findNutDirectorySync();
|
|
39
44
|
let logsDir = getLogsDir(); // Default to OS app data directory
|
|
@@ -43,8 +48,8 @@ try {
|
|
|
43
48
|
if (nutDir) {
|
|
44
49
|
const projectRoot = path.dirname(nutDir);
|
|
45
50
|
const configPath = path.join(nutDir, 'config.json');
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
vlog(' Project root:', projectRoot);
|
|
52
|
+
vlog(' Config path:', configPath);
|
|
48
53
|
const configData = fs.readFileSync(configPath, 'utf-8');
|
|
49
54
|
const config = JSON.parse(configData);
|
|
50
55
|
// Check if logging is explicitly disabled in config
|
|
@@ -68,9 +73,9 @@ try {
|
|
|
68
73
|
logsDir,
|
|
69
74
|
rotateBytes
|
|
70
75
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
vlog('📝 Activity logging ENABLED');
|
|
77
|
+
vlog(' Logs directory:', logsDir);
|
|
78
|
+
vlog(' Coconut ID:', coconutId);
|
|
74
79
|
// Test log immediately
|
|
75
80
|
logger.log({
|
|
76
81
|
kind: 'system.startup',
|
|
@@ -79,10 +84,10 @@ try {
|
|
|
79
84
|
tags: ['system', 'startup'],
|
|
80
85
|
payload: { message: 'Server starting with logging enabled' }
|
|
81
86
|
});
|
|
82
|
-
|
|
87
|
+
vlog(' ✓ Test event logged');
|
|
83
88
|
}
|
|
84
89
|
else {
|
|
85
|
-
|
|
90
|
+
vlog('📝 Activity logging disabled in config');
|
|
86
91
|
}
|
|
87
92
|
}
|
|
88
93
|
catch (error) {
|
|
@@ -100,13 +105,14 @@ app.use('/api/*', trimTrailingSlash());
|
|
|
100
105
|
// Import and apply authentication middleware
|
|
101
106
|
import { authMiddleware } from './middleware/auth.js';
|
|
102
107
|
app.use('/api/*', authMiddleware);
|
|
108
|
+
app.use('/ws/*', authMiddleware);
|
|
103
109
|
// Create WebSocket support
|
|
104
110
|
const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({ app });
|
|
105
111
|
// WebSocket route for terminal sessions
|
|
106
112
|
app.get('/ws/terminal/:sessionId', upgradeWebSocket((c) => ({
|
|
107
113
|
onOpen: (_evt, ws) => {
|
|
108
114
|
const sessionId = c.req.param('sessionId');
|
|
109
|
-
|
|
115
|
+
vlog(`WebSocket connected for terminal session: ${sessionId}`);
|
|
110
116
|
const terminalManager = getGlobalTerminalManager();
|
|
111
117
|
// Extract the raw WebSocket from the WSContext
|
|
112
118
|
const rawWs = ws.raw;
|
|
@@ -125,7 +131,7 @@ app.get('/ws/terminal/:sessionId', upgradeWebSocket((c) => ({
|
|
|
125
131
|
// Message handling is done in the terminal manager
|
|
126
132
|
},
|
|
127
133
|
onClose: (_evt, _ws) => {
|
|
128
|
-
|
|
134
|
+
vlog('WebSocket connection closed');
|
|
129
135
|
},
|
|
130
136
|
onError: (evt, _ws) => {
|
|
131
137
|
console.error('WebSocket error:', evt);
|
|
@@ -185,7 +191,7 @@ import version from './routes/api/v1/version/index.js';
|
|
|
185
191
|
import { slackRoutes } from './routes/api/v1/slack/index.js';
|
|
186
192
|
import { mailRoutes } from './routes/api/v1/mail/index.js';
|
|
187
193
|
// Register API routes FIRST
|
|
188
|
-
|
|
194
|
+
vlog('🔗 Registering API routes...');
|
|
189
195
|
app.route('/api/v1/auth', auth);
|
|
190
196
|
app.route('/api/v1/auth-settings', authSettings);
|
|
191
197
|
app.route('/api/v1/api-keys', apiKeys);
|
|
@@ -216,7 +222,7 @@ app.route('/api/v1/events', events);
|
|
|
216
222
|
app.route('/api/v1/version', version);
|
|
217
223
|
app.route('/api/v1/slack', slackRoutes);
|
|
218
224
|
app.route('/api/v1/mail', mailRoutes);
|
|
219
|
-
|
|
225
|
+
vlog('✅ API routes registered');
|
|
220
226
|
app.get(PUBLIC_AGENT_CARD_PATH, authMiddleware, async (c) => {
|
|
221
227
|
try {
|
|
222
228
|
const document = await readAgentCard();
|
|
@@ -259,7 +265,7 @@ for (const possiblePath of possibleStaticPaths) {
|
|
|
259
265
|
try {
|
|
260
266
|
if (fs.existsSync(possiblePath)) {
|
|
261
267
|
staticPath = possiblePath;
|
|
262
|
-
|
|
268
|
+
vlog(`📁 Serving static files from: ${staticPath}`);
|
|
263
269
|
break;
|
|
264
270
|
}
|
|
265
271
|
}
|
|
@@ -304,7 +310,7 @@ else {
|
|
|
304
310
|
export async function startServer(options = {}) {
|
|
305
311
|
const port = options.port || (process.env.PORT ? parseInt(process.env.PORT) : 3000);
|
|
306
312
|
const host = options.host || '0.0.0.0';
|
|
307
|
-
|
|
313
|
+
vlog(`Starting server on ${host}:${port}...`);
|
|
308
314
|
const server = serve({
|
|
309
315
|
fetch: app.fetch,
|
|
310
316
|
port,
|
|
@@ -319,10 +325,10 @@ export async function startServer(options = {}) {
|
|
|
319
325
|
httpServer.requestTimeout = 330_000;
|
|
320
326
|
// Inject WebSocket support
|
|
321
327
|
injectWebSocket(server);
|
|
322
|
-
|
|
323
|
-
|
|
328
|
+
vlog(`🚀 Server running at http://${host === '0.0.0.0' ? 'localhost' : host}:${port}`);
|
|
329
|
+
vlog(`🔌 WebSocket available at ws://${host === '0.0.0.0' ? 'localhost' : host}:${port}/ws/terminal/:sessionId`);
|
|
324
330
|
if (staticPath) {
|
|
325
|
-
|
|
331
|
+
vlog(`🌐 Frontend available at http://${host === '0.0.0.0' ? 'localhost' : host}:${port}`);
|
|
326
332
|
}
|
|
327
333
|
return server;
|
|
328
334
|
}
|
package/dist/server.js
CHANGED
|
@@ -99,6 +99,7 @@ app.use('/api/*', trimTrailingSlash());
|
|
|
99
99
|
// Import and apply authentication middleware
|
|
100
100
|
import { authMiddleware } from './middleware/auth.js';
|
|
101
101
|
app.use('/api/*', authMiddleware);
|
|
102
|
+
app.use('/ws/*', authMiddleware);
|
|
102
103
|
// Create WebSocket support
|
|
103
104
|
const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({ app });
|
|
104
105
|
// WebSocket route for terminal sessions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovelybunch/api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.77-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/server-with-static.js",
|
|
6
6
|
"exports": {
|
|
@@ -11,18 +11,6 @@
|
|
|
11
11
|
"dist/**/*",
|
|
12
12
|
"static/**/*"
|
|
13
13
|
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"dev": "NODE_ENV=development GAIT_DEV_ROOT=../../.nut tsx watch src/server.ts",
|
|
16
|
-
"build": "tsc",
|
|
17
|
-
"build:bundle": "tsc && node scripts/bundle-frontend.js",
|
|
18
|
-
"start": "node dist/server-with-static.js",
|
|
19
|
-
"start:dev": "node dist/server.js",
|
|
20
|
-
"clean": "rm -rf dist static tsconfig.tsbuildinfo coverage",
|
|
21
|
-
"test": "vitest run",
|
|
22
|
-
"test:coverage": "vitest run --coverage",
|
|
23
|
-
"test:watch": "vitest watch",
|
|
24
|
-
"test:ui": "vitest --ui"
|
|
25
|
-
},
|
|
26
14
|
"keywords": [
|
|
27
15
|
"api",
|
|
28
16
|
"server",
|
|
@@ -35,11 +23,8 @@
|
|
|
35
23
|
"description": "Coconut API server",
|
|
36
24
|
"dependencies": {
|
|
37
25
|
"@ai-sdk/anthropic": "^3.0.41",
|
|
38
|
-
"@hono/node-server": "^1.
|
|
39
|
-
"@hono/node-ws": "^1.0
|
|
40
|
-
"@lovelybunch/core": "^1.0.76",
|
|
41
|
-
"@lovelybunch/mcp": "^1.0.76",
|
|
42
|
-
"@lovelybunch/types": "^1.0.76",
|
|
26
|
+
"@hono/node-server": "^1.19.11",
|
|
27
|
+
"@hono/node-ws": "^1.3.0",
|
|
43
28
|
"adm-zip": "^0.5.16",
|
|
44
29
|
"ai": "^6.0.79",
|
|
45
30
|
"bcryptjs": "^2.4.3",
|
|
@@ -47,13 +32,16 @@
|
|
|
47
32
|
"dotenv": "^17.2.1",
|
|
48
33
|
"fuse.js": "^7.0.0",
|
|
49
34
|
"gray-matter": "^4.0.3",
|
|
50
|
-
"hono": "^4.9
|
|
35
|
+
"hono": "^4.12.9",
|
|
51
36
|
"jsonwebtoken": "^9.0.2",
|
|
52
37
|
"node-pty": "^1.0.0",
|
|
53
38
|
"replicate": "^0.34.1",
|
|
54
39
|
"sharp": "^0.33.5",
|
|
55
40
|
"ws": "^8.18.0",
|
|
56
|
-
"zod": "^3.23.0"
|
|
41
|
+
"zod": "^3.23.0",
|
|
42
|
+
"@lovelybunch/core": "1.0.77-alpha.0",
|
|
43
|
+
"@lovelybunch/types": "1.0.77-alpha.0",
|
|
44
|
+
"@lovelybunch/mcp": "1.0.77-alpha.0"
|
|
57
45
|
},
|
|
58
46
|
"devDependencies": {
|
|
59
47
|
"@types/adm-zip": "^0.5.7",
|
|
@@ -62,9 +50,22 @@
|
|
|
62
50
|
"@types/jsonwebtoken": "^9.0.5",
|
|
63
51
|
"@types/node": "^22.10.2",
|
|
64
52
|
"@types/ws": "^8.5.13",
|
|
65
|
-
"@vitest/coverage-v8": "
|
|
53
|
+
"@vitest/coverage-v8": "4.1.1",
|
|
54
|
+
"@vitest/ui": "4.1.1",
|
|
66
55
|
"tsx": "^4.19.2",
|
|
67
56
|
"typescript": "^5.7.2",
|
|
68
|
-
"vitest": "
|
|
57
|
+
"vitest": "4.1.1"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"dev": "NODE_ENV=development GAIT_DEV_ROOT=../../.nut tsx watch src/server.ts",
|
|
61
|
+
"build": "tsc -b",
|
|
62
|
+
"build:bundle": "tsc && node scripts/bundle-frontend.js",
|
|
63
|
+
"start": "node dist/server-with-static.js",
|
|
64
|
+
"start:dev": "node dist/server.js",
|
|
65
|
+
"clean": "rm -rf dist static tsconfig.tsbuildinfo coverage",
|
|
66
|
+
"test": "vitest run",
|
|
67
|
+
"test:coverage": "vitest run --coverage",
|
|
68
|
+
"test:watch": "vitest watch",
|
|
69
|
+
"test:ui": "vitest --ui"
|
|
69
70
|
}
|
|
70
|
-
}
|
|
71
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,A as p,j as e,v,bK 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,bK as y,B as N,n as w,C as b}from"./index-ByTA2ZiD.js";import{C as c,a as d,b as k,c as C}from"./card-CL5bB4cs.js";import{B as m}from"./badge-BbfU_aPt.js";import{R as E}from"./refresh-cw-Cj_5MZiJ.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-DU3qIXk9.js → AgentsContextEditPage-CMWD-7mS.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,a1 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,a1 as N}from"./index-ByTA2ZiD.js";import{C as m,a as x,b as C,c as S}from"./card-CL5bB4cs.js";import{M as w}from"./markdown-editor-DUmrf1eN.js";import{A as y}from"./arrow-left-B9NBHEkS.js";import{C as A}from"./circle-check-big-BwQ_q1N7.js";import"./index-CuLP7P_G.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,av as C,B as a,L as d,_ as l,M as w,au as y,aq as E}from"./index-
|
|
1
|
+
import{a as g,r as t,A as N,j as e,v,av as C,B as a,L as d,_ as l,M as w,au as y,aq as E}from"./index-ByTA2ZiD.js";import{C as i,a as c,b}from"./card-CL5bB4cs.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};
|