import { CancellationToken } from "../../../../../../base/common/cancellation.js"; import { Event } from "../../../../../../base/common/event.js"; import { Disposable } from "../../../../../../base/common/lifecycle.js"; import { IByokLmChatRequest, IByokLmChatResult, IByokLmModelInfo } from "../../../../../../platform/agentHost/common/agentHostByokLm.js"; import { IAgentHostByokLmHandler } from "../../../../../../platform/agentHost/common/agentHostByokLm.service.js"; import { IContextKeyService } from "../../../../../../platform/contextkey/common/contextkey.service.js"; import { ILogService } from "../../../../../../platform/log/common/log.service.js"; import { IChatEntitlementService } from "../../../../../services/chat/common/chatEntitlementService.service.js"; import { ILanguageModelsService } from "../../../common/languageModels.service.js"; /** * Renderer-side {@link IAgentHostByokLmHandler}. Services BYOK chat requests * forwarded by the node agent host's OpenAI proxy by calling the VS Code LM * API for the matching extension-registered model. * * The bridge DTOs are plain/serializable; this class is the single place that * translates them to and from the `workbench/contrib/chat` LM types. */ export declare class AgentHostByokLmHandler extends Disposable implements IAgentHostByokLmHandler { private readonly _languageModelsService; private readonly _logService; private readonly _chatEntitlementService; readonly _serviceBrand: undefined; private readonly _onDidChangeModels; /** Fires when the renderer's BYOK models change, so the node agent host re-enumerates. */ readonly onDidChangeModels: Event; constructor(_languageModelsService: ILanguageModelsService, _logService: ILogService, _chatEntitlementService: IChatEntitlementService, contextKeyService: IContextKeyService); chat(request: IByokLmChatRequest, token: CancellationToken): Promise; listModels(_token: CancellationToken): Promise; /** * Find the LM API identifier for a BYOK model addressed by its vendor and * provider-local id (the `provider/id` selection id the picker surfaced). */ private _resolveModelIdentifier; private _toChatMessages; private _toChatMessage; private _toChatMessageParts; private _toChatImageMimeType; private _appendTextOutput; private _appendReasoningOutput; private _mergeReasoningSummary; private _encodeReasoningMetadata; private _decodeReasoningMetadata; private _customToolInput; private _decodeStatefulMarker; private _decodeUsage; private _numberProperty; private _stringMetadata; private _toChatRole; private _safeParseJson; }