Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | 1x | // Import types needed locally in this file
import type { AuthConfig, M2MMode } from "./auth/index";
// Re-export types from auth module (formerly shared-auth-config)
export type {
AuthConfig,
AuthResult,
IAuthStrategy,
AuthUserInfo,
IAuthConfigProvider,
IAuthLogger,
OpenUrlHandler,
ConfigProvider,
M2MMode,
} from "./auth/index";
// Re-export enums (includes both type and runtime value)
export { AuthStrategyType, M2MType } from "./auth/index";
export type AddHighlightsHandler = (
highlights: HighlightDTO[],
clearExisting: boolean
) => Promise<void>;
/**
* Function to obfuscate source code for privacy.
* Returns obfuscated code or null if obfuscation is unavailable.
*
* @param code - Raw source code to obfuscate
* @param language - Language hint (e.g., "Python", "Scala")
* @returns Obfuscated code string, or null if obfuscation not available
*/
export type ObfuscateCodeHandler = (
code: string,
language: string
) => Promise<string | null>;
export interface IConfigService {
getServerUrl(): string;
getEnvironment(): string;
getCustomerDomain(): string | null;
getAdminCompanyDomain(): string;
getAuthConfig(): AuthConfig;
/**
* Fetch /copilot/config from the backend and cache the auth result.
* Returns the resolved auth config. Subsequent calls are idempotent —
* skipped when the cached result still matches the current customerDomain
* unless `force: true` is passed.
*/
bootstrapAuth(opts?: { force?: boolean }): Promise<AuthConfig>;
setAuthSecret(value: string): Promise<void>;
getAuthSecret(): Promise<string | undefined>;
deleteAuthSecret(): Promise<void>;
getSendSourceCode(): boolean;
getM2MMode(): M2MMode;
getTenantId(): string | undefined;
}
export interface IMcpLogger {
info(message: string): void;
warn(message: string): void;
error(message: string, error?: any): void;
debug(message: string): void;
}
export interface AlertInfo {
title: string;
icon: string;
sqlId?: number;
nodeIds: number[];
}
export interface ContributionInfo {
sqlId: number;
nodeId: number;
nodeName: string;
durationPct: number;
metricsLine: string;
queryPrefix: string;
}
export interface TooltipHeader {
type: "hotspot" | "failed" | "analysis";
title: string;
reason?: string;
}
export interface TooltipSummary {
operationCount: number;
queryCount: number;
totalDurationPct: number;
}
export interface TooltipFailedQuery {
sqlId: number;
description: string;
}
export interface TooltipAlert {
severity: "critical" | "warning" | "info";
title: string;
message: string;
suggestion?: string;
}
export interface TooltipOperation {
sqlId: number;
queryDescription?: string;
nodeName: string;
durationPct: number;
metricsLine?: string;
isHotspot: boolean;
isFailed: boolean;
}
export interface TooltipFinding {
type: "critical" | "warning" | "hint" | "insight" | "context";
// Aligned with SHS Alert structure
title: string; // Short display title
message?: string; // Detailed explanation
suggestion?: string;
estimatedImpact?: string;
codeSnippet?: string;
fixComplexity?: string; // XS/S/M/L/XL
}
export interface TooltipFooter {
deepLinkUrl?: string;
deepLinkText: string;
}
export interface StructuredTooltip {
header: TooltipHeader;
summary?: TooltipSummary;
failedQueries: TooltipFailedQuery[];
alerts: TooltipAlert[];
operations: TooltipOperation[];
findings: TooltipFinding[];
footer?: TooltipFooter;
}
export interface HighlightDTO {
jobId: number;
filePath: string;
codeLine: number;
mappingHash?: string;
queryPrefix: string;
displayText: string;
shortDisplayText?: string;
tooltip: string;
structuredTooltip?: StructuredTooltip;
deepLinkUrl?: string;
url?: string;
sqlIds: number[];
nodeIds: number[];
severity: string;
isHotspot: boolean;
alertCount: number;
findingCount: number;
topItemDisplay?: string;
hasFix?: boolean;
additionalCount?: number;
contributions?: ContributionInfo[];
// Legacy fields for backward compatibility
name?: string;
summary?: string;
shortSummary?: string;
sqlId?: number;
nodeId?: number;
alerts?: AlertInfo[];
}
|