@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
44 lines (43 loc) • 1.7 kB
TypeScript
export interface GitboyPushUpdate {
ref: string;
old: string;
new: string;
/** Files changed between old and new; null when gitboy could not say (new branch, deletion, tag, over budget). */
changedPaths: string[] | null;
truncated: boolean;
}
export interface GitboyPush {
deliveryId: string;
event: "push";
repository: {
owner: string;
name: string;
} | null;
updates: GitboyPushUpdate[];
}
export interface GitboyStoreRepo {
owner: string;
name: string;
branch: string;
}
/** True when `header` is `sha256=<hex HMAC-SHA256 of rawBody>` under `secret`. */
export declare function verifyGitboySignature(secret: string, rawBody: Buffer, header: string | undefined): boolean;
type Headers = Record<string, string | string[] | undefined>;
/** A gitboy `push` delivery, or null for any other event, a missing delivery id or a malformed body. Never throws. */
export declare function parseGitboyPush(rawBody: Buffer, headers: Headers): GitboyPush | null;
/**
* True when the push is to the store's repository (owner and name compared case-insensitively,
* as gitboy resolves them) and moves `refs/heads/<branch>` exactly.
*/
export declare function storePushMatches(push: GitboyPush, store: GitboyStoreRepo): boolean;
export declare const DEFAULT_DELIVERY_LOG_SIZE = 1000;
/** Recently seen delivery ids, oldest evicted first. gitboy retries keep the delivery id. */
export declare class DeliveryLog {
private readonly capacity;
private readonly ids;
constructor(capacity?: number);
/** Records `id` and reports whether it had already been seen. */
seen(id: string): boolean;
get size(): number;
}
export {};