Freshness diagnostics API, UI trust notes, mission control/stats updates, and deploy scripts.
Made-with: Cursor
This commit is contained in:
@@ -16,6 +16,10 @@ export interface MissionControlRelayItemSummary {
|
||||
|
||||
export interface MissionControlRelaySnapshot {
|
||||
status?: string
|
||||
monitoring?: {
|
||||
delivery_enabled?: boolean
|
||||
shedding?: boolean
|
||||
}
|
||||
service?: {
|
||||
profile?: string
|
||||
}
|
||||
@@ -59,10 +63,40 @@ export interface MissionControlChainStatus {
|
||||
block_number?: string
|
||||
}
|
||||
|
||||
export interface MissionControlMode {
|
||||
kind?: string | null
|
||||
updated_at?: string | null
|
||||
age_seconds?: number | null
|
||||
reason?: string | null
|
||||
scope?: string | null
|
||||
source?: string | null
|
||||
confidence?: string | null
|
||||
provenance?: string | null
|
||||
}
|
||||
|
||||
export interface MissionControlSubsystemStatus {
|
||||
status?: string | null
|
||||
updated_at?: string | null
|
||||
age_seconds?: number | null
|
||||
source?: string | null
|
||||
confidence?: string | null
|
||||
provenance?: string | null
|
||||
completeness?: string | null
|
||||
}
|
||||
|
||||
export interface MissionControlBridgeStatusResponse {
|
||||
data?: {
|
||||
status?: string
|
||||
checked_at?: string
|
||||
freshness?: unknown
|
||||
sampling?: {
|
||||
stats_generated_at?: string | null
|
||||
rpc_probe_at?: string | null
|
||||
stats_window_seconds?: number | null
|
||||
issues?: Record<string, string> | null
|
||||
}
|
||||
mode?: MissionControlMode
|
||||
subsystems?: Record<string, MissionControlSubsystemStatus>
|
||||
chains?: Record<string, MissionControlChainStatus>
|
||||
ccip_relay?: MissionControlRelayPayload
|
||||
ccip_relays?: Record<string, MissionControlRelayPayload>
|
||||
@@ -100,6 +134,16 @@ function relativeAge(isoString?: string): string {
|
||||
return `${hours}h ago`
|
||||
}
|
||||
|
||||
function describeRelayStatus(snapshot: MissionControlRelaySnapshot, status: string): string {
|
||||
if (status === 'paused' && snapshot.monitoring?.delivery_enabled === false) {
|
||||
return snapshot.queue?.size && snapshot.queue.size > 0 ? 'delivery paused (queueing)' : 'delivery paused'
|
||||
}
|
||||
if (status === 'paused' && snapshot.monitoring?.shedding) {
|
||||
return 'paused (shedding)'
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
export function summarizeMissionControlRelay(
|
||||
response: MissionControlBridgeStatusResponse | null | undefined
|
||||
): MissionControlRelaySummary | null {
|
||||
@@ -142,11 +186,12 @@ export function summarizeMissionControlRelay(
|
||||
}
|
||||
|
||||
const status = String(snapshot.status || 'unknown').toLowerCase()
|
||||
const statusLabel = describeRelayStatus(snapshot, status)
|
||||
const destination = snapshot.destination?.chain_name
|
||||
const queueSize = snapshot.queue?.size
|
||||
const pollAge = relativeAge(snapshot.last_source_poll?.at)
|
||||
|
||||
let text = `${label}: ${status}`
|
||||
let text = `${label}: ${statusLabel}`
|
||||
if (destination) text += ` -> ${destination}`
|
||||
if (queueSize != null) text += ` · queue ${queueSize}`
|
||||
if (pollAge) text += ` · polled ${pollAge}`
|
||||
@@ -204,11 +249,6 @@ export const missionControlApi = {
|
||||
return (await response.json()) as MissionControlBridgeStatusResponse
|
||||
},
|
||||
|
||||
getRelaySummary: async (): Promise<MissionControlRelaySummary | null> => {
|
||||
const json = await missionControlApi.getBridgeStatus()
|
||||
return summarizeMissionControlRelay(json)
|
||||
},
|
||||
|
||||
subscribeBridgeStatus: (
|
||||
onStatus: (status: MissionControlBridgeStatusResponse) => void,
|
||||
onError?: (error: unknown) => void
|
||||
@@ -241,16 +281,4 @@ export const missionControlApi = {
|
||||
eventSource.close()
|
||||
}
|
||||
},
|
||||
|
||||
subscribeRelaySummary: (
|
||||
onSummary: (summary: MissionControlRelaySummary | null) => void,
|
||||
onError?: (error: unknown) => void
|
||||
): (() => void) => {
|
||||
return missionControlApi.subscribeBridgeStatus(
|
||||
(payload) => {
|
||||
onSummary(summarizeMissionControlRelay(payload))
|
||||
},
|
||||
onError
|
||||
)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user