MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / buildKnowledgeBaseItem

Function buildKnowledgeBaseItem

src/cascade-native-bridge.js:816–829  ·  view source on GitHub ↗
(args = {})

Source from the content-addressed store, hash-verified

814// KnowledgeBaseItem fields confirmed from the official Windsurf 2.3.15
815// generated client: text=2, url=3, title=4, chunks=6, summary=7.
816function 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
831function buildReadUrlContentBody(args) {
832 const parts = [];

Callers 1

buildReadUrlContentBodyFunction · 0.85

Calls 2

writeStringFieldFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected