MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / parseSlashCommand

Function parseSlashCommand

src/core/command_parser.ts:7–26  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

5}
6
7export function parseSlashCommand(text: string): ParsedSlashCommand | null {
8 const raw = text.trim();
9 if (!raw.startsWith('/')) {
10 return null;
11 }
12 const body = raw.slice(1).trim();
13 if (!body) {
14 return null;
15 }
16 const [namePart, ...argParts] = body.split(/\s+/u);
17 const name = namePart.trim().toLowerCase();
18 if (!name) {
19 return null;
20 }
21 return {
22 name,
23 args: argParts,
24 raw,
25 };
26}
27

Callers 5

dispatchInboundEventMethod · 0.85
scheduleInboundEventMethod · 0.85
shouldDelayInboundEventFunction · 0.85
collapseRestartEventsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected