MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / renderSystemPrompt

Function renderSystemPrompt

lib/prompts/index.ts:4–29  ·  view source on GitHub ↗
(
    prompts: RuntimePrompts,
    protectedToolsExtension?: string,
    manual?: boolean,
    subagent?: boolean,
)

Source from the content-addressed store, hash-verified

2export type { PromptStore, RuntimePrompts } from "./store"
3
4export 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}

Callers 2

print.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected