Format for system prompt injection. Returns '' if nothing found.
()
| 45 | |
| 46 | /** Format for system prompt injection. Returns '' if nothing found. */ |
| 47 | formatForPrompt() { |
| 48 | const r = this.detect(); |
| 49 | if (!r) return ''; |
| 50 | const s = r.summary.length > this.maxChars |
| 51 | ? r.summary.slice(0, this.maxChars - 1) + '…' |
| 52 | : r.summary; |
| 53 | // Label as "Project" — caller may relabel as "Workspace context" to avoid |
| 54 | // models treating this as a complete project description. |
| 55 | return `\n\nProject: ${s}`; |
| 56 | } |
| 57 | |
| 58 | invalidate() { this._cache = null; } |
| 59 |