MCPcopy Index your code
hub / github.com/Doorman11991/smallcode / getPluginPrompts

Function getPluginPrompts

bin/smallcode.js:2111–2125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2109// Get plugin prompt injections for the current task type
2110// Fix #17: Cap plugin injection to ~500 tokens (2000 chars).
2111function getPluginPrompts() {
2112 if (!pluginLoader) return '';
2113 try {
2114 const injection = pluginLoader.getPromptInjections(currentTaskType);
2115 if (!injection) return '';
2116 // Hard cap: a single misconfigured plugin with 10k content shouldn't
2117 // blow up the system prompt.
2118 const capped = injection.length > 2000
2119 ? injection.slice(0, 2000) + '\n... (plugin prompts truncated)'
2120 : injection;
2121 return '\n\n' + capped;
2122 } catch {
2123 return '';
2124 }
2125}
2126
2127// Make a chat completion request (non-streaming for tool use, streaming for final response)
2128async function chatCompletion(config, messages) {

Callers 1

buildCompactSystemPromptFunction · 0.70

Calls 1

getPromptInjectionsMethod · 0.80

Tested by

no test coverage detected