@haywoodmarx/agent-pager 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -0
  3. package/dist/src/broker/address.d.ts +49 -0
  4. package/dist/src/broker/address.js +110 -0
  5. package/dist/src/broker/broker.d.ts +665 -0
  6. package/dist/src/broker/broker.js +2270 -0
  7. package/dist/src/broker/database.d.ts +81 -0
  8. package/dist/src/broker/database.js +69 -0
  9. package/dist/src/broker/operator-projection.d.ts +291 -0
  10. package/dist/src/broker/operator-projection.js +722 -0
  11. package/dist/src/broker/protocol.d.ts +237 -0
  12. package/dist/src/broker/protocol.js +311 -0
  13. package/dist/src/broker/schema.d.ts +94 -0
  14. package/dist/src/broker/schema.js +454 -0
  15. package/dist/src/broker/snapshot.d.ts +171 -0
  16. package/dist/src/broker/snapshot.js +78 -0
  17. package/dist/src/configuration-defaults.d.ts +64 -0
  18. package/dist/src/configuration-defaults.js +48 -0
  19. package/dist/src/configuration.d.ts +76 -0
  20. package/dist/src/configuration.js +156 -0
  21. package/dist/src/implementations/claude/environment.d.ts +8 -0
  22. package/dist/src/implementations/claude/environment.js +9 -0
  23. package/dist/src/implementations/claude/gateway-cli.d.ts +2 -0
  24. package/dist/src/implementations/claude/gateway-cli.js +136 -0
  25. package/dist/src/implementations/claude/gateway-identity.d.ts +134 -0
  26. package/dist/src/implementations/claude/gateway-identity.js +103 -0
  27. package/dist/src/implementations/claude/gateway.d.ts +148 -0
  28. package/dist/src/implementations/claude/gateway.js +236 -0
  29. package/dist/src/implementations/claude/instructions.d.ts +33 -0
  30. package/dist/src/implementations/claude/instructions.js +64 -0
  31. package/dist/src/implementations/claude/manifest.d.ts +33 -0
  32. package/dist/src/implementations/claude/manifest.js +108 -0
  33. package/dist/src/implementations/claude/plugin-directory.d.ts +80 -0
  34. package/dist/src/implementations/claude/plugin-directory.js +137 -0
  35. package/dist/src/implementations/claude/session-continuation.d.ts +25 -0
  36. package/dist/src/implementations/claude/session-continuation.js +125 -0
  37. package/dist/src/implementations/claude/session-identity.d.ts +25 -0
  38. package/dist/src/implementations/claude/session-identity.js +31 -0
  39. package/dist/src/implementations/claude/session-start-cli.d.ts +2 -0
  40. package/dist/src/implementations/claude/session-start-cli.js +16 -0
  41. package/dist/src/implementations/claude/socket-delivery.d.ts +52 -0
  42. package/dist/src/implementations/claude/socket-delivery.js +159 -0
  43. package/dist/src/implementations/model.d.ts +162 -0
  44. package/dist/src/implementations/model.js +1 -0
  45. package/dist/src/implementations/opencode/adapter.d.ts +71 -0
  46. package/dist/src/implementations/opencode/adapter.js +94 -0
  47. package/dist/src/implementations/opencode/environment.d.ts +8 -0
  48. package/dist/src/implementations/opencode/environment.js +9 -0
  49. package/dist/src/implementations/opencode/manifest.d.ts +30 -0
  50. package/dist/src/implementations/opencode/manifest.js +93 -0
  51. package/dist/src/implementations/opencode/plugin-api.d.ts +120 -0
  52. package/dist/src/implementations/opencode/plugin-api.js +1 -0
  53. package/dist/src/implementations/opencode/plugin.d.ts +38 -0
  54. package/dist/src/implementations/opencode/plugin.js +303 -0
  55. package/dist/src/implementations/opencode/self-close-tool.d.ts +9 -0
  56. package/dist/src/implementations/opencode/self-close-tool.js +31 -0
  57. package/dist/src/implementations/orca/terminal.d.ts +48 -0
  58. package/dist/src/implementations/orca/terminal.js +154 -0
  59. package/dist/src/implementations/pi/broker-client.d.ts +56 -0
  60. package/dist/src/implementations/pi/broker-client.js +156 -0
  61. package/dist/src/implementations/pi/environment.d.ts +8 -0
  62. package/dist/src/implementations/pi/environment.js +9 -0
  63. package/dist/src/implementations/pi/extension.d.ts +57 -0
  64. package/dist/src/implementations/pi/extension.js +253 -0
  65. package/dist/src/implementations/pi/host-slots.d.ts +18 -0
  66. package/dist/src/implementations/pi/host-slots.js +27 -0
  67. package/dist/src/implementations/pi/manifest.d.ts +11 -0
  68. package/dist/src/implementations/pi/manifest.js +61 -0
  69. package/dist/src/implementations/pi/self-close-tool.d.ts +7 -0
  70. package/dist/src/implementations/pi/self-close-tool.js +27 -0
  71. package/dist/src/implementations/registry.d.ts +47 -0
  72. package/dist/src/implementations/registry.js +157 -0
  73. package/dist/src/implementations/session-key.d.ts +13 -0
  74. package/dist/src/implementations/session-key.js +19 -0
  75. package/dist/src/index.d.ts +27 -0
  76. package/dist/src/index.js +26 -0
  77. package/dist/src/launch/broker-lock.d.ts +257 -0
  78. package/dist/src/launch/broker-lock.js +644 -0
  79. package/dist/src/launch/cli.d.ts +37 -0
  80. package/dist/src/launch/cli.js +317 -0
  81. package/dist/src/launch/environment.d.ts +45 -0
  82. package/dist/src/launch/environment.js +48 -0
  83. package/dist/src/launch/launch.d.ts +235 -0
  84. package/dist/src/launch/launch.js +223 -0
  85. package/dist/src/launch/on-demand.d.ts +202 -0
  86. package/dist/src/launch/on-demand.js +435 -0
  87. package/dist/src/launch/runtime-composition.d.ts +88 -0
  88. package/dist/src/launch/runtime-composition.js +253 -0
  89. package/dist/src/launch/runtime.d.ts +79 -0
  90. package/dist/src/launch/runtime.js +196 -0
  91. package/dist/src/launch/service-system.d.ts +11 -0
  92. package/dist/src/launch/service-system.js +39 -0
  93. package/dist/src/launch/service.d.ts +173 -0
  94. package/dist/src/launch/service.js +492 -0
  95. package/dist/src/launch/skill.d.ts +57 -0
  96. package/dist/src/launch/skill.js +81 -0
  97. package/dist/src/launch/terminal.d.ts +26 -0
  98. package/dist/src/launch/terminal.js +43 -0
  99. package/dist/src/launch/workspace-branch.d.ts +10 -0
  100. package/dist/src/launch/workspace-branch.js +29 -0
  101. package/dist/src/messaging/delivery-client.d.ts +144 -0
  102. package/dist/src/messaging/delivery-client.js +261 -0
  103. package/dist/src/messaging/delivery.d.ts +75 -0
  104. package/dist/src/messaging/delivery.js +22 -0
  105. package/dist/src/messaging/inbox-socket.d.ts +98 -0
  106. package/dist/src/messaging/inbox-socket.js +278 -0
  107. package/dist/src/messaging/mcp.d.ts +53 -0
  108. package/dist/src/messaging/mcp.js +501 -0
  109. package/dist/src/messaging/notifications.d.ts +231 -0
  110. package/dist/src/messaging/notifications.js +489 -0
  111. package/dist/src/messaging/push-delivery.d.ts +77 -0
  112. package/dist/src/messaging/push-delivery.js +187 -0
  113. package/dist/src/messaging/tools.d.ts +11 -0
  114. package/dist/src/messaging/tools.js +102 -0
  115. package/dist/src/messaging/wake.d.ts +23 -0
  116. package/dist/src/messaging/wake.js +39 -0
  117. package/dist/src/operator/agent-projection.d.ts +102 -0
  118. package/dist/src/operator/agent-projection.js +249 -0
  119. package/dist/src/operator/commands.d.ts +50 -0
  120. package/dist/src/operator/commands.js +199 -0
  121. package/dist/src/operator/diagnostics.d.ts +21 -0
  122. package/dist/src/operator/diagnostics.js +22 -0
  123. package/dist/src/operator/protocol.d.ts +511 -0
  124. package/dist/src/operator/protocol.js +49 -0
  125. package/dist/src/operator/repository-system.d.ts +14 -0
  126. package/dist/src/operator/repository-system.js +150 -0
  127. package/dist/src/operator/repository.d.ts +79 -0
  128. package/dist/src/operator/repository.js +72 -0
  129. package/dist/src/operator/traffic-projection.d.ts +19 -0
  130. package/dist/src/operator/traffic-projection.js +229 -0
  131. package/dist/src/operator/transport.d.ts +87 -0
  132. package/dist/src/operator/transport.js +549 -0
  133. package/dist/src/operator/update-store.d.ts +53 -0
  134. package/dist/src/operator/update-store.js +162 -0
  135. package/dist/src/operator/updates.d.ts +94 -0
  136. package/dist/src/operator/updates.js +280 -0
  137. package/dist/src/operator/validation.d.ts +114 -0
  138. package/dist/src/operator/validation.js +916 -0
  139. package/dist/src/shared/guards.d.ts +59 -0
  140. package/dist/src/shared/guards.js +119 -0
  141. package/dist/src/shared/http.d.ts +30 -0
  142. package/dist/src/shared/http.js +50 -0
  143. package/dist/src/shared/row.d.ts +2 -0
  144. package/dist/src/shared/row.js +1 -0
  145. package/dist/src/shared/shell.d.ts +6 -0
  146. package/dist/src/shared/shell.js +8 -0
  147. package/dist/src/tui/actions.d.ts +166 -0
  148. package/dist/src/tui/actions.js +253 -0
  149. package/dist/src/tui/agent-tree.d.ts +125 -0
  150. package/dist/src/tui/agent-tree.js +663 -0
  151. package/dist/src/tui/app.d.ts +38 -0
  152. package/dist/src/tui/app.js +378 -0
  153. package/dist/src/tui/chrome.d.ts +86 -0
  154. package/dist/src/tui/chrome.js +85 -0
  155. package/dist/src/tui/client.d.ts +41 -0
  156. package/dist/src/tui/client.js +279 -0
  157. package/dist/src/tui/composition.d.ts +41 -0
  158. package/dist/src/tui/composition.js +146 -0
  159. package/dist/src/tui/message-views.d.ts +94 -0
  160. package/dist/src/tui/message-views.js +515 -0
  161. package/dist/src/tui/model.d.ts +414 -0
  162. package/dist/src/tui/model.js +758 -0
  163. package/dist/src/tui/presentation.d.ts +350 -0
  164. package/dist/src/tui/presentation.js +541 -0
  165. package/dist/src/tui/production.d.ts +79 -0
  166. package/dist/src/tui/production.js +253 -0
  167. package/dist/src/tui/run-terminal.d.ts +32 -0
  168. package/dist/src/tui/run-terminal.js +54 -0
  169. package/dist/src/tui/runtime.d.ts +113 -0
  170. package/dist/src/tui/runtime.js +189 -0
  171. package/dist/src/tui/theme.d.ts +49 -0
  172. package/dist/src/tui/theme.js +55 -0
  173. package/dist/src/tui/transport.d.ts +31 -0
  174. package/dist/src/tui/transport.js +255 -0
  175. package/dist/src/version.d.ts +11 -0
  176. package/dist/src/version.js +52 -0
  177. package/package.json +142 -0
  178. package/skills/pager/SKILL.md +112 -0
@@ -0,0 +1,350 @@
1
+ import { type AgentId } from "../broker/protocol.js";
2
+ import type { OperatorAcceptedDelivery, OperatorAgent, OperatorCommand, OperatorCommandResult, OperatorDiagnostic, OperatorJsonValue, OperatorTraffic } from "../operator/protocol.js";
3
+ import type { TuiOperatorModelState } from "./model.js";
4
+ import type { TuiTheme, TuiThemeColor } from "./theme.js";
5
+ /** Column widths of the agent-log list when a workspace scopes the traffic. */
6
+ export declare const WORKSPACE_TRAFFIC_COLUMNS: Readonly<{
7
+ state: 3;
8
+ time: 6;
9
+ from: 15;
10
+ arrow: 3;
11
+ to: 14;
12
+ type: number;
13
+ }>;
14
+ /**
15
+ * Column widths of the agent-log list when a single agent scopes the traffic.
16
+ *
17
+ * One peer stands where the workspace list shows two, so it takes half of what those two endpoints
18
+ * occupy there; the arrow between them belongs to neither and is excluded before halving.
19
+ */
20
+ export declare const AGENT_TRAFFIC_COLUMNS: Readonly<{
21
+ state: 3;
22
+ time: 6;
23
+ direction: 6;
24
+ peer: number;
25
+ type: number;
26
+ }>;
27
+ /** Label gutter shared by the message-log metadata and lifecycle sections. */
28
+ export declare const MESSAGE_LABEL_GUTTER = 11;
29
+ /** Label gutter used by the agent identity modal. */
30
+ export declare const IDENTITY_LABEL_GUTTER = 14;
31
+ /** Rows the message-log body block never falls below while the pane can afford them. */
32
+ export declare const MINIMUM_MESSAGE_BODY_ROWS = 3;
33
+ /**
34
+ * Size the message-log body block from the pane rather than the message.
35
+ *
36
+ * The block is fixed for any one pane height so the panel cannot jump as the operator moves through
37
+ * the list, and it scales with the pane's height.
38
+ * @param contentRows - Rows the message-log pane gives its content, excluding header, footer, and rules.
39
+ * @returns Rows reserved for the subject and clipped body.
40
+ */
41
+ export declare function selectMessageBodyRows(contentRows: number): number;
42
+ /**
43
+ * Marks the selected row in the gutter cell that sits outside its fill.
44
+ *
45
+ * The marker is not part of the highlight, so it keeps one shape whether or not the row is filled.
46
+ */
47
+ export declare const SELECTION_GUTTER_GLYPH = "\u2503";
48
+ /** Default column count of the agent tree pane, including its own padding; see {@link sidePaneWidths} for its draggable range. */
49
+ export declare const AGENT_TREE_COLUMNS = 52;
50
+ /** Default column count of the message log pane, including its own padding; see {@link sidePaneWidths} for its draggable range. */
51
+ export declare const MESSAGE_LOG_COLUMNS = 42;
52
+ /** Narrowest the agent tree may be dragged before its own content stops being legible. */
53
+ export declare const MINIMUM_TREE_COLUMNS = 29;
54
+ /** Narrowest the message log may be dragged before its own content stops being legible. */
55
+ export declare const MINIMUM_MESSAGE_LOG_COLUMNS = 41;
56
+ /** Columns the agent log keeps for itself, bounding how far either side pane may be dragged open. */
57
+ export declare const MINIMUM_AGENT_LOG_COLUMNS = 55;
58
+ /** Cells the window border and the two rules between panes take before any pane is drawn. */
59
+ export declare const PANE_DECORATION_COLUMNS = 4;
60
+ /** Drag state and available room for {@link sidePaneWidths}. */
61
+ export type SidePaneWidthsRequest = {
62
+ /** Columns the operator dragged the tree pane to, or null for its default. */
63
+ tree: number | null;
64
+ /** Default width of the tree pane. */
65
+ treeFallback: number;
66
+ /** Columns the operator dragged the message-log pane to, or null for its default. */
67
+ messageLog: number | null;
68
+ /** Default width of the message-log pane. */
69
+ messageLogFallback: number;
70
+ /** Columns the three panes share, excluding the two rules between them. */
71
+ available: number;
72
+ };
73
+ /**
74
+ * Resolve both side panes' widths against the operator's drags and the room actually available.
75
+ *
76
+ * Each pane holds the width it was dragged to while the room allows, so widening one does not move
77
+ * the other. They yield only together: when the two of them plus the agent log's own minimum exceed
78
+ * the room, they give up the shortfall in proportion to how far each holds above its floor. A null
79
+ * request is a pane the operator has never dragged, which holds its default.
80
+ * @param request - Both panes' drag state, their fallbacks, and the room available to them.
81
+ * @returns Columns each side pane occupies; the agent log takes what is left.
82
+ */
83
+ export declare function sidePaneWidths({ tree, treeFallback, messageLog, messageLogFallback, available, }: SidePaneWidthsRequest): {
84
+ readonly tree: number;
85
+ readonly messageLog: number;
86
+ };
87
+ /**
88
+ * Terminal width below which the operator surface becomes a single-pane stack.
89
+ *
90
+ * The three panes cannot all be shown below the sum of the widths each needs to stay legible, so that
91
+ * sum plus the decoration between and around them is exactly where the surface stops trying.
92
+ */
93
+ export declare const PORTRAIT_BREAKPOINT_COLUMNS: number;
94
+ /**
95
+ * Decide how wide a traffic row's type column should render.
96
+ *
97
+ * The type column outranks the subject as a row narrows: a type is a whole word, while a subject
98
+ * clipped to its first few characters is worth less than the category beside it. The subject
99
+ * therefore absorbs the loss down to nothing, and only a row too narrow for the type column itself
100
+ * clips that.
101
+ * @param fixedColumnsWithoutType - The row's other fixed columns for its scope, excluding type.
102
+ * @param maxWidth - The type column's width when there is room to show it in full.
103
+ * @param rowWidth - Character cells available to the whole row, subject included.
104
+ * @returns `maxWidth`, or what remains of the row when even that does not fit.
105
+ */
106
+ export declare function trafficTypeColumnWidth(fixedColumnsWithoutType: number, maxWidth: number, rowWidth: number): number;
107
+ /** Rows the diagnostics log always occupies beneath the panes, however many entries it holds. */
108
+ export declare const COLLAPSED_LOG_ROWS = 3;
109
+ /**
110
+ * Render one diagnostic as a single log row.
111
+ * @param diagnostic - Content-free condition recorded by the broker or the client.
112
+ * @param width - Character cells available to the row.
113
+ * @returns The row text, clipped to the width.
114
+ */
115
+ export declare function formatDiagnostic(diagnostic: OperatorDiagnostic, width: number): string;
116
+ /**
117
+ * Word one operator command's outcome for the diagnostics log.
118
+ *
119
+ * An answer is admission, not the resulting state change, so an accepted command is worded as
120
+ * accepted. A command that got no answer at all is worded as unknown, because the broker may have
121
+ * applied it.
122
+ * @param state - Current projection, which names the agent a command targeted.
123
+ * @param command - Command the operator submitted.
124
+ * @param result - The broker's admission answer, or null when none came back.
125
+ * @returns Severity and content-free summary for the log row.
126
+ */
127
+ export declare function describeCommandOutcome(state: TuiOperatorModelState, command: OperatorCommand, result: OperatorCommandResult | null): Pick<OperatorDiagnostic, "severity" | "summary">;
128
+ /**
129
+ * Select the colour role one diagnostic severity carries.
130
+ * @param severity - Attention the condition asks for.
131
+ * @param theme - Semantic palette in use.
132
+ * @returns The colour the row is drawn in.
133
+ */
134
+ export declare function diagnosticColor(severity: OperatorDiagnostic["severity"], theme: Readonly<TuiTheme>): string;
135
+ /**
136
+ * Render a wall-clock time without seconds for list columns.
137
+ * @param at - Epoch milliseconds recorded by the broker.
138
+ * @returns Local `HH:MM` rendering.
139
+ */
140
+ export declare function formatClock(at: number): string;
141
+ /**
142
+ * Render a wall-clock time with seconds for lifecycle rows.
143
+ * @param at - Epoch milliseconds recorded by the broker.
144
+ * @returns Local `HH:MM:SS` rendering.
145
+ */
146
+ export declare function formatClockSeconds(at: number): string;
147
+ /**
148
+ * Fit a value into a fixed column count, marking loss with an ellipsis.
149
+ * @param value - Text to place in the column.
150
+ * @param width - Character cells available to the column.
151
+ * @returns Text no wider than the column.
152
+ */
153
+ export declare function truncateCells(value: string, width: number): string;
154
+ /** Cells a pane bar leaves unused at its two edges. */
155
+ export declare const PANE_BAR_INSET_COLUMNS = 2;
156
+ /**
157
+ * Fit the leading text of a pane bar so the trailing text keeps its place beside it.
158
+ *
159
+ * A bar row is one cell high, so text wider than the room it is given wraps and the row shows only its
160
+ * first line, cut at a hyphen with no ellipsis. This shortens the leading text before that happens.
161
+ * @param leading - Text at the bar's left edge, given whatever the trailing text leaves.
162
+ * @param barWidth - Cells the whole bar occupies, including its inset.
163
+ * @param trailing - Text at the bar's right edge, kept whole; empty when the bar has none.
164
+ * @returns The leading text, ending in an ellipsis when it was shortened.
165
+ */
166
+ export declare function fitBarLeading(leading: string, barWidth: number, trailing?: string): string;
167
+ /**
168
+ * Left-align a value in a fixed column.
169
+ * @param value - Text to place in the column.
170
+ * @param width - Character cells available to the column.
171
+ * @returns Truncated text padded to the column width.
172
+ */
173
+ export declare function padCells(value: string, width: number): string;
174
+ /**
175
+ * Left-align a value in a fixed column, reserving its final cell so the next column cannot abut.
176
+ * @param value - Text to place in the column.
177
+ * @param width - Character cells available to the column, including the reserved separator.
178
+ * @returns Text truncated one cell short of the column and padded to its full width.
179
+ */
180
+ export declare function padCellsBeforeColumn(value: string, width: number): string;
181
+ /**
182
+ * Right-align a value in a fixed column.
183
+ * @param value - Text to place in the column.
184
+ * @param width - Character cells available to the column.
185
+ * @returns Truncated text padded to the column width.
186
+ */
187
+ export declare function padCellsEnd(value: string, width: number): string;
188
+ /**
189
+ * Assign one stable palette slot to an agent identity.
190
+ * @param agentId - Durable broker agent identity.
191
+ * @param theme - Semantic palette in use.
192
+ * @returns The agent's colour, stable everywhere its handle appears.
193
+ */
194
+ export declare function agentColor(agentId: string, theme: Readonly<TuiTheme>): TuiThemeColor;
195
+ /**
196
+ * Render the handle an operator reads for an agent identity.
197
+ * @param state - Current projection and view state.
198
+ * @param agentId - Durable broker agent identity.
199
+ * @returns The routable handle, or the raw identity when the agent is not projected.
200
+ */
201
+ export declare function agentHandle(state: TuiOperatorModelState, agentId: string): string;
202
+ /**
203
+ * Render one alias as the handle an operator reads.
204
+ *
205
+ * The projection delivers aliases without their at-sign, and this adds the one; a leading at-sign
206
+ * already present is kept rather than doubled.
207
+ * @param alias - Projected agent alias.
208
+ * @returns The alias with exactly one leading at-sign.
209
+ */
210
+ export declare function agentHandleText(alias: string): string;
211
+ /**
212
+ * Render one agent as the full address that reaches it from any workspace.
213
+ * @param state - Current operator model state supplying the projected agents.
214
+ * @param agentId - Durable agent identity to name.
215
+ * @returns The handle followed by an at-sign and the agent's workspace name.
216
+ */
217
+ export declare function agentAddress(state: TuiOperatorModelState, agentId: string): string;
218
+ /**
219
+ * Name the implementation and worktree detail shown beside an agent handle.
220
+ * @param agent - Projected agent.
221
+ * @returns Secondary detail text, without the handle.
222
+ */
223
+ export declare function agentDetail(agent: OperatorAgent): string;
224
+ /**
225
+ * Select the glyph carried by a delivery state in the tree and traffic lists.
226
+ * @param state - Durable delivery state.
227
+ * @returns The one-cell state glyph.
228
+ */
229
+ export declare function deliveryGlyph(state: OperatorAcceptedDelivery["state"]): string;
230
+ /**
231
+ * Select the colour carried by a delivery state.
232
+ * @param state - Durable delivery state, or null for an observation that established none.
233
+ * @param theme - Semantic palette in use.
234
+ * @returns The state colour, or secondary text for a stateless observation.
235
+ */
236
+ export declare function deliveryColor(state: OperatorAcceptedDelivery["state"] | null, theme: Readonly<TuiTheme>): string;
237
+ /**
238
+ * Read the headline an operator scans a traffic row by.
239
+ * @param entry - Traffic row from the authoritative projection.
240
+ * @returns The durable subject for a delivery, and nothing for an audit, which carries no subject.
241
+ */
242
+ export declare function trafficSubject(entry: OperatorTraffic): string;
243
+ /**
244
+ * Read the type of a traffic row, apart from its subject.
245
+ * @param entry - Traffic row from the authoritative projection.
246
+ * @returns The sender-supplied type of a delivery, or the control word for an audit.
247
+ */
248
+ export declare function trafficType(entry: OperatorTraffic): string;
249
+ /**
250
+ * Render a retained message body as the sentence an operator reads, not its wire JSON.
251
+ *
252
+ * A bare string body renders as itself. A peer sending a `{ type, detail }` envelope falls back to
253
+ * its `detail`. Every other shape the broker's opaque body admits — an array, an object
254
+ * with no string `detail` — has no defined readable subset, so it falls back to the full body rather
255
+ * than inventing a partial rendering. Exact wire-byte access does not depend on this: the raw-copy
256
+ * action reads the body's own retained representation, untouched by this function.
257
+ * @param content - Retained message body content.
258
+ * @returns Text for the message-log pane and full-message overlay.
259
+ */
260
+ export declare function messageBodyDisplayText(content: OperatorJsonValue): string;
261
+ /** Heading the agent log presents, carrying an agent identity only where the scope is one agent. */
262
+ export type TuiAgentLogScope = {
263
+ readonly kind: "agent";
264
+ readonly title: string;
265
+ readonly detail: string;
266
+ readonly agentId: AgentId;
267
+ } | {
268
+ readonly kind: "workspace";
269
+ readonly title: string;
270
+ readonly detail: string;
271
+ };
272
+ /**
273
+ * Describe the scope heading the agent log presents for the current tree selection.
274
+ * @param state - Current projection and view state.
275
+ * @returns Heading title, its trailing detail, and the scope kind, with the agent's identity when one agent scopes the log.
276
+ */
277
+ export declare function agentLogScope(state: TuiOperatorModelState): TuiAgentLogScope;
278
+ /**
279
+ * Count the agents the operator is being asked to keep an eye on.
280
+ *
281
+ * Archived identities are excluded: they are kept for their history and their conversations may
282
+ * return, but they are not part of what is running now. So are the agents of a hidden workspace,
283
+ * which the operator has said they do not want to see.
284
+ * @param state - Current authoritative projection.
285
+ * @returns - Number of agents that are neither archived nor in a hidden workspace.
286
+ */
287
+ export declare function activeAgentCount(state: TuiOperatorModelState): number;
288
+ /**
289
+ * Report the broker indicator and its colour role.
290
+ * @param connection - Current transport condition held by the model.
291
+ * @param theme - Semantic palette in use.
292
+ * @returns Indicator glyph and colour.
293
+ */
294
+ export declare function brokerIndicator(connection: TuiOperatorModelState["connection"], theme: Readonly<TuiTheme>): {
295
+ readonly glyph: string;
296
+ readonly color: string;
297
+ };
298
+ /**
299
+ * Move a menu selection one entry, wrapping at both ends.
300
+ * @param index - Current selection.
301
+ * @param direction - Requested movement.
302
+ * @param count - Number of entries to move within.
303
+ * @returns - Next selection, zero for a menu with no entries.
304
+ */
305
+ export declare function stepWrappingIndex(index: number, direction: "up" | "down", count: number): number;
306
+ /**
307
+ * Select traffic that belongs to the local tree selection without treating audits as deliveries.
308
+ * @param state - Current projection and view state.
309
+ * @returns Traffic rows in projection order, empty where the selection scopes none.
310
+ */
311
+ export declare function selectTuiTraffic(state: TuiOperatorModelState): readonly OperatorTraffic[];
312
+ /**
313
+ * Read the traffic row the agent log has selected.
314
+ * @param state - Current projection and view state.
315
+ * @returns The selected row, or undefined when nothing is selected or it has left the projection.
316
+ */
317
+ export declare function selectedTraffic(state: TuiOperatorModelState): OperatorTraffic | undefined;
318
+ /**
319
+ * Read the accepted delivery the message log presents.
320
+ * @param state - Current projection and view state.
321
+ * @returns The selected delivery, or undefined when the selected row is not one.
322
+ */
323
+ export declare function selectedMessage(state: TuiOperatorModelState): OperatorAcceptedDelivery | undefined;
324
+ /**
325
+ * Find one accepted delivery by its durable message identity.
326
+ * @param state - Current projection and view state.
327
+ * @param messageId - Durable message the caller holds an identity for.
328
+ * @returns The delivery, or undefined when the projection no longer carries it.
329
+ */
330
+ export declare function findTuiMessage(state: TuiOperatorModelState, messageId: string): OperatorAcceptedDelivery | undefined;
331
+ /**
332
+ * Report whether one traffic row involves a single agent.
333
+ * @param entry - Traffic row from the authoritative projection.
334
+ * @param agentId - Durable broker agent identity.
335
+ * @returns Whether the row belongs to the agent's filtered log.
336
+ */
337
+ export declare function trafficTouchesAgent(entry: OperatorTraffic, agentId: string): boolean;
338
+ /**
339
+ * Report whether one traffic row involves any agent of a workspace.
340
+ * @param entry - Traffic row from the authoritative projection.
341
+ * @param agentIds - Durable identities grouped under one operator repository.
342
+ * @returns Whether the row belongs to the workspace log.
343
+ */
344
+ export declare function trafficTouchesAny(entry: OperatorTraffic, agentIds: ReadonlySet<string>): boolean;
345
+ /**
346
+ * Read the time a traffic row is ordered and listed by.
347
+ * @param entry - Traffic row from the authoritative projection.
348
+ * @returns Epoch milliseconds shown in the time column.
349
+ */
350
+ export declare function trafficTime(entry: OperatorTraffic): number;