e76d88e0c7
Import the existing Electron + React + TypeScript app as the version-control baseline before the scanner rework (C# input/capture sidecar, resolution-anchored layout profiles, OCR preprocessing, eval harness, rescan-merge, GOOD interop). Housekeeping in this commit: - Remove orphaned temp_inputhelper_block.ts (duplicate of the input-helper script). - Ignore .claude/scheduled_tasks.lock local session state. - Add .gitattributes to normalize line endings (LF in repo). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import {
|
|
JsonArtifactStoreRepository,
|
|
JsonSnapshotRepository,
|
|
ReviewSamplesRepository,
|
|
ScannerLearningRepository,
|
|
type ArtifactStoreRepositoryPort,
|
|
type ReviewSamplesRepositoryPort,
|
|
type ScannerLearningRepositoryPort,
|
|
type SnapshotRepositoryPort,
|
|
} from "../repositories/index.js";
|
|
|
|
import path from "node:path";
|
|
export interface RepositoryContext {
|
|
artifactStorePath: string;
|
|
reviewSamplesPath: string;
|
|
scannerLearningPath: string;
|
|
snapshotPath: string;
|
|
artifactStoreRepository: ArtifactStoreRepositoryPort;
|
|
reviewSamplesRepository: ReviewSamplesRepositoryPort;
|
|
scannerLearningRepository: ScannerLearningRepositoryPort;
|
|
snapshotRepository: SnapshotRepositoryPort;
|
|
}
|
|
|
|
export function createRepositoryContext(userDataPath: string): RepositoryContext {
|
|
const artifactStorePath = path.join(userDataPath, "artifact-store.json");
|
|
const reviewSamplesPath = path.join(userDataPath, "review-samples.jsonl");
|
|
const scannerLearningPath = path.join(userDataPath, "scanner-learning.json");
|
|
const snapshotPath = path.join(userDataPath, "snapshot.json");
|
|
|
|
return {
|
|
artifactStorePath,
|
|
reviewSamplesPath,
|
|
scannerLearningPath,
|
|
snapshotPath,
|
|
artifactStoreRepository: new JsonArtifactStoreRepository(userDataPath),
|
|
reviewSamplesRepository: new ReviewSamplesRepository(userDataPath),
|
|
scannerLearningRepository: new ScannerLearningRepository(userDataPath),
|
|
snapshotRepository: new JsonSnapshotRepository(userDataPath),
|
|
};
|
|
}
|