read-copy
Import
Section titled “Import”import * as api from "@fungi.computer/agar/read-copy";Exports
Section titled “Exports”| 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. |
ReadCopyBudgetExceededclass
Section titled “ReadCopyBudgetExceeded”A rebuild stops before dispatching the first call beyond its budget.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ReadCopyBudgetExceeded(): ReadCopyBudgetExceeded;Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor;ReadCopySqltype alias
Section titled “ReadCopySql”type ReadCopySql = object;A facet’s synchronous SQLite port, shared by Workers and local proofs.
Methods
Section titled “Methods”exec()
Section titled “exec()”exec(query, ...bindings): object;Execute immediately, as ctx.storage.sql does.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
query |
string |
…bindings |
(string | number | ArrayBuffer | null)[] |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
toArray() |
() => readonly unknown[] |
Decode the returned SQLite rows at the App boundary. |
ReadCopyLimitstype alias
Section titled “ReadCopyLimits”type ReadCopyLimits = object;App-selected shape and retention bounds; changing version discards old representations.
Properties
Section titled “Properties”version
Section titled “version”version: number;App copy-shape version, changed by a clean representation break.
maxRows
Section titled “maxRows”maxRows: number;Maximum retained document rows across this facet.
maxValueBytes
Section titled “maxValueBytes”maxValueBytes: number;Maximum UTF-8 JSON bytes per row.
maxBlobBytes
Section titled “maxBlobBytes”maxBlobBytes: number;Maximum bytes of one immutable blob.
maxBlobTotalBytes
Section titled “maxBlobTotalBytes”maxBlobTotalBytes: number;Maximum total retained blob bytes, oldest objects evicted first.
ReadCopyResulttype alias
Section titled “ReadCopyResult”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 Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
countingGit()function
Section titled “countingGit()”function countingGit(binding, options): object;Count binding operations, never authority or results. The signal is the caller’s frame lifetime.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
binding |
GitBinding |
options |
{ limit: number; signal: AbortSignal; } |
options.limit |
number |
options.signal |
AbortSignal |
Returns
Section titled “Returns”| 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()”function createReadCopies(sql, limits): object;Own bounded rows and content-addressed bytes in the App facet, not a host/provider cache.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sql |
ReadCopySql |
limits |
ReadCopyLimits |
Returns
Section titled “Returns”| 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. |