MCPcopy Create free account
hub / github.com/SethGammon/Citadel / parseHandoff

Function parseHandoff

core/fleet/parse-handoff.js:3–15  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

1'use strict';
2
3function parseHandoff(text) {
4 const match = text.match(/---\s*HANDOFF\s*---\s*\n([\s\S]*?)(?:\n---|\Z)/i);
5 if (!match) {
6 return { found: false, items: [], raw: '' };
7 }
8
9 const raw = match[1].trim();
10 const items = raw.split('\n')
11 .map(line => line.replace(/^[-*]\s*/, '').trim())
12 .filter(Boolean);
13
14 return { found: true, items, raw };
15}
16
17module.exports = {
18 parseHandoff,

Callers 3

compressDiscoveryFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected