This commit introduces the `doImport` function, which allows importing
the content of a file directly into the "auto" chat session.
The imported content is added as a `ChatEntry` from GEMINI, structured
as a `ToolCall` with the name "Shell" and the file content as the input.
This allows external command outputs to be seamlessly integrated into
the chat history for context.
- Refactor the 'printCodeSnippet' function to draw a complete,
correctly padded box around the code.
- Each line is now padded with spaces to ensure the right border
aligns perfectly at the terminal width.
- Fix a bug where the format string for the right-aligned prefix
was being printed literally instead of being evaluated.
- The user message prefix now displays the timestamp and author
correctly.
- Refactor the 'printRightAligned' function to print the author
prefix line *before* the content.
- This fixes a bug where the prefix was incorrectly appearing after
the message body.
- Refactor the 'printContent' function to align user messages to
the right side of the terminal.
- Gemini messages remain left-aligned.
- This provides a clearer visual distinction in the conversation flow.
- Refactor the word-wrapping algorithm in 'printContent' to
ensure every line of conversational text is correctly
prepended with a tab character.
- This fixes the issue where only the first line of a wrapped
paragraph was being indented.
- Refactor the 'printContent' function to provide a cleaner layout.
- The author and timestamp prefix now appear on their own line.
- All subsequent lines of content are indented with a standard tab
and wrapped correctly to the terminal width.
- Add a new 'printContent' function to handle word wrapping for the
main conversational text in the detailed playback view.
- This ensures that long lines of text are correctly wrapped to the
terminal width, improving readability.
- Implement a new 'listEntries' function that provides a one-line
summary for each entry within a chat topic.
- The 'showChat' function (triggered by 'playback --uuid') now
calls this new summary view.
- Implement a new 'listEntries' function that provides a one-line
summary for each entry within a chat topic.
- The 'showChat' function (triggered by 'playback --uuid') now
calls this new summary view instead of the full rich format.
- Update the main command loop to correctly parse and pass the
'--uuid' flag to the showChat function.
- This fixes the 'invalid subcommand' error and makes the detailed
playback view fully functional.
- Move all file reading and content-inlining logic into a new
'addFile' function in its own 'add.go' file.
- The main function now calls this to parse a log file and then
appends the returned chats to the main session.
- This improves separation of concerns and makes the main loop cleaner.
- Refactor the prettyFormat.go functions to render all content
directly from the 'Content' fields of the protobuf messages.
- Remove all 'os.ReadFile' calls from the formatting logic.
- This ensures the 'playback' command is self-contained and works
correctly on saved protobuf data where the original content files
are no longer available.
- Create a new prettyFormat.go file to contain all the detailed
log formatting and printing logic.
- Simplify doPlayback.go to handle the summary view and call out
to the new prettyFormatChat function for detailed views.
- This separation of concerns makes the code cleaner and fixes
compilation errors related to redeclared functions.