(
workspaceId: WorkspaceId,
streamInfo: WorkspaceStreamInfo,
historySequence: number,
options?: { replay?: boolean }
)
| 1884 | } |
| 1885 | |
| 1886 | private emitStreamStart( |
| 1887 | workspaceId: WorkspaceId, |
| 1888 | streamInfo: WorkspaceStreamInfo, |
| 1889 | historySequence: number, |
| 1890 | options?: { replay?: boolean } |
| 1891 | ): void { |
| 1892 | const streamStartAgentId = streamInfo.initialMetadata?.agentId; |
| 1893 | const streamStartMode = this.getStreamMode(streamInfo.initialMetadata); |
| 1894 | const canonicalModel = normalizeToCanonical(streamInfo.model); |
| 1895 | const routedThroughGateway = |
| 1896 | streamInfo.initialMetadata?.routedThroughGateway ?? |
| 1897 | streamInfo.model.startsWith("mux-gateway:"); |
| 1898 | const routeProvider = streamInfo.initialMetadata?.routeProvider; |
| 1899 | |
| 1900 | this.emit("stream-start", { |
| 1901 | type: "stream-start", |
| 1902 | workspaceId: workspaceId as string, |
| 1903 | messageId: streamInfo.messageId, |
| 1904 | ...(options?.replay && { replay: true }), |
| 1905 | model: canonicalModel, |
| 1906 | routedThroughGateway, |
| 1907 | ...(routeProvider != null && { routeProvider }), |
| 1908 | historySequence, |
| 1909 | startTime: streamInfo.startTime, |
| 1910 | ...(streamStartAgentId && { agentId: streamStartAgentId }), |
| 1911 | ...(streamStartMode && { mode: streamStartMode }), |
| 1912 | ...(streamInfo.thinkingLevel && { thinkingLevel: streamInfo.thinkingLevel }), |
| 1913 | ...(streamInfo.initialMetadata?.acpPromptId != null |
| 1914 | ? { acpPromptId: streamInfo.initialMetadata.acpPromptId } |
| 1915 | : {}), |
| 1916 | } as StreamStartEvent); |
| 1917 | } |
| 1918 | |
| 1919 | private emitStreamAbort( |
| 1920 | workspaceId: WorkspaceId, |
no test coverage detected