import type { BreakpointActionValue, BreakpointEventValue, BreakpointHit, HaltScopeValue } from '../breakpoints/Types'; import type { ThreadStatus } from '../threads/Types'; export declare const DebugProtocolVersion = 1; export type MatcherKind = 'exact' | 'prefix' | 'regex'; export interface MatcherSpec { kind: MatcherKind; value: string; } export interface WireThreadNode { id: string; taskName: string; status: ThreadStatus; error?: string; children: WireThreadNode[]; } export interface WireThreadRef { id: string; taskName: string; } export interface WireComponentUsage { name: string; threads: WireThreadRef[]; } export interface WireThreadDetails { id: string; taskName: string; status: ThreadStatus; imports: WireComponentUsage[]; exports: WireComponentUsage[]; } export interface WireBreakpointSpec { on: BreakpointEventValue; action?: BreakpointActionValue; scope?: HaltScopeValue; name?: MatcherSpec; message?: MatcherSpec; effect?: MatcherSpec; } export interface WireRegisteredBreakpoint extends WireBreakpointSpec { id: number; enabled: boolean; } export interface WireBreakpointsData { breakpoints: WireRegisteredBreakpoint[]; hits: BreakpointHit[]; paused: boolean; active: boolean; } export interface Unavailable { status: 'unavailable'; } export interface Failure { status: 'error'; message: string; } export type HierarchyResult = { status: 'ok'; roots: WireThreadNode[]; sequence: number; } | Unavailable | Failure; export type DetailsResult = { status: 'ok'; details: WireThreadDetails; } | Unavailable | Failure; export type BreakpointsResult = { status: 'ok'; data: WireBreakpointsData; } | Unavailable | Failure; export type AckResult = { status: 'ok'; } | Unavailable | Failure; export type DebugRequest = { kind: 'hierarchy'; rootId?: string; } | { kind: 'details'; threadId: string; } | { kind: 'breakpoints'; } | { kind: 'addBreakpoint'; spec: WireBreakpointSpec; } | { kind: 'removeBreakpoint'; id: number; } | { kind: 'removeAllBreakpoints'; } | { kind: 'setBreakpointEnabled'; id: number; enabled: boolean; } | { kind: 'setBreakpointsActive'; active: boolean; } | { kind: 'setPaused'; paused: boolean; } | { kind: 'resume'; haltId?: number; }; export type DebugResponse = HierarchyResult | DetailsResult | BreakpointsResult | AckResult;