@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
38 lines • 2.2 kB
TypeScript
import type { JobWidgetAuthorRequest } from "./author-types.ts";
export type JobWidgetRedact = (text: string) => string;
/** A stateful redactor for one stream of text: `push` may hold text back until a later push or `finish`. */
export interface JobWidgetStreamRedactor {
push(text: string): string;
finish(): string;
}
/** The session's secret obfuscation: a fresh stream redactor for each source, fed that source in order. */
export type JobWidgetObfuscator = () => JobWidgetStreamRedactor;
/** A session obfuscator backed by the bash tool's streaming redactor, for sessions that turn it on. */
export declare const secretOutputObfuscator: JobWidgetObfuscator;
/**
* One source's lines, redacted in order: the built-in private-key rule first (it applies even with
* secret handling off), then the session's obfuscator, then `redactSecrets` per line, which runs
* `redactSensitiveOutput` (environment assignments, `Authorization: Bearer`) before the value-based
* credential scan (key prefixes such as `ghp_`/`sk-`/`AKIA`, JWTs, bearer tokens, secret-named values).
* A key block leaves one line, so the lines out are not the lines in.
*/
declare class JobWidgetSourceRedactor {
#private;
constructor(obfuscator?: JobWidgetObfuscator);
push(line: string): string[];
/** The source skipped text here; see {@link PrivateKeyLineFilter.cut}. */
cut(): string[];
/** The source ended: releases held text. The redactor then starts over as for a new source. */
finish(): string[];
}
export interface JobWidgetRedactor {
/** One whole text (a label, a brief field, retry text), redacted as a source of its own. */
readonly text: JobWidgetRedact;
/** A redactor for one source's lines; see {@link JobWidgetSourceRedactor}. */
source(): JobWidgetSourceRedactor;
}
export declare function createWidgetRedactor(obfuscate?: JobWidgetObfuscator): JobWidgetRedactor;
/** Every text field of `request` redacted: brief fields, source labels and lines, and retry text. */
export declare function redactAuthorRequest(request: JobWidgetAuthorRequest, redactor: JobWidgetRedactor): JobWidgetAuthorRequest;
export {};
//# sourceMappingURL=author-redact.d.ts.map