clawport-ui 0.4.2 → 0.4.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/app/api/crons/route.ts +3 -1
- package/app/api/memory/route.ts +5 -2
- package/app/crons/page.tsx +12 -3
- package/app/memory/page.tsx +1433 -321
- package/components/crons/PipelineGraph.tsx +126 -39
- package/components/docs/AgentsSection.tsx +49 -16
- package/components/docs/GettingStartedSection.tsx +8 -2
- package/components/docs/TroubleshootingSection.tsx +22 -1
- package/components/kanban/TicketDetailPanel.tsx +1 -1
- package/lib/cron-pipelines.test.ts +73 -41
- package/lib/cron-pipelines.ts +24 -29
- package/lib/memory.test.ts +407 -0
- package/lib/memory.ts +263 -31
- package/lib/types.ts +66 -0
- package/package.json +1 -1
package/app/api/crons/route.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { getCrons } from '@/lib/crons'
|
|
2
|
+
import { loadPipelines } from '@/lib/cron-pipelines'
|
|
2
3
|
import { apiErrorResponse } from '@/lib/api-error'
|
|
3
4
|
import { NextResponse } from 'next/server'
|
|
4
5
|
|
|
5
6
|
export async function GET() {
|
|
6
7
|
try {
|
|
7
8
|
const crons = await getCrons()
|
|
8
|
-
|
|
9
|
+
const pipelines = loadPipelines()
|
|
10
|
+
return NextResponse.json({ crons, pipelines })
|
|
9
11
|
} catch (err) {
|
|
10
12
|
return apiErrorResponse(err, 'Failed to load cron jobs')
|
|
11
13
|
}
|
package/app/api/memory/route.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { getMemoryFiles } from '@/lib/memory'
|
|
1
|
+
import { getMemoryFiles, getMemoryConfig, getMemoryStatus, computeMemoryStats } from '@/lib/memory'
|
|
2
2
|
import { apiErrorResponse } from '@/lib/api-error'
|
|
3
3
|
import { NextResponse } from 'next/server'
|
|
4
4
|
|
|
5
5
|
export async function GET() {
|
|
6
6
|
try {
|
|
7
7
|
const files = await getMemoryFiles()
|
|
8
|
-
|
|
8
|
+
const config = getMemoryConfig()
|
|
9
|
+
const status = getMemoryStatus()
|
|
10
|
+
const stats = computeMemoryStats(files)
|
|
11
|
+
return NextResponse.json({ files, config, status, stats })
|
|
9
12
|
} catch (err) {
|
|
10
13
|
return apiErrorResponse(err, 'Failed to load memory files')
|
|
11
14
|
}
|
package/app/crons/page.tsx
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import Link from "next/link";
|
|
5
5
|
import type { Agent, CronJob, CronRun } from "@/lib/types";
|
|
6
|
+
import type { Pipeline } from "@/lib/cron-pipelines";
|
|
6
7
|
import { formatDuration } from "@/lib/cron-utils";
|
|
7
8
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
8
9
|
import { RefreshCw, BarChart3, Calendar, GitBranch, Copy, Check } from "lucide-react";
|
|
@@ -428,6 +429,7 @@ function RecentRuns({ jobId }: { jobId: string }) {
|
|
|
428
429
|
export default function CronsPage() {
|
|
429
430
|
const [crons, setCrons] = useState<CronJob[]>([]);
|
|
430
431
|
const [agents, setAgents] = useState<Agent[]>([]);
|
|
432
|
+
const [pipelines, setPipelines] = useState<Pipeline[]>([]);
|
|
431
433
|
const [filter, setFilter] = useState<Filter>("all");
|
|
432
434
|
const [tab, setTab] = useState<Tab>("overview");
|
|
433
435
|
const [expanded, setExpanded] = useState<string | null>(null);
|
|
@@ -453,8 +455,15 @@ export default function CronsPage() {
|
|
|
453
455
|
return r.json();
|
|
454
456
|
}),
|
|
455
457
|
])
|
|
456
|
-
.then(([
|
|
457
|
-
|
|
458
|
+
.then(([cronData, a]) => {
|
|
459
|
+
// Backward compat: if response is a plain array, treat as crons-only
|
|
460
|
+
if (Array.isArray(cronData)) {
|
|
461
|
+
setCrons(cronData);
|
|
462
|
+
setPipelines([]);
|
|
463
|
+
} else {
|
|
464
|
+
setCrons(cronData.crons);
|
|
465
|
+
setPipelines(cronData.pipelines || []);
|
|
466
|
+
}
|
|
458
467
|
setAgents(a);
|
|
459
468
|
setLastRefresh(new Date());
|
|
460
469
|
setLoading(false);
|
|
@@ -853,7 +862,7 @@ export default function CronsPage() {
|
|
|
853
862
|
{tab === "schedule" && <WeeklySchedule crons={crons} />}
|
|
854
863
|
|
|
855
864
|
{/* ─── PIPELINES TAB ─────────────────────────────── */}
|
|
856
|
-
{tab === "pipelines" && <PipelineGraph crons={crons} />}
|
|
865
|
+
{tab === "pipelines" && <PipelineGraph crons={crons} agents={agents} pipelines={pipelines} />}
|
|
857
866
|
</>
|
|
858
867
|
)}
|
|
859
868
|
</div>
|