/** * Attach side-panel for a hooteams role (`a` in team focus). * * Renders one role's live TeamEvents in the style of hooteams' StreamRenderer * (`hooteams attach `): ◉ lifecycle lines, dim italic thinking, inline * streaming text, ✓/✗ tool results, dim per-turn usage stamps. Differences * from the CLI renderer are dictated by the host: colors go through hoocode's * theme helpers (no raw ANSI) and output lands in a bounded ring buffer * instead of an unbounded stdout stream. * * The panel filters the team connection's single shared /events subscription — * it never opens its own SSE connection — and unsubscribes on dispose(), so * attach/detach cycles leave no leaked subscribers. * * Approval gates: task_* lifecycle events render as stream lines, and when the * attached role pauses, presentApproval() embeds the AskOptions pane right * where the stream stopped — pick an option (or type a free-form answer) and * the caller answers the server; the stream then carries on under a * "✓ answered: …" stamp. */ import type { Component, Focusable, TUI } from "@kolisachint/hoocode-tui"; import type { TeamApproval } from "../../../core/team-approvals.js"; import type { TeamViewConnection } from "../../../core/team-view.js"; /** Fixed-capacity FIFO over a circular array: push evicts the oldest entry. */ export declare class RingBuffer { readonly capacity: number; private readonly slots; private start; private count; constructor(capacity: number); push(item: T): void; get length(): number; toArray(): T[]; } export interface TeamAttachPanelCallbacks { /** `q`/esc: close the panel; the role keeps running. */ onDetach: () => void; /** `n`: nudge the attached role. */ onNudge: (role: string) => void; } export declare class TeamAttachPanelComponent implements Component, Focusable { readonly role: string; private readonly callbacks; private readonly ui?; focused: boolean; private readonly lines; /** Streaming tail (text/thinking deltas) not yet terminated by a line break. */ private partial; private partialKind; private unsubscribe; /** Gate currently embedded in the panel; input is delegated to it. */ private approval; constructor(role: string, connection: TeamViewConnection, callbacks: TeamAttachPanelCallbacks, ui?: TUI | undefined, bufferLines?: number); /** Detach from the shared event stream; settles any open gate as skipped. Idempotent. */ dispose(): void; invalidate(): void; /** * Embed one approval gate in the panel (the attached role paused). Resolves * with the chosen or free-form answer; undefined when skipped (esc), when * the signal aborts (answered elsewhere), or when the panel is disposed. * Answering the server is the caller's job — on an answer the panel just * stamps "✓ answered: …" into the stream. */ presentApproval(approval: TeamApproval, signal: AbortSignal): Promise; handleInput(data: string): void; private styledPartial; /** Flush the streaming tail into the buffer as a finished line. */ private breakLine; /** Append streaming delta text, completing buffer lines at embedded newlines. */ private appendDelta; /** Mirrors hooteams' StreamRenderer event handling, themed and buffered. */ private applyEvent; /** Buffered logical line count (completed lines only). Exposed for tests. */ bufferedLineCount(): number; render(width: number): string[]; } //# sourceMappingURL=team-attach-panel.d.ts.map