| 93 | ) |
| 94 | |
| 95 | type harness struct { |
| 96 | runner AgentRunner |
| 97 | usageFunc UsageFunc |
| 98 | |
| 99 | width, height int |
| 100 | |
| 101 | viewport viewport.Model |
| 102 | debugView viewport.Model // bottom panel, visible only when debug.Enabled() |
| 103 | input textinput.Model |
| 104 | spinner spinner.Model |
| 105 | |
| 106 | state modelState |
| 107 | approvalPrompt string |
| 108 | approvalDetail string // optional diff/payload shown in the approval modal |
| 109 | approvalReply chan bool |
| 110 | followBottom bool // auto-scroll viewport to bottom on new content |
| 111 | |
| 112 | // debug-panel interaction state |
| 113 | debugFocus bool // Tab moves focus between input and debug panel |
| 114 | debugMode debugMode // list (overview) or detail (one event's payload) |
| 115 | debugSelected uint64 // ID of the currently-selected event |
| 116 | |
| 117 | // banner shine animation state. bannerEnd is the byte offset in output |
| 118 | // where the banner ends, so each tick can swap the banner without |
| 119 | // touching the rest of the scrollback. bannerWidth is captured at |
| 120 | // construction — it has to be, because by the time Init() runs main.go |
| 121 | // has already redirected os.Stdout into the alt-screen pipe and |
| 122 | // TermWidth() comes back as zero. |
| 123 | shineCol int |
| 124 | shineTick int // frame counter; eased into shineCol each frame |
| 125 | shineDone bool |
| 126 | bannerEnd int |
| 127 | bannerWidth int |
| 128 | |
| 129 | // MCP background-loading state. mcpLoading is true between the |
| 130 | // ProgressBegin and ProgressDone messages; the status line shows the |
| 131 | // current server and an X/N counter while connections are in flight. |
| 132 | mcpLoading bool |
| 133 | mcpTotal int |
| 134 | mcpDone int |
| 135 | mcpFailed int |
| 136 | mcpCurrent string |
| 137 | |
| 138 | // output must be a pointer: Bubble Tea passes the model by value through |
| 139 | // Update, and strings.Builder panics when copied (copyCheck on its |
| 140 | // internal self-pointer). The pointer survives the copy intact. |
| 141 | output *strings.Builder |
| 142 | } |
| 143 | |
| 144 | type debugMode int |
| 145 |
nothing calls this directly
no outgoing calls
no test coverage detected