Skip to content

msflib.drivelink

Public modules of the msflib-drivelink package.

msflib.drivelink.actions

DrivelinkAction(settings: SettingsBase)

Bases: ModelAction[DrivelinkNode, DrivelinkNodeCreate, DrivelinkNodeUpdate]

apply_batch(session: Session, *, account_id: int, ops: list[BatchOp], workspace_id: int | None = None, drivelink_id: int | None = None, commit: bool = True) -> list[tuple[str, str, int | None]]

Returns list of (op_id, status, node_id) per op. All-or-nothing.

msflib.drivelink.config

msflib.drivelink.documents_contract

Integration contract for a future msflib-documents module (RAG, etc.).

Stable identity for ingested files

  • Use (drivelink_id, node_id, version) where node_id is a DrivelinkNode row with kind == file. drivelink_id partitions document identities across logical drivelink roots. Bump version when file bytes are replaced.

Event bus (emitted by ModelAction lifecycle hooks on DrivelinkNode; see msflib.actions.ModelAction):

  • drivelinknode-create-pre-commit
  • drivelinknode-update-pre-commit
  • drivelinknode-delete-pre-commit

Listeners receive (model, {"session": session, ...}) as for other SQLModel entities.

Out of scope here

  • Embeddings, chunking, and retrieval logic live in msflib-documents, not in drivelink.

msflib.drivelink.models

DrivelinkNode

Bases: DrivelinkNodeBase

Host apps should add a partial unique index on (parent_id, name) WHERE deleted_at IS NULL in migrations.

DrivelinkNode

Bases: DrivelinkNodeBase

Host apps should add a partial unique index on (parent_id, name) WHERE deleted_at IS NULL in migrations.

msflib.drivelink.router

msflib.drivelink.services

DrivelinkService(settings: SettingsBase)

create_storage_blob(file: UploadFile, *, account_id: int, node_id: int | None = None) -> tuple[StorageBlob, int]

Build a StorageBlob from an UploadFile and return (blob, file_size).

DrivelinkService(settings: SettingsBase)

create_storage_blob(file: UploadFile, *, account_id: int, node_id: int | None = None) -> tuple[StorageBlob, int]

Build a StorageBlob from an UploadFile and return (blob, file_size).