Skip to content
API reference

read-copy

Import
import * as api from "@fungi.computer/agar/read-copy";
Kind Export Description
class ReadCopyBudgetExceeded A rebuild stops before dispatching the first call beyond its budget.
type alias ReadCopySql A facet’s synchronous SQLite port, shared by Workers and local proofs.
type alias ReadCopyLimits App-selected shape and retention bounds; changing version discards old representations.
type alias ReadCopyResult A screen reads this projection without asking Git whether it is current.
function countingGit() Count binding operations, never authority or results. The signal is the caller’s frame lifetime.
function createReadCopies() Own bounded rows and content-addressed bytes in the App facet, not a host/provider cache.

A rebuild stops before dispatching the first call beyond its budget.

  • Error
Signature
new ReadCopyBudgetExceeded(): ReadCopyBudgetExceeded;

ReadCopyBudgetExceeded

Signature
Error.constructor;

ReadCopySqltype alias

Section titled “ReadCopySql”
Signature
type ReadCopySql = object;

A facet’s synchronous SQLite port, shared by Workers and local proofs.

Signature
exec(query, ...bindings): object;

Execute immediately, as ctx.storage.sql does.

Parameter Type
query string
…bindings (string | number | ArrayBuffer | null)[]
Name Type Description
toArray() () => readonly unknown[] Decode the returned SQLite rows at the App boundary.

ReadCopyLimitstype alias

Section titled “ReadCopyLimits”
Signature
type ReadCopyLimits = object;

App-selected shape and retention bounds; changing version discards old representations.

Signature
version: number;

App copy-shape version, changed by a clean representation break.

Signature
maxRows: number;

Maximum retained document rows across this facet.

Signature
maxValueBytes: number;

Maximum UTF-8 JSON bytes per row.

Signature
maxBlobBytes: number;

Maximum bytes of one immutable blob.

Signature
maxBlobTotalBytes: number;

Maximum total retained blob bytes, oldest objects evicted first.


ReadCopyResulttype alias

Section titled “ReadCopyResult”
Signature
type ReadCopyResult<T> =
| {
kind: "ready";
head: string | null;
value: T;
}
| {
kind: "missing";
}
| {
kind: "rebuilding";
};

A screen reads this projection without asking Git whether it is current.

Type Parameter
T

countingGit()function

Section titled “countingGit()”
Signature
function countingGit(binding, options): object;

Count binding operations, never authority or results. The signal is the caller’s frame lifetime.

Parameter Type
binding GitBinding
options { limit: number; signal: AbortSignal; }
options.limit number
options.signal AbortSignal
Name Type Description
git Readonly<{ create: Promise<Readonly<{ name: string; defaultBranch: string; lastPushAt: string | null; source: string | null; }>>; fork: Promise<Readonly<{ name: string; defaultBranch: string; lastPushAt: string | null; source: string | null; }>>; cloneUrl: Promise<string>; info: Promise< | Readonly<{ name: string; defaultBranch: string; lastPushAt: string | null; source: string | null; }> | null>; delete: Promise<boolean>; log: Promise<Readonly<{ hash: string; treeHash: string; message: string; author: { name: string; email: string; }; committer: { name: string; email: string; }; parents: string[]; authoredAt: number; committedAt: number; }>[]>; readCommit: Promise< | Readonly<{ hash: string; treeHash: string; message: string; author: { name: string; email: string; }; committer: { name: string; email: string; }; parents: string[]; authoredAt: number; committedAt: number; }> | null>; readTree: Promise< | Readonly<{ name: string; mode: string; hash: string; type: "blob" | "tree" | "commit"; }>[] | null>; readBlob: Promise<Uint8Array<ArrayBufferLike> | null>; refs: Promise<object[]>; exchange: Promise<Readonly<{ status: number; headers: Readonly<Record<string, string>>; body: Uint8Array; }>>; }> -
total() () => number Number of dispatched operations.
counts() () => object Dispatch counts by maintained Git operation.

createReadCopies()function

Section titled “createReadCopies()”
Signature
function createReadCopies(sql, limits): object;

Own bounded rows and content-addressed bytes in the App facet, not a host/provider cache.

Parameter Type
sql ReadCopySql
limits ReadCopyLimits
Name Type Description
open() <T>(copy, schema) => object Bind a namespace to its maintained App decoder. Bind an App-owned schema and copy namespace.
putBlob() (hash, bytes) => void Store immutable provider-identified bytes; enforce per-object and total retention bounds.
readBlob() (hash) => Uint8Array<ArrayBufferLike> | null A blob miss never performs I/O; the App decides which bounded rebuild owns it.