(
prompts: RuntimePrompts,
protectedToolsExtension?: string,
manual?: boolean,
subagent?: boolean,
)
| 2 | export type { PromptStore, RuntimePrompts } from "./store" |
| 3 | |
| 4 | export function renderSystemPrompt( |
| 5 | prompts: RuntimePrompts, |
| 6 | protectedToolsExtension?: string, |
| 7 | manual?: boolean, |
| 8 | subagent?: boolean, |
| 9 | ): string { |
| 10 | const extensions: string[] = [] |
| 11 | |
| 12 | if (protectedToolsExtension) { |
| 13 | extensions.push(protectedToolsExtension.trim()) |
| 14 | } |
| 15 | |
| 16 | if (manual) { |
| 17 | extensions.push(prompts.manualExtension.trim()) |
| 18 | } |
| 19 | |
| 20 | if (subagent) { |
| 21 | extensions.push(prompts.subagentExtension.trim()) |
| 22 | } |
| 23 | |
| 24 | return [prompts.system.trim(), ...extensions] |
| 25 | .filter(Boolean) |
| 26 | .join("\n\n") |
| 27 | .replace(/\n([ \t]*\n)+/g, "\n\n") |
| 28 | .trim() |
| 29 | } |
no outgoing calls
no test coverage detected