class LocalStorageProvider
implements StorageProvider
Since 0.1.0

Local file-system storage provider.

Paths are contained under runtime.fs root — .. escape is prevented by joining through runtime.fs.realPath (when available) or lexical normalization.

getSignedUrl throws with a documented message (conflict C3).

Constructors

LocalStorageProvider(
runtimeFs: IFileSystem | undefined,
options?: { rootDir?: string; },
platform?: () => string
)
Parameters
runtimeFs: IFileSystem | undefined

The optional file-system service from runtime

optional
options: { rootDir?: string; }

Provider options

optional
platform: () => string

Methods

connect(): Promise<void>

Connects, and PROVES the root is writable rather than assuming it.

The probe exists because of X8-9: a scaffolded Deno project's start task requests --allow-net --allow-env --allow-read --allow-sys and no --allow-write, so every upload failed while /health reported up — the M70c liveness probe calls stat, a READ, which the granted --allow-read satisfies. Three defects had to be understood before the one-flag cause was visible. Failing here instead, with the flag named, follows this repo's rule of failing at registration with a name rather than at the first request with a bare error.

A startup probe rather than a per-check write: writability changes almost never, and a write on every health-probe interval is recurring I/O for a fact that does not move.

delete(path: string): Promise<boolean>

Deletes an object from disk.

disconnect(): Promise<void>

Disconnect is a no-op for local storage.

exists(path: string): Promise<boolean>

Reports whether an object exists on disk.

get(path: string): Promise<Uint8Array | null>

Retrieves an object from disk; null when absent.

getSignedUrl(
_path: string,
_options: { expiresIn: number; }
): Promise<string>

Throws — local storage cannot produce signed URLs.

Since 0.1.0
isHealthy(): Promise<boolean>

M70c: runtime.fs.stat(root) succeeds — a disk that vanished or a permission change is a real, common failure.

Also reports false when the root never proved WRITABLE at connect(). A stat-only probe answered up for a root the process could read and not write, which is exactly the state X8-9 found: uploads failing while health said everything was fine.

isReady(): boolean

Reports readiness (true when fs is present and connected).

put(
path: string,
data: Uint8Array,
_options?: PutObjectOptions
): Promise<void>

Stores an object on disk.

Object attributes are ACCEPTED AND NOT PERSISTED: a file system stores bytes and has nowhere to record a content type, and this provider's getSignedUrl throws, so nothing could ever read one back. Documented per provider in the package README rather than silently dropped.

Usage

import { LocalStorageProvider } from "storage-plugin/src/index.ts";