MCPcopy Create free account
hub / github.com/dailydotdev/apps / parseCommand

Function parseCommand

packages/shared/src/features/interests/commands.ts:66–73  ·  view source on GitHub ↗
(
  value: string,
)

Source from the content-addressed store, hash-verified

64};
65
66export const parseCommand = (
67 value: string,
68): { command: AgentCommand; args: string } | undefined => {
69 const match = /^\/([a-z-]+)(?:\s+([\s\S]*))?$/.exec(value.trim());
70 const command = match ? findCommand(match[1]) : undefined;
71
72 return command ? { command, args: (match?.[2] ?? '').trim() } : undefined;
73};

Callers 2

commands.spec.tsFile · 0.90
onSubmitFunction · 0.90

Calls 1

findCommandFunction · 0.85

Tested by

no test coverage detected