Add initial CLI support

This commit is contained in:
Andrew Mulbrook 2026-03-21 22:25:32 -05:00
parent e16d67e2f8
commit 22a9c68611
14 changed files with 168 additions and 26 deletions

View file

@ -1,21 +1,25 @@
from typing import Protocol, runtime_checkable, Optional, Dict, List, Self, NamedTuple, Iterable, MappingView
from typing import Protocol, runtime_checkable, Optional, Dict, List, Self, NamedTuple, Iterable, TypedDict
from uuid import UUID
from pathlib import PurePosixPath
type ObjectId = int
type ObjectId = int | str | UUID
NODE_ROOT_ID: ObjectId = 1
class TroveError(Exception):
"""Base class for all Trove errors."""
class BadNoteType(TypeError):
"""Raised when an invalid note type is encountered."""
class TreeExists(TypeError):
class TreeExists(RuntimeError):
"""Raised when a label already exists."""
class NoteNotFound(KeyError):
"""Raised when a note is not found."""
class OpenArguments(TypedDict):
create: bool
@runtime_checkable
class Note(Protocol):
"""
@ -87,7 +91,6 @@ class TreeNote(Note, Tree):
"""Tree Note"""
@runtime_checkable
class Trove(Protocol):
"""