Files
openclaw/src/proxy-capture/types.ts
Tak Hoffman 958c34e82c feat(qa-lab): Add proxy capture stack and QA Lab inspector (#64895)
* Add proxy capture core and CLI

* Expand transport capture coverage

* Add QA Lab capture backend

* Refine QA Lab capture UI

* Fix proxy capture review feedback

* Fix proxy run cleanup and TTS capture

* Fix proxy capture transport follow-ups

* Fix debug proxy CONNECT target parsing

* Harden QA Lab asset path containment
2026-04-11 12:34:57 -05:00

95 lines
1.9 KiB
TypeScript

export type CaptureProtocol = "http" | "https" | "sse" | "ws" | "wss" | "connect";
export type CaptureDirection = "outbound" | "inbound" | "local";
export type CaptureEventKind =
| "connect"
| "tls-handshake"
| "request"
| "response"
| "ws-open"
| "ws-frame"
| "ws-close"
| "error"
| "retry-link";
export type CaptureSessionRecord = {
id: string;
startedAt: number;
endedAt?: number;
mode: string;
sourceScope: "openclaw";
sourceProcess: string;
proxyUrl?: string;
dbPath: string;
blobDir: string;
};
export type CaptureBlobRecord = {
blobId: string;
path: string;
encoding: "gzip";
sizeBytes: number;
sha256: string;
contentType?: string;
};
export type CaptureEventRecord = {
sessionId: string;
ts: number;
sourceScope: "openclaw";
sourceProcess: string;
protocol: CaptureProtocol;
direction: CaptureDirection;
kind: CaptureEventKind;
flowId: string;
method?: string;
host?: string;
path?: string;
status?: number;
closeCode?: number;
contentType?: string;
headersJson?: string;
dataText?: string;
dataBlobId?: string;
dataSha256?: string;
errorText?: string;
metaJson?: string;
};
export type CaptureQueryPreset =
| "double-sends"
| "retry-storms"
| "cache-busting"
| "ws-duplicate-frames"
| "missing-ack"
| "error-bursts";
export type CaptureQueryRow = Record<string, string | number | null>;
export type CaptureSessionSummary = {
id: string;
startedAt: number;
endedAt?: number;
mode: string;
sourceProcess: string;
proxyUrl?: string;
eventCount: number;
};
export type CaptureObservedDimension = {
value: string;
count: number;
};
export type CaptureSessionCoverageSummary = {
sessionId: string;
totalEvents: number;
unlabeledEventCount: number;
providers: CaptureObservedDimension[];
apis: CaptureObservedDimension[];
models: CaptureObservedDimension[];
hosts: CaptureObservedDimension[];
localPeers: CaptureObservedDimension[];
};