UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

23 lines • 1.08 kB
import { SettingsManager } from "../../../settings-manager.js"; import { presetSharedSections } from "./contract.js"; import { resolvePresetName } from "./presets.js"; import { loadPromptPresetSettings } from "./settings.js"; /** * The preset this extension renders for `model` (default: the context's model), or undefined when none * applies: no model, or a user system prompt (--system-prompt / SDK loader override) outranks presets. */ export function resolveActivePresetName(ctx, model = ctx.model) { if (!model) return undefined; if (ctx.getSystemPromptOptions?.()?.customPrompt) return undefined; return resolvePresetName(model, loadPromptPresetSettings(SettingsManager.create(ctx.cwd))); } /** * The shared-section wording of the active preset (senpi#5665), for extensions that append their own * shared prompt text after the preset renders (terminal, todotools, websearch, bash-timeout). */ export function activeSharedSections(ctx) { return presetSharedSections(resolveActivePresetName(ctx)); } //# sourceMappingURL=active-preset.js.map