(args = {})
| 814 | // KnowledgeBaseItem fields confirmed from the official Windsurf 2.3.15 |
| 815 | // generated client: text=2, url=3, title=4, chunks=6, summary=7. |
| 816 | function buildKnowledgeBaseItem(args = {}) { |
| 817 | const text = typeof args.text === 'string' |
| 818 | ? args.text |
| 819 | : (typeof args.content === 'string' ? args.content : ''); |
| 820 | const summary = typeof args.summary === 'string' ? args.summary : ''; |
| 821 | const url = typeof args.url === 'string' ? args.url : ''; |
| 822 | const title = typeof args.title === 'string' ? args.title : ''; |
| 823 | const parts = []; |
| 824 | if (text) parts.push(writeStringField(2, text)); |
| 825 | if (url) parts.push(writeStringField(3, url)); |
| 826 | if (title) parts.push(writeStringField(4, title)); |
| 827 | if (summary) parts.push(writeStringField(7, summary)); |
| 828 | return Buffer.concat(parts); |
| 829 | } |
| 830 | |
| 831 | function buildReadUrlContentBody(args) { |
| 832 | const parts = []; |
no test coverage detected