feat(parser): return ambiguous variant when noun matches multiple aliases

Replaces the previous behavior of returning unknown-noun. The dispatcher
will use this in the next commit to prompt the player to disambiguate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 13:53:38 -05:00
parent b325f04b02
commit 46f851bc3a
3 changed files with 46 additions and 11 deletions
+1
View File
@@ -24,6 +24,7 @@ export type ParsedCommand =
| { kind: 'verb-only'; verb: Verb | 'look' | 'inventory' | 'wait' }
| { kind: 'verb-target'; verb: Verb; target: NounRef }
| { kind: 'verb-target-prep'; verb: Verb; target: NounRef; preposition: string; indirect: NounRef }
| { kind: 'ambiguous'; verb: Verb; rawNoun: string; candidates: string[] }
| { kind: 'go'; direction: Direction }
| { kind: 'meta'; verb: MetaVerb }
| { kind: 'disambiguation'; chosen: string }