MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / findAtToken

Function findAtToken

src/ui/components/InputBox.tsx:41–46  ·  view source on GitHub ↗

The `@token` being typed at the cursor, if any.

(value: string, cursor: number)

Source from the content-addressed store, hash-verified

39
40/** The `@token` being typed at the cursor, if any. */
41function findAtToken(value: string, cursor: number): { query: string; start: number } | null {
42 const before = value.slice(0, cursor)
43 const match = /(?:^|\s)@([^\s@]*)$/.exec(before)
44 if (!match) return null
45 return { query: match[1], start: cursor - match[1].length - 1 }
46}
47
48export function InputBox({ active, slashCommands, onSubmit }: InputBoxProps) {
49 const [value, setValue] = useState("")

Callers 1

InputBoxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected