refactor: opencode

This commit is contained in:
Apunkt 2026-05-12 16:45:15 +02:00
parent 09c5b30f15
commit 91d67b2e12
No known key found for this signature in database
12 changed files with 1843 additions and 77 deletions

View file

@ -61,10 +61,7 @@ from pathlib import Path
from typing import Callable, Optional
from uuid import UUID
import pyarrow as pa
from iai_mcp.crypto import encrypt_field, is_encrypted
from iai_mcp.embed import Embedder
from iai_mcp.events import write_event
from iai_mcp.store import (
EVENTS_TABLE,
@ -123,7 +120,7 @@ def _detect_language(text: str) -> str:
def migrate_v1_to_v2(
store: MemoryStore,
embedder: Optional[Embedder] = None,
embedder: Optional["Embedder"] = None,
dry_run: bool = False,
progress: Optional[Callable[[int, int], None]] = None,
) -> dict:
@ -237,7 +234,7 @@ def migrate_v1_to_v2(
}
def _records_schema_at_dim(dim: int) -> pa.Schema:
def _records_schema_at_dim(dim: int) -> "pa.Schema":
"""Build the records-table Arrow schema at an explicit embedding dim.
Mirrors `MemoryStore._ensure_tables` lines 249-281 byte-for-byte except
@ -247,6 +244,7 @@ def _records_schema_at_dim(dim: int) -> pa.Schema:
is not parameterised on dim. Plan 07.11-03 / file-disjoint
constraint forbids store.py changes; inlining is the conservative path.
"""
import pyarrow as pa
return pa.schema(
[
("id", pa.string()),