🤖 Support multiline continue messages in /compact #255
+196
−22
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.
Overview
Refactor
/compactcommand to support multiline continue messages. Everything after the first line becomes the continue message, making it much more ergonomic than the old-c "message"syntax.Old syntax (still works for backwards compat):
New syntax:
Changes
Parser Infrastructure
rawInputfield toSlashCommandHandlerArgsto pass raw input with newlines preservedCompact Command Handler
-cflag if present (backwards compatibility)Tests
-tflag-cflag takes precedence (backwards compat)Documentation
docs/context-management.mdwith multiline syntax examplesdocs/prompting-tips.mdto show multiline usage-cflag from documented syntax (but it still works)Benefits
-cflag still works (just undocumented)Testing
Files Changed
src/utils/slashCommands/types.ts- Add rawInput to handler argssrc/utils/slashCommands/parser.ts- Pass rawInput to handlerssrc/utils/slashCommands/registry.ts- Update compact handlersrc/utils/slashCommands/compact.test.ts- Add multiline testsdocs/context-management.md- Update syntax and examplesdocs/prompting-tips.md- Update examplesNet change: +132 lines / -21 lines = +111 lines
Generated with
cmux