()
| 172 | #a2UIContextIds: string[] = []; |
| 173 | |
| 174 | constructor() { |
| 175 | ensureLicenseWatermark(this.#config.headers); |
| 176 | |
| 177 | this.#runtimeConnectionStatus.set(this.core.runtimeConnectionStatus); |
| 178 | this.#runtimeUrl.set(this.core.runtimeUrl); |
| 179 | this.#runtimeTransport.set(this.core.runtimeTransport); |
| 180 | this.#headers.set(this.core.headers); |
| 181 | this.#threadEndpoints.set(this.core.threadEndpoints); |
| 182 | this.#intelligence.set(this.core.intelligence); |
| 183 | this.#licenseStatus.set(this.core.licenseStatus); |
| 184 | this.#config.renderToolCalls?.forEach((renderConfig) => { |
| 185 | this.addRenderToolCall(renderConfig); |
| 186 | }); |
| 187 | this.#config.renderActivityMessages?.forEach((renderConfig) => { |
| 188 | this.addRenderActivityMessage(renderConfig); |
| 189 | }); |
| 190 | |
| 191 | this.#config.tools?.forEach((tool) => { |
| 192 | if (tool.renderer && tool.parameters) { |
| 193 | this.addRenderToolCall({ |
| 194 | name: tool.name, |
| 195 | args: tool.parameters, |
| 196 | component: tool.renderer, |
| 197 | agentId: tool.agentId, |
| 198 | }); |
| 199 | } |
| 200 | }); |
| 201 | |
| 202 | this.#config.frontendTools?.forEach((clientTool) => { |
| 203 | this.addFrontendTool({ ...clientTool, injector: this.#rootInjector }); |
| 204 | }); |
| 205 | |
| 206 | this.#config.humanInTheLoop?.forEach((humanInTheLoopTool) => { |
| 207 | this.addHumanInTheLoop(humanInTheLoopTool); |
| 208 | }); |
| 209 | |
| 210 | this.core.subscribe({ |
| 211 | onAgentsChanged: () => { |
| 212 | this.#agents.set(this.core.agents); |
| 213 | }, |
| 214 | onRuntimeConnectionStatusChanged: ({ status }) => { |
| 215 | // Core assigns `threadEndpoints`/`intelligence` synchronously before it |
| 216 | // notifies this callback (see agent-registry `ensureRuntimeMode`), so |
| 217 | // mirroring them here keeps the signals in lockstep with the status |
| 218 | // signal and lets reactive consumers observe `intelligence.wsUrl` once |
| 219 | // `/info` resolves. |
| 220 | this.#runtimeConnectionStatus.set(status); |
| 221 | this.#threadEndpoints.set(this.core.threadEndpoints); |
| 222 | this.#intelligence.set(this.core.intelligence); |
| 223 | this.#licenseStatus.set(this.core.licenseStatus); |
| 224 | this.#syncBuiltInActivityMessageRenderers(); |
| 225 | this.#syncBuiltInOpenGenerativeUI(); |
| 226 | }, |
| 227 | onHeadersChanged: ({ headers }) => { |
| 228 | this.#headers.set(headers); |
| 229 | }, |
| 230 | onSuggestionsChanged: ({ agentId, suggestions }) => { |
| 231 | this.#setSuggestions(agentId, { |
nothing calls this directly
no test coverage detected