UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

33 lines (32 loc) • 1.79 kB
import { z } from "zod"; import { type TurnRecord } from "./turn-records.js"; import { type Json } from "./protocol.js"; /** `{ server, pane, completion }` marks a finished turn seen; `unread: true` * clears the stored `seenCompletion` again, but only when it equals the * completion the client sent. */ export declare const seenRequest: z.ZodObject<{ server: z.ZodString; pane: z.ZodString; completion: z.ZodString; unread: z.ZodOptional<z.ZodLiteral<true>>; }, z.core.$strip>; export declare function seenPath(server: string, pane: string): string; export declare function tmuxCompletion(source: string, session: string, at: string, seq: number): string; export declare function tmuxCompletedTurn(source: string, session: string, record?: TurnRecord): Promise<TurnRecord | undefined>; export declare function readSessionSeen(server: string, pane: string, current?: string, previousId?: string): Promise<string | undefined>; export declare function setSessionSeen(server: string, pane: string, completionId: string, unread?: boolean): Promise<void>; /** Everything the route touches outside this file; tests pass their own. */ export interface SeenDeps { snapshot(server: string): Promise<Json>; } /** `POST /v1/sessions/seen`: stores what the client sent (last writer wins), * or clears `seenCompletion` when `unread: true` and the stored mark equals * the completion sent. */ export declare function markSessionSeen(data: Json, deps?: SeenDeps): Promise<Json>; export declare function herdrTurn(pane: Json): { id: string; turn: number; seen: boolean | undefined; } | undefined; export declare function sessionPin(server: string, pane: Json): Promise<Json | undefined>; export declare function setSessionPin(data: Json, deps?: SeenDeps): Promise<Json>;