UNPKG

@code-yeongyu/senpi

Version:

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

54 lines • 2.55 kB
import { type SourceLineRedactor } from "./line-reader.ts"; import type { LineMatcher } from "./matcher.ts"; import { type JobWidgetSourceSample } from "./source-stats.ts"; import type { JobTextSource } from "./source-types.ts"; import { type JobWidgetSpec } from "./spec-types.ts"; import type { JobWidgetEntryState, JobWidgetView } from "./view-types.ts"; /** Newest lines per source matched per refresh; older lines of a burst are counted, not matched. */ export declare const MAX_MATCH_LINES = 2000; export interface JobWidgetViewContext { label: string; /** A task's stage in its own words; the stage line unless a spec rule reads one. */ stage?: string; /** Whether the newest output line may stand for the stage (a command's output, not tool results). */ lineStage?: boolean; /** A spec request is in flight. */ authoring: boolean; /** The job finished; a spec-driven view freezes as `done`. */ settled?: boolean; } export interface JobWidgetDerivation { state: Exclude<JobWidgetEntryState, "skipped">; view: JobWidgetView; updatedAtMs: number; } export interface JobWidgetRuntimeOptions { spec: JobWidgetSpec | undefined; matcher: LineMatcher; startTime: number; now?: () => number; /** * A fresh redactor per source, fed that source's complete lines in order before they are cut, * matched or kept: views cut long text, a cut token no longer looks like one to a redactor, and * a private key spans lines, so redaction is stateful per source and runs before any cut. */ redactSource?: () => SourceLineRedactor; } export declare class JobWidgetRuntime { #private; readonly spec: JobWidgetSpec | undefined; constructor(options: JobWidgetRuntimeOptions); /** Non-empty lines seen since the last match on a source some rule reads: the drift signal. */ get unmatchedLines(): number; get lastMatchAt(): number | undefined; /** Non-empty lines read across every source. */ get totalLines(): number; /** Non-empty lines per second across every source over the rate window. */ get linesPerSecond(): number; /** Reads every source's new text; `flush` ends lines in progress. Returns whether a line arrived. */ ingest(sources: readonly JobTextSource[], flush: boolean): boolean; /** First and last lines per source, most active first, for the author and the dry run. */ samples(): JobWidgetSourceSample[]; derive(context: JobWidgetViewContext): JobWidgetDerivation; } //# sourceMappingURL=runtime.d.ts.map