feat(scanner): validate elevated live automation

This commit is contained in:
AzuTear
2026-07-07 07:49:22 +02:00
parent 7930e369a7
commit ef65c3e6a0
37 changed files with 826 additions and 217 deletions
+5 -1
View File
@@ -15,6 +15,8 @@ import type {
SaveScannerLearningRulesResult,
SaveSnapshotResult,
GoodDatabase,
GoodImportFileResult,
ScannerCommand,
ScannerStatusPayload,
ScannerLearningRulePayload,
} from "../types/global";
@@ -39,6 +41,7 @@ export interface AssistantBridge {
options?: CaptureOptions,
) => Promise<CaptureResult>;
exportGood: (payload: GoodDatabase) => Promise<SaveResultWithPath>;
importGoodFile: () => Promise<GoodImportFileResult>;
showOverlay: () => Promise<BooleanResult>;
loadArtifacts: () => Promise<ArtifactStoreLoadResult>;
saveArtifacts: (records: StoredArtifactRecord[]) => Promise<ArtifactStoreSaveResult>;
@@ -54,7 +57,7 @@ export interface AssistantBridge {
focusGenshinForScanStart: () => Promise<FocusGenshinResult>;
clickScreen: (x: number, y: number) => Promise<ClickResult>;
scrollScreen: (notches: number, anchorX?: number, anchorY?: number) => Promise<ScrollResult>;
onScannerCommand: (callback: (command: "start-auto" | "stop") => void) => () => void;
onScannerCommand: (callback: (command: ScannerCommand) => void) => () => void;
}
function hasFunction(api: Record<string, unknown>, key: string): boolean {
@@ -81,6 +84,7 @@ export function getAssistantBridge(): AssistantBridge | null {
listCaptureSources: () => api.listCaptureSources(),
captureSource: (sourceId, delayMs, focusGenshin, options) => api.captureSource(sourceId, delayMs, focusGenshin, options),
exportGood: (payload) => api.exportGood(payload),
importGoodFile: () => api.importGoodFile(),
loadArtifacts: () => api.loadArtifacts(),
saveArtifacts: (records) => api.saveArtifacts(records),
loadReviewSamples: (limit = 50) => api.loadReviewSamples(limit),