MCPcopy Create free account
hub / github.com/tiann/hapi / parseCodexSpecialCommand

Function parseCodexSpecialCommand

cli/src/codex/codexSpecialCommands.ts:6–29  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

4 | { type: null };
5
6export function parseCodexSpecialCommand(message: string): CodexSpecialCommand {
7 const trimmed = message.trim();
8 if (trimmed === '/clear') {
9 return { type: 'clear' };
10 }
11 if (trimmed === '/compact') {
12 return { type: 'compact' };
13 }
14 if (trimmed.startsWith('/clear ')) {
15 return {
16 type: 'invalid',
17 command: 'clear',
18 message: '/clear does not accept arguments'
19 };
20 }
21 if (trimmed.startsWith('/compact ')) {
22 return {
23 type: 'invalid',
24 command: 'compact',
25 message: '/compact does not accept arguments'
26 };
27 }
28 return { type: null };
29}

Callers 3

handleSpecialCommandMethod · 0.90
runCodexFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected