/** * Shared projections that map SDAPI response types to JSON-friendly objects * with both server paths and resolved local file paths. Used by both the MCP * debugger tools and the CLI RPC mode. * * @module operations/debug/projections */ import type { SourceMapper } from './source-mapping.js'; import type { SdapiBreakpoint, SdapiObjectMember, SdapiScriptThread, SdapiStackFrame } from './types.js'; /** Default maximum length for variable values before truncation. */ export declare const DEFAULT_MAX_VALUE_LENGTH = 200; /** A mapped source location with both server and local file paths. */ export interface MappedLocation { file: null | string; function_name: string; line: number; script_path: string; } /** A mapped stack frame. */ export interface MappedFrame { file: null | string; function_name: string; index: number; line: number; script_path: string; } /** A mapped variable for inspection. */ export interface MappedVariable { has_children: boolean; name: string; scope?: string; type: string; value: string; } /** A mapped breakpoint. */ export interface MappedBreakpoint { condition?: string; file: null | string; id: number; line: number; script_path: string; } /** True when the SDAPI type name represents a non-expandable primitive value. */ export declare function isPrimitiveType(type: string): boolean; /** * Truncate a string to at most `max` characters, appending `...` if truncated. */ export declare function truncateValue(value: string, max?: number): string; /** * Project an SDAPI stack frame to a structured object with mapped local file path. */ export declare function projectFrame(frame: SdapiStackFrame, mapper: SourceMapper): MappedFrame; /** * Project an SDAPI object member to a structured variable. * * @param member - The SDAPI object member * @param options.includeScope - Whether to include the scope field (defaults to true) * @param options.maxValueLength - Maximum value length before truncation */ export declare function projectVariable(member: SdapiObjectMember, options?: { includeScope?: boolean; maxValueLength?: number; }): MappedVariable; /** * Project an SDAPI breakpoint to a structured object with mapped local file path. */ export declare function projectBreakpoint(bp: SdapiBreakpoint, mapper: SourceMapper): MappedBreakpoint; /** * Project the top-of-stack location for a thread, mapping the script path. * Returns null if the thread has no call stack. */ export declare function projectThreadLocation(thread: SdapiScriptThread, mapper: SourceMapper): MappedLocation | null;