@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
26 lines (25 loc) • 1.36 kB
TypeScript
export type ClaudeQueueAction = "send-now" | "withdraw";
export interface ClaudeQueueDeps {
/** The pane's screen with styles, as `readScreen` with format "ansi" returns it. */
screen(): Promise<string>;
sendKeys(keys: string[]): Promise<void>;
/** An approval, terminal prompt or question the Hook holds for this pane. */
held(): boolean;
/** The conversation's transcript text, at least its recent tail. */
transcript(): Promise<string>;
sleep(ms: number): Promise<void>;
}
/** The last `TAIL_BYTES` of a transcript, from its first whole line. */
export declare function transcriptTail(file: string): Promise<string>;
/** The person's messages still in Claude's queue, oldest first, from its
* queue rows: an `enqueue` joins it; `dequeue` takes the head; `remove` and
* `popAll` take the message they name. The harness's own envelopes (task
* notifications, reminders) are left out, as the phone never shows them. */
export declare function claudeQueued(transcript: string): string[];
/** Send Claude's queued messages to the running turn now, or withdraw them
* all unsent. `status` is the pane's agent status. Answers the messages it
* acted on, oldest first. */
export declare function claudeQueueAction(action: ClaudeQueueAction, status: string, deps: ClaudeQueueDeps): Promise<{
ok: true;
messages: string[];
}>;