-
Notifications
You must be signed in to change notification settings - Fork 85
Add enhanced CLI console with debug logging and grammar result display #1886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add terminalUI module with EnhancedSpinner, TerminalLayout, InputBox, CompletionMenu classes - EnhancedSpinner supports output-above-spinner pattern and streaming text - InputBox provides bordered input areas with emoji-aware width handling - CompletionMenu adds trigger-based autocompletion (@ for agents, / for commands) - Add ESM module support and string-width dependency for Unicode handling - Include demo script and design documentation Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add --testUI flag to CLI interactive command for enhanced terminal UI - Convert debug output to use 'debug' npm package across grammar/cache modules - Restore async grammar generation mode (fire-and-forget) for faster command responses - Add grammar result display when new rules are added to cache - Fix terminal input double-echo and cursor position issues - Fix prompt bracket overlap with emoji icons Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Fix manifest grammarFile paths to be manifest-relative (for patchPaths resolution) - Add NFA type extraction in AgentGrammar.validateEntityReferences to allow generated rules to reference types like TrackName, ArtistName from base grammar - Remove diagnostic console.log statements, keep debug() logging Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add single console.log showing generated rule or rejection reason - Remove verbose startup logging from setupGrammarGeneration - Keep debug() logging for detailed tracing when needed Co-Authored-By: Claude Opus 4.5 <[email protected]>
Include the generated rule in rejection messages to help diagnose entity validation failures and other rule addition errors. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Call registerBuiltInEntities() in setupGrammarGeneration to register Ordinal, Cardinal, CalendarDate converters - Make entity registry check case-insensitive (ordinal matches Ordinal) - Include generated rule in rejection messages for debugging Co-Authored-By: Claude Opus 4.5 <[email protected]>
…itive matching - Revert case-insensitive entity validation (too dangerous for all symbols) - Register lowercase aliases (ordinal, cardinal, calendarDate) alongside PascalCase versions to match paramSpec convention from .pas.json schemas Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Use ClientIO notify for grammar rule notifications instead of console.log - Log grammar notifications to ~/.typeagent/grammar.log in CLI - Suppress startup agent errors (use debug logging instead of error notifications) - Fix entityWildcardPropertyNames: exclude basic wildcard types (wildcard, word, number, string) from being treated as entity wildcards The entity wildcard fix resolves the smoke test failure where $(listName:wildcard) was incorrectly added to entityWildcardPropertyNames, causing "Invalid entity wildcard property name" errors. Co-Authored-By: Claude Opus 4.5 <[email protected]>
The first getList rule was too greedy - "what's on the shopping list?" was matching with wildcard capturing "on the shopping" instead of just "shopping". Added a more specific rule for "what's on (my)? $(listName) (list)?" that takes precedence over the generic pattern. Co-Authored-By: Claude Opus 4.5 <[email protected]>
…rminal rendering - Fix smoke test failure: "what's on the shopping list" was parsing "the shopping" as list name instead of "shopping" - added (the)? as optional article in grammar rules - Add marked and marked-terminal dependencies for CLI markdown rendering - Add convertMarkdownToTerminal function for styled terminal markdown output - Enhance HTML-to-text conversion with better formatting for track lists - Support DisplayType "markdown" in CLI content rendering Co-Authored-By: Claude Opus 4.5 <[email protected]>
Actions like pause, resume, next, previous, status don't have parameters
in their schema. The evaluators in dfaMatcher.ts and environment.ts were
always adding `parameters: {}` which caused validation to fail with:
"Action schema parameter type mismatch: player.pause"
Now only include parameters if there are any to include.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add grammar rules for: - next -> nextTrack - skip -> nextTrack - skip track -> nextTrack Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Remove custom selectors using invalid format names (orderedList, unorderedList, listItem, dataTable) that caused "format is not a function" errors. Use only valid built-in formats (block, inline, skip). Co-Authored-By: Claude Opus 4.5 <[email protected]>
The rule (what's)? (show)? (me)? (the)? (my)? $(listName:wildcard) list could match with ALL optionals empty, becoming just $(listName:wildcard) list which captured everything before "list" as the list name. Split into specific rules that each require at least one fixed word: - what's (the)? (my)? $(listName:wildcard) list - show (me)? (the)? $(listName:wildcard) list - the $(listName:wildcard) list - my $(listName:wildcard) list This prevents "add bread, milk, flour to the shopping list" from being incorrectly parsed as getList with listName="add bread, milk, flour to the shopping" Co-Authored-By: Claude Opus 4.5 <[email protected]>
Fix issue where "list?" wouldn't match "list" in grammar rules. Also adds local test file for faster grammar testing. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace regex-based punctuation stripping with a simple loop that runs in O(n) time where n is the number of trailing punctuation chars. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
--testUIflag to CLI interactive command for enhanced terminal UI with spinners and visual promptsdebugnpm package (controlled viaDEBUG=typeagent:*env var)Test plan
node packages/cli/bin/run.js interactive --testUIand verify enhanced UI displays correctly[Grammar]messages--testUIto verify standard console still worksDEBUG=typeagent:cacheto verify debug logging works🤖 Generated with Claude Code