UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

23 lines • 1.35 kB
/** * Redaction for content that leaves the machine (`/share`, #3524). * * Same two-stage order as the desktop problem-report redactor: identity first * (the real home directory, the account name and the host name, in every * spelling a path takes inside JSON, URLs and Windows text), then generic * shapes (credentials, private keys, emails, addresses). Every replacement is * counted from its own callback, so the preview can say what was removed * without inferring it from placeholder deltas. The rewrite is idempotent: * running it on its own output changes nothing and counts nothing. */ export interface ShareRedactionContext { readonly homeDirectory: string; readonly userName: string; readonly hostName: string; readonly extraLiterals?: readonly string[]; } export type ShareRedactionCategory = "home path" | "user name" | "host name" | "private key" | "credential" | "email" | "ip address" | "image"; export type ShareRedactionTally = Map<ShareRedactionCategory, number>; export declare function currentShareRedactionContext(): ShareRedactionContext; export declare function count(tally: ShareRedactionTally, category: ShareRedactionCategory): void; export declare function redactShareText(text: string, context: ShareRedactionContext, tally: ShareRedactionTally): string; //# sourceMappingURL=share-redaction.d.ts.map