refactor(mcp-server): replace redundant CreatedSession local interface with imported DebugSession in diagnostics-orchestrator
This commit is contained in:
parent
00b0555c97
commit
852cb18a5c
@ -4,18 +4,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { randomUUID } from 'node:crypto';
|
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';
|
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(
|
export async function orchestrate(
|
||||||
decision: DispatchDecision,
|
decision: DispatchDecision,
|
||||||
findings: TelemetryFindings,
|
findings: TelemetryFindings,
|
||||||
@ -43,7 +34,7 @@ export async function orchestrate(
|
|||||||
const collectionLevel = hasFatal ? 'trace' : 'debug';
|
const collectionLevel = hasFatal ? 'trace' : 'debug';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const session = (await diagnosticsCreateSession(
|
const session: DebugSession = await diagnosticsCreateSession(
|
||||||
{
|
{
|
||||||
productId: brief.productId,
|
productId: brief.productId,
|
||||||
targetUserId: brief.userReport.userId,
|
targetUserId: brief.userReport.userId,
|
||||||
@ -54,7 +45,7 @@ export async function orchestrate(
|
|||||||
maxDurationMinutes: 30,
|
maxDurationMinutes: 30,
|
||||||
},
|
},
|
||||||
{ token: opts.token, requestId: findings.runContext.requestId, productId: brief.productId }
|
{ token: opts.token, requestId: findings.runContext.requestId, productId: brief.productId }
|
||||||
)) as CreatedSession;
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
runContext: ctx,
|
runContext: ctx,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user