Add network diagnostic tool for domain connectivity troubleshooting
DNS lookup (DoH via Cloudflare/Google), Korean ISP block detection (KT/LG/SK via TCP DNS), HTTP/HTTPS check, and TCP port test — all run in parallel with per-check timeouts. Integrated as diagnose_domain tool in troubleshoot-agent with updated patterns for network keywords. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
78
src/types.ts
78
src/types.ts
@@ -16,11 +16,14 @@ export interface Env {
|
||||
DEPOSIT_BANK_HOLDER?: string;
|
||||
// API URLs
|
||||
OPENAI_API_BASE?: string;
|
||||
D2_RENDER_URL?: string;
|
||||
NAMECHEAP_API_URL?: string;
|
||||
WHOIS_API_URL?: string;
|
||||
CLOUD_ORCHESTRATOR_URL?: string;
|
||||
CLOUD_ORCHESTRATOR?: Fetcher;
|
||||
// Kroki
|
||||
KROKI_URL?: string;
|
||||
// Queues
|
||||
WORK_QUEUE?: Queue;
|
||||
// KV Namespaces
|
||||
RATE_LIMIT_KV: KVNamespace;
|
||||
SESSION_KV: KVNamespace;
|
||||
@@ -401,10 +404,6 @@ export interface CheckServiceArgs {
|
||||
service_id?: number;
|
||||
}
|
||||
|
||||
export interface RenderD2Args {
|
||||
source: string;
|
||||
format?: 'svg' | 'png';
|
||||
}
|
||||
|
||||
export interface AdminArgs {
|
||||
action: 'block_user' | 'unblock_user' | 'set_role' | 'broadcast' | 'confirm_deposit' | 'reject_deposit' | 'list_pending';
|
||||
@@ -421,6 +420,60 @@ export interface ApproveActionArgs {
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Network Diagnostic Types
|
||||
// ============================================
|
||||
|
||||
export interface DnsRecord {
|
||||
type: string;
|
||||
value: string;
|
||||
ttl?: number;
|
||||
}
|
||||
|
||||
export interface DnsResolverResult {
|
||||
resolver: string;
|
||||
ip: string;
|
||||
records: DnsRecord[];
|
||||
responseTimeMs: number;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface IspDnsBlockResult {
|
||||
isp: string;
|
||||
serverIp: string;
|
||||
resolvedIps: string[];
|
||||
blocked: boolean;
|
||||
blockReason?: string;
|
||||
responseTimeMs: number;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface HttpCheckResult {
|
||||
url: string;
|
||||
statusCode?: number;
|
||||
responseTimeMs: number;
|
||||
redirectUrl?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface TcpCheckResult {
|
||||
host: string;
|
||||
port: number;
|
||||
connected: boolean;
|
||||
responseTimeMs: number;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface NetworkDiagnosticReport {
|
||||
domain: string;
|
||||
timestamp: string;
|
||||
dns: DnsResolverResult[];
|
||||
ispBlocking: IspDnsBlockResult[];
|
||||
http: HttpCheckResult[];
|
||||
tcp: TcpCheckResult[];
|
||||
summary: string[];
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Inline Keyboard Data
|
||||
// ============================================
|
||||
@@ -448,21 +501,6 @@ export type KeyboardCallbackData =
|
||||
| ActionApprovalKeyboardData
|
||||
| EscalationKeyboardData;
|
||||
|
||||
// ============================================
|
||||
// D2 Rendering
|
||||
// ============================================
|
||||
|
||||
export interface D2RenderRequest {
|
||||
source: string;
|
||||
format: 'svg' | 'png';
|
||||
}
|
||||
|
||||
export interface D2RenderResponse {
|
||||
success: boolean;
|
||||
image?: ArrayBuffer;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Request Context
|
||||
// ============================================
|
||||
|
||||
Reference in New Issue
Block a user