feat: launch local-first Sudoku workbench

This commit is contained in:
2026-08-30 14:14:11 +02:00
commit 659640b231
97 changed files with 19111 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
import type { PuzzleDefinition } from "../domain";
import type {
ExactSolveOptions,
ExactSolveResult,
GenerateClassicOptions,
KillerCombinationOptions,
KillerCombinationResult,
LogicalSolveOptions,
LogicalSolveResult,
MinimizeOptions,
} from "../solver";
import type { NormalizedPuzzle, ValidationIssue } from "../domain";
export type SolverWorkerOperation =
| {
readonly kind: "solve";
readonly puzzle: PuzzleDefinition;
readonly options?: ExactSolveOptions;
}
| {
readonly kind: "logical";
readonly puzzle: PuzzleDefinition;
readonly options?: LogicalSolveOptions;
}
| { readonly kind: "generate"; readonly options?: GenerateClassicOptions }
| {
readonly kind: "minimize";
readonly puzzle: PuzzleDefinition;
readonly options?: MinimizeOptions;
}
| {
readonly kind: "killer-combinations";
readonly options: KillerCombinationOptions;
};
export interface SolverWorkerRequest {
readonly id: string;
readonly operation: SolverWorkerOperation;
}
export type SolverWorkerValue =
| ExactSolveResult
| LogicalSolveResult
| NormalizedPuzzle
| KillerCombinationResult;
export interface SolverWorkerError {
readonly name: string;
readonly message: string;
readonly issues?: readonly ValidationIssue[];
}
export type SolverWorkerResponse =
| {
readonly id: string;
readonly ok: true;
readonly value: SolverWorkerValue;
}
| {
readonly id: string;
readonly ok: false;
readonly error: SolverWorkerError;
};