@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
56 lines • 2.11 kB
TypeScript
import { type GitHubTransport } from '../core/github/client.ts';
import type { GhConfig } from '../core/github/config.ts';
import type { TreeEntry } from '../core/github/tree_entry.ts';
import { Accessor } from './base.ts';
/**
* One GitHub account: token, API base and the transport its calls ride. A gh
* install's accessor, and the account a github mount holds.
*/
export declare class GitHubAccount extends Accessor {
readonly config: GhConfig;
transport: GitHubTransport;
constructor(config: GhConfig, transport?: GitHubTransport);
/** The REST base its calls go to: github.com's when none is set. */
get apiBase(): string;
/**
* The account behind a peer (a gh install's, or a github mount's) on this
* API base; null for any other.
*/
private peer;
/**
* Ride the transport (and its write limiter) of a peer account, a gh
* install's or a github mount's, on the same token and API base.
*/
join(peers: readonly Accessor[]): void;
/**
* Whether a write through this account may change what `peer` reads: only a
* GitHub account or repository on the same API base, whatever token it reads
* with, since two tokens can reach one repository. Mirrors Python's
* `GitHubAccount.reaches`.
*/
reaches(peer: Accessor): boolean;
}
/** A github mount's repository, reached through the account it holds. */
export declare class GitHubAccessor extends Accessor {
readonly account: GitHubAccount;
readonly owner: string;
readonly repo: string;
readonly ref: string;
readonly defaultBranch: string;
truncated: boolean;
tree: Record<string, TreeEntry>;
generation: number;
constructor(opts: {
account: GitHubAccount;
owner: string;
repo: string;
ref: string;
defaultBranch: string;
truncated?: boolean;
tree?: Record<string, TreeEntry>;
});
get isDefaultBranch(): boolean;
/** Drop the tree with the mount's caches, so the next listing fetches it again. */
forget(): void;
}
//# sourceMappingURL=github.d.ts.map