@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
35 lines • 2.14 kB
TypeScript
/**
* The built-in private-key rule, applied whatever the session's secret setting: a key spans lines,
* so it is recognized per source, across that source's lines in order, never one line at a time.
* Everything from a `-----BEGIN … PRIVATE KEY-----` (or `PGP PRIVATE KEY BLOCK`) marker through
* its matching END marker, or through the end of the source when none comes, becomes one
* {@link PRIVATE_KEY_MARKER}. A window can start inside a key (a sample cut, or text the source
* dropped, took the BEGIN line), so a run of base64 body lines followed by an END marker is
* redacted with that marker, and a run still open where the window is cut is redacted too.
*
* Body lines may carry a per-line prefix (`docker logs -t` and `kubectl logs --timestamps` put a
* timestamp before every line, a log multiplexer a `[pod] ` tag). A line is read as a prefix and the
* base64 token ending it; a run holds consecutive lines whose prefixes have the same shape (digit
* runs collapsed, so successive timestamps compare equal). A bare run starts on a token of 16+
* base64 characters with both cases, so hex hashes and plain words never start one; a prefixed run
* needs a full-width body line ({@link PREFIXED_BODY_MIN} characters), so an ordinary line ending in
* a token (`deploy with ghp_…`) is not held back from the view.
*/
export declare const PRIVATE_KEY_MARKER = "[REDACTED private key]";
/**
* One source's private-key filter: fed that source's lines in order, it returns the lines to keep.
* It holds a run of body-shaped lines until the line after the run shows whether an END marker
* closes it.
*/
export declare class PrivateKeyLineFilter {
#private;
push(line: string): string[];
/**
* The source skipped text here (a sample window ends, or the source dropped text unread). A held
* run may have met its END marker in the skipped text, so it is redacted; an open block stays open.
*/
cut(): string[];
/** The source ended: a held run met no END marker, so it is released. The filter starts over. */
finish(): string[];
}
//# sourceMappingURL=key-block-redact.d.ts.map