- Add null check for jsArgs to prevent potential nil pointer dereferences
- Refactor argument parsing logic to handle optional arguments more robustly
- Ensure safe conversion of JavaScript arguments to Go slice
- Enhance error handling for argument type conversion
- Implement comprehensive message formatting function
- Add filtering for duplicate messages
- Reorder messages to ensure proper system and user message placement
- Merge consecutive assistant messages
- Improve message preprocessing for API requests
- Introduce Result field in ResHookDone struct to support additional data
- Update NextAction.Execute method to pass optional callback arguments
- Modify streamChat method to propagate result data to output messages
- Add Result field to Message struct for flexible result storage
- Add support for passing additional arguments to callback functions
- Implement flexible argument parsing for JavaScript method calls
- Handle both array and single argument scenarios
- Update method signature to accommodate optional arguments
- Implement Assets method in Assistant struct to read asset files
- Add jsAssets function to JavaScript bridge for accessing assets
- Support optional data replacement in asset file content
- Enable dynamic asset retrieval with optional template data processing
- Refactor tool calls processing to handle multiple tool calls more robustly
- Add new message flags (IsBeginTool, IsEndTool) to track tool call stages
- Modify streaming logic to correctly wrap and manage tool call messages
- Ensure only the first tool call is fully processed and displayed
- Comment out assistant script loading in script package
- Enhance global variable error message with detailed type information
- Prepare for moving assistant script loading to a dedicated package
- Add nil checks for callbacks in message and object methods
- Enhance error logging in plan subscription with more descriptive messages
- Improve write method error handling with additional context logging
- Add safeguards against potential nil function calls
- Introduce new jsPlan function to script context initialization
- Extend InitObject method with Plan method for script interactions
- Enhance JavaScript bridge capabilities in assistant script contexts
- Update GlobalVariables struct to use more descriptive GinContext field
- Modify all references to Context to use GinContext in assistant methods
- Improve clarity of Gin context usage in JavaScript bridge functions
- Implement loading of assistant TypeScript index files
- Filter and load only src/index.ts files from assistants directory
- Generate unique IDs for assistant scripts using file path
- Extend application walk method to support assistant script loading
- Modify run method signature to include contents parameter
- Add SendMessage function to nested script context during execution
- Ensure consistent message sending capabilities across script levels
- Introduce optional callback mechanism for chat messages
- Modify Execute and streamChat methods to support callback functions
- Add support for process and script method callbacks
- Update message handling to trigger callbacks during chat streaming
- Enhance flexibility of assistant chat interactions with dynamic callbacks
- Introduce retry and silent mode flags in context and message structures
- Modify API and hooks to support new context modes
- Update message handling to propagate retry and silent flags
- Replace debug print statements with structured logging
- Enhance tool call and message processing with new context options
- Import github.com/sergi/go-diff library in go.mod and go.sum
- Add import for gou/diff package in main.go
- Prepare for potential diff-related functionality in the project
- Integrate jsonrepair library to improve JSON parsing resilience
- Replace manual JSON repair attempts with a more comprehensive repair method
- Update go.mod and go.sum to include jsonrepair dependency
- Simplify ParseJSON function with a single repair approach
- Update tool call prompts with more detailed schema and usage guidelines
- Add dynamic tool call examples based on available tools
- Modify message name generation to use assistant ID with underscores
- Improve system message formatting for tool calls
- Simplify tool call prompt generation logic
- Refactor tool call prompts with more detailed guidelines
- Improve message name handling for system and user messages
- Add robust JSON parsing utility with error recovery
- Update debug logging for request messages and tool calls
- Modify tool call extraction in HookDone method for better reliability
- Improve type safety when accessing Neo's assistant
- Use type assertion with ok check to handle potential nil or incorrect type
- Simplify assistant context retrieval in Xgen settings
- Include default assistant information in Xgen settings
- Retrieve assistant details from Neo when available
- Add agent configuration with assistant ID, name, avatar, and deleteable status
- Enhance Xgen settings to support assistant metadata
- Enhance chat API endpoints to include assistant information
- Add support for retrieving and displaying assistant details in chat responses
- Update database schema to store assistant_id in chat table
- Modify GetChats, GetChat, and SaveHistory methods to handle assistant metadata
- Improve test coverage for assistant-related chat functionality