clawport-ui 0.4.1 → 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.
@@ -129,10 +129,16 @@ export async function POST(
129
129
  Connection: 'keep-alive',
130
130
  },
131
131
  })
132
- } catch (err) {
132
+ } catch (err: unknown) {
133
133
  console.error('Chat API error:', err)
134
+
135
+ let userMessage = 'Chat failed. Make sure OpenClaw gateway is running.'
136
+ if (err instanceof Error && 'status' in err && (err as { status: number }).status === 405) {
137
+ userMessage = 'Gateway returned 405. Enable the HTTP endpoint: set gateway.http.endpoints.chatCompletions.enabled = true in ~/.openclaw/openclaw.json, then restart the gateway.'
138
+ }
139
+
134
140
  return new Response(
135
- JSON.stringify({ error: 'Chat failed. Make sure OpenClaw gateway is running.' }),
141
+ JSON.stringify({ error: userMessage }),
136
142
  { status: 500, headers: { 'Content-Type': 'application/json' } }
137
143
  )
138
144
  }
@@ -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
- return NextResponse.json(crons)
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
  }
@@ -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
- return NextResponse.json(files)
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
  }
@@ -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(([c, a]) => {
457
- setCrons(c);
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>