refactor(mcp-server): replace redundant CreatedSession local interface with imported DebugSession in diagnostics-orchestrator

This commit is contained in:
saravanakumardb1 2026-03-05 12:40:06 -08:00
parent 00b0555c97
commit 852cb18a5c

View File

@ -4,18 +4,9 @@
*/
import { randomUUID } from 'node:crypto';
import { diagnosticsCreateSession } from '../../../lib/platform-client.js';
import { diagnosticsCreateSession, type DebugSession } from '../../../lib/platform-client.js';
import type { DispatchDecision, TelemetryFindings, DiagnosticsSessionResult } from '../types.js';
interface CreatedSession {
id: string;
status: string;
expiresAt: string;
collectionLevel?: string;
targetUserId?: string;
targetAnonymousId?: string;
}
export async function orchestrate(
decision: DispatchDecision,
findings: TelemetryFindings,
@ -43,7 +34,7 @@ export async function orchestrate(
const collectionLevel = hasFatal ? 'trace' : 'debug';
try {
const session = (await diagnosticsCreateSession(
const session: DebugSession = await diagnosticsCreateSession(
{
productId: brief.productId,
targetUserId: brief.userReport.userId,
@ -54,7 +45,7 @@ export async function orchestrate(
maxDurationMinutes: 30,
},
{ token: opts.token, requestId: findings.runContext.requestId, productId: brief.productId }
)) as CreatedSession;
);
return {
runContext: ctx,