Skip to content
API reference

git-rpc

Import
import * as api from "@fungi.computer/agar/git-rpc";
Kind Export Description
type alias NativeGitOperation Host operation required before a native Git effect.
constant nativeGitCodecs The native tuple and result grammar shared by the handle and frame entrypoint.
constant nativeGitFrameMethods Native Git preserves tuples and binary values through the shared frame factory.
constant nativeGitMethodNameSchema Native method identity is a source-owned refinement, not a transport parser.
function invokeNativeGit() Dispatch owned tuples through the retained native handle without a JSON conversion.

NativeGitOperationtype alias

Section titled “NativeGitOperation”
Signature
type NativeGitOperation = "create" | "fork" | "read" | "write" | "exchange";

Host operation required before a native Git effect.

nativeGitCodecsconstant

Section titled “nativeGitCodecs”
Signature
const nativeGitCodecs: object;

The native tuple and result grammar shared by the handle and frame entrypoint.

Name Type Default value
create object -
create.args ZodTuple<[ZodString, ZodLazy<ZodOptional<ZodObject<{ description: ZodOptional<ZodString>; defaultBranch: ZodOptional<ZodString>; }, $strict>>>], null> -
create.result ZodLazy<ZodObject<{ name: ZodString; defaultBranch: ZodString; lastPushAt: ZodNullable<ZodString>; source: ZodNullable<ZodString>; }, $strict>> info
fork object -
fork.args ZodTuple<[ZodString, ZodString, ZodLazy<ZodOptional<ZodObject<{ description: ZodOptional<ZodString>; }, $strict>>>], null> -
fork.result ZodLazy<ZodObject<{ name: ZodString; defaultBranch: ZodString; lastPushAt: ZodNullable<ZodString>; source: ZodNullable<ZodString>; }, $strict>> info
cloneUrl object -
cloneUrl.args ZodTuple<[ZodString], null> -
cloneUrl.result ZodURL -
info object -
info.args ZodTuple<[ZodString], null> -
info.result ZodNullable<ZodLazy<ZodObject<{ name: ZodString; defaultBranch: ZodString; lastPushAt: ZodNullable<ZodString>; source: ZodNullable<ZodString>; }, $strict>>> -
delete object -
delete.args ZodTuple<[ZodString], null> -
delete.result ZodBoolean -
log object -
log.args ZodTuple<[ZodString, ZodLazy<ZodObject<{ ref: ZodString; limit: ZodOptional<ZodNumber>; offset: ZodOptional<ZodNumber>; }, $strict>>], null> -
log.result ZodArray<ZodLazy<ZodObject<{ hash: ZodString; treeHash: ZodString; message: ZodString; author: ZodObject<{ name: ZodString; email: ZodString; }, $strict>; committer: ZodObject<{ name: ZodString; email: ZodString; }, $strict>; parents: ZodArray<ZodString>; authoredAt: ZodNumber; committedAt: ZodNumber; }, $strict>>> -
readCommit object -
readCommit.args ZodTuple<[ZodString, ZodString], null> -
readCommit.result ZodNullable<ZodLazy<ZodObject<{ hash: ZodString; treeHash: ZodString; message: ZodString; author: ZodObject<{ name: ZodString; email: ZodString; }, $strict>; committer: ZodObject<{ name: ZodString; email: ZodString; }, $strict>; parents: ZodArray<ZodString>; authoredAt: ZodNumber; committedAt: ZodNumber; }, $strict>>> -
readTree object -
readTree.args ZodTuple<[ZodString, ZodString], null> -
readTree.result ZodNullable<ZodArray<ZodLazy<ZodObject<{ name: ZodString; mode: ZodString; hash: ZodString; type: ZodEnum<{ blob: "blob"; tree: "tree"; commit: "commit"; }>; }, $strict>>>> -
readBlob object -
readBlob.args ZodTuple<[ZodString, ZodString], null> -
readBlob.result ZodNullable<ZodLazy<ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>> -
refs object -
refs.args ZodTuple<[ZodString], null> -
refs.result ZodArray<ZodObject<{ name: ZodString; hash: ZodString; }, $strict>> -
exchange object -
exchange.args ZodTuple<[ZodString, ZodObject<{ service: ZodEnum<{ upload-pack: "upload-pack"; receive-pack: "receive-pack"; }>; phase: ZodEnum<{ advertise: "advertise"; exchange: "exchange"; }>; body: ZodNullable<ZodLazy<ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>; headers: ZodLazy<ZodRecord<ZodString, ZodString>>; }, $strict>], null> -
exchange.result ZodObject<{ status: ZodNumber; headers: ZodLazy<ZodRecord<ZodString, ZodString>>; body: ZodLazy<ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>; }, $strict> response

nativeGitFrameMethodsconstant

Section titled “nativeGitFrameMethods”
Signature
const nativeGitFrameMethods: object;

Native Git preserves tuples and binary values through the shared frame factory.

Name Type Description
create object -
create.decodeArgs() (raw) => [string, { description?: string; defaultBranch?: string; }?] Decode the native positional arguments with the method’s tuple codec.
create.decodeResult() (raw) => object Validate the native result, preserving binary values.
create.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
fork object -
fork.decodeArgs() (raw) => [string, string, { description?: string; }?] Decode the native positional arguments with the method’s tuple codec.
fork.decodeResult() (raw) => object Validate the native result, preserving binary values.
fork.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
cloneUrl object -
cloneUrl.decodeArgs() (raw) => [string] Decode the native positional arguments with the method’s tuple codec.
cloneUrl.decodeResult() (raw) => string Validate the native result, preserving binary values.
cloneUrl.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
info object -
info.decodeArgs() (raw) => [string] Decode the native positional arguments with the method’s tuple codec.
info.decodeResult() (raw) => | { name: string; defaultBranch: string; lastPushAt: string | null; source: string | null; } | null Validate the native result, preserving binary values.
info.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
delete object -
delete.decodeArgs() (raw) => [string] Decode the native positional arguments with the method’s tuple codec.
delete.decodeResult() (raw) => boolean Validate the native result, preserving binary values.
delete.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
log object -
log.decodeArgs() (raw) => [string, { ref: string; limit?: number; offset?: number; }] Decode the native positional arguments with the method’s tuple codec.
log.decodeResult() (raw) => object[] Validate the native result, preserving binary values.
log.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
readCommit object -
readCommit.decodeArgs() (raw) => [string, string] Decode the native positional arguments with the method’s tuple codec.
readCommit.decodeResult() (raw) => | { hash: string; treeHash: string; message: string; author: { name: string; email: string; }; committer: { name: string; email: string; }; parents: string[]; authoredAt: number; committedAt: number; } | null Validate the native result, preserving binary values.
readCommit.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
readTree object -
readTree.decodeArgs() (raw) => [string, string] Decode the native positional arguments with the method’s tuple codec.
readTree.decodeResult() (raw) => object[] | null Validate the native result, preserving binary values.
readTree.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
readBlob object -
readBlob.decodeArgs() (raw) => [string, string] Decode the native positional arguments with the method’s tuple codec.
readBlob.decodeResult() (raw) => Uint8Array<ArrayBuffer> | null Validate the native result, preserving binary values.
readBlob.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
refs object -
refs.decodeArgs() (raw) => [string] Decode the native positional arguments with the method’s tuple codec.
refs.decodeResult() (raw) => object[] Validate the native result, preserving binary values.
refs.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.
exchange object -
exchange.decodeArgs() (raw) => [string, { service: "upload-pack" | "receive-pack"; phase: "advertise" | "exchange"; body: Uint8Array<ArrayBuffer> | null; headers: Record<string, string>; }] Decode the native positional arguments with the method’s tuple codec.
exchange.decodeResult() (raw) => object Validate the native result, preserving binary values.
exchange.requiredOperations() (args) => readonly string[] Operations the host must grant for these decoded arguments.

nativeGitMethodNameSchemaconstant

Section titled “nativeGitMethodNameSchema”
Signature
const nativeGitMethodNameSchema: ZodEnum<{
info: "info";
create: "create";
log: "log";
delete: "delete";
exchange: "exchange";
fork: "fork";
cloneUrl: "cloneUrl";
readCommit: "readCommit";
readTree: "readTree";
readBlob: "readBlob";
refs: "refs";
}>;

Native method identity is a source-owned refinement, not a transport parser.

invokeNativeGit()function

Section titled “invokeNativeGit()”
Signature
function invokeNativeGit(
git,
method,
raw,
): Promise<
| string
| boolean
| Uint8Array<ArrayBufferLike>
| object[]
| Readonly<{
status: number;
headers: Readonly<Record<string, string>>;
body: Uint8Array;
}>
| Readonly<{
name: string;
defaultBranch: string;
lastPushAt: string | null;
source: string | null;
}>
| Readonly<{
hash: string;
treeHash: string;
message: string;
author: {
name: string;
email: string;
};
committer: {
name: string;
email: string;
};
parents: string[];
authoredAt: number;
committedAt: number;
}>
| Readonly<{
hash: string;
treeHash: string;
message: string;
author: {
name: string;
email: string;
};
committer: {
name: string;
email: string;
};
parents: string[];
authoredAt: number;
committedAt: number;
}>[]
| Readonly<{
name: string;
mode: string;
hash: string;
type: "blob" | "tree" | "commit";
}>[]
| null
>;

Dispatch owned tuples through the retained native handle without a JSON conversion.

Parameter Type
git GitBinding
method string
raw readonly unknown[]

Promise< | string | boolean | Uint8Array<ArrayBufferLike> | object[] | Readonly<{ status: number; headers: Readonly<Record<string, string>>; body: Uint8Array; }> | Readonly<{ name: string; defaultBranch: string; lastPushAt: string | null; source: string | null; }> | Readonly<{ hash: string; treeHash: string; message: string; author: { name: string; email: string; }; committer: { name: string; email: string; }; parents: string[]; authoredAt: number; committedAt: number; }> | Readonly<{ hash: string; treeHash: string; message: string; author: { name: string; email: string; }; committer: { name: string; email: string; }; parents: string[]; authoredAt: number; committedAt: number; }>[] | Readonly<{ name: string; mode: string; hash: string; type: "blob" | "tree" | "commit"; }>[] | null>