MCPcopy
hub / github.com/Dimillian/CodexMonitor / parseCommandSegment

Function parseCommandSegment

src/utils/threadItems.explore.ts:254–271  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

252}
253
254function parseCommandSegment(command: string): ExploreEntry[] | null {
255 const tokens = tokenizeCommand(command);
256 if (tokens.length === 0) {
257 return null;
258 }
259 const commandName = tokens[0].toLowerCase();
260 if (READ_COMMANDS.has(commandName)) {
261 return parseRead(tokens);
262 }
263 if (LIST_COMMANDS.has(commandName)) {
264 return [parseList(tokens)];
265 }
266 if (SEARCH_COMMANDS.has(commandName)) {
267 const entry = parseSearch(tokens);
268 return entry ? [entry] : null;
269 }
270 return null;
271}
272
273function coalesceReadEntries(entries: ExploreEntry[]) {
274 const result: ExploreEntry[] = [];

Callers 1

Calls 4

tokenizeCommandFunction · 0.85
parseReadFunction · 0.85
parseListFunction · 0.85
parseSearchFunction · 0.85

Tested by

no test coverage detected