@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
30 lines • 1.47 kB
TypeScript
export type PreparedEdge = {
readonly specifier: string;
readonly id: string;
readonly commonJs: boolean;
};
/**
* An extension module's prepared source with its generation left as `token`, so one entry serves
* every importer generation. `edges` and `esmByType` are the filesystem facts the bytes depend on;
* a hit is only trusted after the importer re-checks them.
*/
export type PreparedSource = {
readonly token: string;
readonly contents: string;
readonly commonJs: boolean;
readonly esmByType: boolean;
readonly edges: readonly PreparedEdge[];
};
/**
* Disk cache of the importer's transpile + import-rewrite output, so a fresh host skips that work
* for unchanged sources. `keyParts` is everything outside the source that shapes the output, as the
* importer passes it (release version, Bun version, runtime module path, extension namespace and the source
* of the code that prepares the bytes); `fingerprint` is the source hash.
* A miss, a corrupt entry and an unwritable directory all mean "prepare it again": the cache only
* ever saves time, so its I/O failures never reach the extension load.
*/
export declare function createPreparedSourceCache(directory: string, keyParts: readonly string[]): {
read(filename: string, fingerprint: string): PreparedSource | undefined;
write(filename: string, fingerprint: string, prepared: PreparedSource): void;
};
//# sourceMappingURL=bun-extension-prepared-cache.d.ts.map