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

Function parseRawResponse

src/windsurf.js:240–255  ·  view source on GitHub ↗
(buf)

Source from the content-addressed store, hash-verified

238 * RawChatMessage { ..., string text = 5, bool in_progress = 6, bool is_error = 7 }
239 */
240export function parseRawResponse(buf) {
241 const fields = parseFields(buf);
242 const f1 = getField(fields, 1, 2); // delta_message
243 if (!f1) return { text: '' };
244
245 const inner = parseFields(f1.value);
246 const text = getField(inner, 5, 2);
247 const inProgress = getField(inner, 6, 0);
248 const isError = getField(inner, 7, 0);
249
250 return {
251 text: text ? text.value.toString('utf8') : '',
252 inProgress: inProgress ? !!inProgress.value : false,
253 isError: isError ? !!isError.value : false,
254 };
255}
256
257// ─── Panel initialization ─────────────────────────────────
258

Callers 1

rawGetChatMessageMethod · 0.90

Calls 2

parseFieldsFunction · 0.90
getFieldFunction · 0.90

Tested by

no test coverage detected