import { h as __exportAll } from "./pi-embedded-utils-Dx4_ysu7.js";
import { i as resolveEffectiveMessagesConfig, o as resolveIdentityName, t as extractShortModelName } from "./response-prefix-template-PxzkOxGr.js";

//#region src/channels/reply-prefix.ts
var reply_prefix_exports = /* @__PURE__ */ __exportAll({
	createReplyPrefixContext: () => createReplyPrefixContext,
	createReplyPrefixOptions: () => createReplyPrefixOptions
});
function createReplyPrefixContext(params) {
	const { cfg, agentId } = params;
	const prefixContext = { identityName: resolveIdentityName(cfg, agentId) };
	const onModelSelected = (ctx) => {
		prefixContext.provider = ctx.provider;
		prefixContext.model = extractShortModelName(ctx.model);
		prefixContext.modelFull = `${ctx.provider}/${ctx.model}`;
		prefixContext.thinkingLevel = ctx.thinkLevel ?? "off";
	};
	return {
		prefixContext,
		responsePrefix: resolveEffectiveMessagesConfig(cfg, agentId, {
			channel: params.channel,
			accountId: params.accountId
		}).responsePrefix,
		responsePrefixContextProvider: () => prefixContext,
		onModelSelected
	};
}
function createReplyPrefixOptions(params) {
	const { responsePrefix, responsePrefixContextProvider, onModelSelected } = createReplyPrefixContext(params);
	return {
		responsePrefix,
		responsePrefixContextProvider,
		onModelSelected
	};
}

//#endregion
export { reply_prefix_exports as n, createReplyPrefixOptions as t };