@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
100 lines • 4.75 kB
TypeScript
export declare const TERMINAL_MONITOR_STATE_EVENT = "terminal_monitor_state";
export declare const TERMINAL_MONITOR_ENDED_EVENT = "terminal_monitor_ended";
export declare const WAKE_SOURCE_STATE_EVENT = "wake_source_state";
export declare const CONTINUATION_HOLD_STATE_EVENT = "continuation_hold_state";
/** Live widgets of a session's long background jobs; payload `JobWidgetState` (job-widgets/view-types.ts). */
export declare const JOB_WIDGET_STATE_EVENT = "job_widget_state";
export declare const MONITOR_NOTIFICATION_CUSTOM_TYPE = "senpi-monitor:notification";
/** A background terminal session's age notice or auto-reap; payload `TerminalBackgroundAgeEvent` (senpi#6201). */
export declare const TERMINAL_BACKGROUND_AGE_EVENT = "terminal_background_age";
/**
* `running`: the session is still running at `ageMinutes` (first at 10 minutes, then every 30). `reaped`: the opt-in
* auto-reap stopped it at `autoReapMinutes`. `reap_failed`: the auto-reap's one stop at `autoReapMinutes` did not end
* it, for `reason`; it keeps running and keeps reporting. `stop` is the call that stops it; `autoReapMinutes` is null
* when nothing will stop it automatically.
*/
export interface TerminalBackgroundAgeEvent {
readonly kind: "running" | "reaped" | "reap_failed";
readonly id: string;
readonly description: string;
readonly command?: string;
readonly startedAtMs: number;
readonly ageMs: number;
readonly ageMinutes: number;
readonly autoReapMinutes: number | null;
/** Why the auto-reap failed; set on `reap_failed` only. */
readonly reason?: string;
readonly stop: {
readonly tool: "kill_bash";
readonly args: {
readonly bash_id: string;
};
};
}
/** Per-monitor entry in a monitor notification's `details.monitors`. */
export interface MonitorNotificationDetail {
readonly id: string;
readonly description: string;
readonly eventCount: number;
readonly kinds: readonly string[];
/** Set when the watch was created with `human_input` and this delivery carries its output lines. */
readonly humanInput?: true;
}
/** True for a delivered monitor notification that carries a person's words (omo#10280). */
export declare function isHumanInputMonitorNotification(message: unknown): boolean;
export interface WakeSourceStateItem {
readonly id: string;
readonly description?: string;
readonly startedAtMs?: number;
readonly deadlineAtMs?: number;
}
export interface WakeSourceStateEvent {
readonly source: string;
readonly activeCount: number;
readonly kind?: "children" | "background";
readonly items?: readonly WakeSourceStateItem[];
}
export interface ContinuationHoldStateEvent {
readonly source: string;
readonly active: boolean;
}
/**
* Deliberately validates only the shared cross-package fields. Emitters may add
* source-specific details such as `channels` or `monitors`.
*/
export declare function isWakeSourceStateEvent(data: unknown): data is WakeSourceStateEvent;
export declare function isContinuationHoldStateEvent(data: unknown): data is ContinuationHoldStateEvent;
/** One live watch as broadcast on the monitor state event; mirrors MonitorSnapshotEntry. */
export interface TerminalMonitorStateMonitorEntry {
readonly id: string;
/** Stable "mon_" identity surviving runtime id churn; absent in pre-enrichment payloads. */
readonly monitorId?: string;
readonly description: string;
readonly paused: boolean;
/** Epoch milliseconds when the watch registered; lets consumers render their own elapsed labels. */
readonly startedAtMs: number;
readonly command?: string | null;
readonly filter?: string | null;
readonly persistent?: boolean;
readonly deadlineMs?: number | null;
readonly fireCount?: number;
readonly lastFiredAtMs?: number | null;
}
export interface TerminalMonitorStateEvent {
readonly activeCount: number;
/** Per-watch detail for consumers that need more than the count; absent in pre-enrichment payloads. */
readonly monitors?: readonly TerminalMonitorStateMonitorEntry[];
}
export declare function isTerminalMonitorStateEvent(data: unknown): data is TerminalMonitorStateEvent;
export type TerminalMonitorEndedReason = "exit" | "timeout" | "killed" | "disposed";
export interface TerminalMonitorEndedEvent {
readonly id: string;
readonly description: string;
readonly startedAtMs: number;
readonly endedAtMs: number;
readonly reason: TerminalMonitorEndedReason;
readonly exitCode: number | null;
readonly fireCount: number;
}
export declare function isTerminalMonitorEndedEvent(data: unknown): data is TerminalMonitorEndedEvent;
//# sourceMappingURL=monitor-state-event.d.ts.map