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

Function toEditablePromptText

lib/prompts/store.ts:239–255  ·  view source on GitHub ↗
(definition: PromptDefinition, rawContent: string)

Source from the content-addressed store, hash-verified

237}
238
239function toEditablePromptText(definition: PromptDefinition, rawContent: string): string {
240 let normalized = stripPromptComments(rawContent).trim()
241 if (!normalized) {
242 return ""
243 }
244
245 if (definition.key === "system") {
246 normalized = stripConditionalTag(normalized, "manual")
247 normalized = stripConditionalTag(normalized, "subagent")
248 }
249
250 if (definition.key !== "compress-range" && definition.key !== "compress-message") {
251 normalized = normalizeReminderPromptContent(normalized)
252 }
253
254 return normalized.trim()
255}
256
257function wrapRuntimePromptContent(definition: PromptDefinition, editableText: string): string {
258 const trimmed = editableText.trim()

Callers 2

reloadMethod · 0.85
ensureDefaultFilesMethod · 0.85

Calls 3

stripPromptCommentsFunction · 0.85
stripConditionalTagFunction · 0.85

Tested by

no test coverage detected