Commit graph

23 commits

Author SHA1 Message Date
be190bd0a4 fix: Export mention handlers to window scope
- Export handleMentionInput, handleMentionKeydown, hideMentionDropdown to window object
- Fix chat-init.js to use window.handleMentionInput with proper checks
- Prevents ReferenceError when chat initializes
- Ensures suggestion buttons and switchers work correctly
2026-05-01 21:57:54 -03:00
d9e66e957c Fix: Escapar HTML para exibir como texto
- Remove lógica hasHtmlTags que injetava HTML cru
- Sempre usa escapeHtml para exibir conteúdo como texto
- Corrige problema de tags HTML aparecendo na página
2026-05-01 08:38:41 -03:00
73e0121d0b Fix: start.bas não executa e HTML truncado
- Remove streaming de chunks LLM, acumula resposta completa antes de enviar
- Corrige variável 'action' para 'actionData' no click handler de suggestions
- Adiciona fallback window.sendMessage() se WebSocket não estiver aberto
- Adiciona guard DOMContentLoaded no chat-init.js
- Adiciona cache-busting (?v=4) no chat.html

Impacto:
- start.bas executa corretamente ao conectar WebSocket
- HTML não é mais truncado (tags fecham corretamente)
- Sugestões executam tool invocations via WebSocket
2026-05-01 02:02:57 -03:00
b392d508c3 Fix HTML streaming: accumulate chunks and render only on is_complete
- botui/chat-messages.js: HTML chunks now accumulated without rendering,
  only showing loading indicator. When is_complete=true, full HTML
  rendered at once. Text/markdown continues streaming normally.
- botserver/mod.rs: Remove unused html_buffer variable
- drive_monitor/monitor.rs: Change CHECK_INTERVAL_SECS from 1 to 2
- CI workflow: Fix paths to use target/fast/ instead of target/debug/
  and target/release/
2026-04-30 22:21:46 -03:00
86d4bb4f26 fix: Show chat HTML only after WebSocket ready - Prevents handleMentionInput undefined error - Chat content hidden until WebSocket opens - Fixes SD issues between JS and HTML loading
All checks were successful
BotServer CI / build (push) Successful in 8m57s
2026-04-30 21:26:16 -03:00
91eb106567 feat: stabilize production HTML rendering and update CI/CD
Some checks failed
BotServer CI / build (push) Has been cancelled
- botserver: implemented tag-aware streaming to prevent broken HTML chunks
- botserver: disabled automatic HTML-to-Markdown conversion to preserve rich design
- botserver/llm: added Claude 3.7 thinking/reasoning support
- botui: fixed chat-messages.js to allow rich HTML rendering and stop tag stripping
- botui: updated CI/CD to build botui in release mode with embedded UI
2026-04-30 18:41:18 -03:00
2012f29324 fix: Strip HTML tags from XLSX content and frontend display
Some checks failed
BotServer CI / build (push) Failing after 7m9s
- Backend: Add strip_html_tags() function to remove HTML from XLSX cells
- Frontend: Strip HTML tags before displaying bot messages
- Prompt: Update PROMPT.md to instruct GPT not to show raw HTML

Fixes issue where XLSX cell content with HTML formatting
was being displayed as raw HTML tags in chat responses.
2026-04-30 14:15:12 -03:00
aeb567fb7f feat: optimize Salesianos bot with rich HTML, thinking strip, and updated deployment with backup
All checks were successful
BotServer CI / build (push) Successful in 51m13s
2026-04-30 09:50:03 -03:00
11ea023eec fix CI. 2026-04-28 13:36:07 -03:00
0911448548 feat: Add switcher toggle functionality
- Added SWITCHER_TOGGLE message type (8) for reprocessing last user message with active switchers
- Backend: Handler fetches last user question from DB, mutates message in-place, injects switcher prompts into system_prompt
- Backend: Switcher replays skip message_history save to avoid duplication
- Frontend: toggleSwitcher() sends SWITCHER_TOGGLE when input empty, sendMessage() when text present
- Frontend: Added TOOL_EXEC and SWITCHER_TOGGLE to MessageType constants
- Fixed session_id shadowing bug in DB query (used session_id_for_query)
- Preserves conversation history for LLM context when reprocessing with switchers
2026-04-26 16:36:03 -03:00
28c48eeabf feat: Split chat.html into modular JS modules for #495 switcher support
- Split partials/chat.html (1513→70 lines) into 8 JS modules:
  chat-state.js, chat-switchers.js, chat-mentions.js,
  chat-messages.js, chat-suggestions.js, chat-theme.js,
  chat-websocket.js, chat-init.js
- Centralized state in ChatState global object
- Switcher chips auto-activate on switch_context suggestion action
- active_switchers sent in every WS message payload
- Removed old chat-main.js (merged into modules)
- Split vibe.html into vibe/ module directory with CSS extraction
- Updated standalone chat/chat.html to use same modules
2026-04-25 07:03:26 -03:00
1bb96f1923 fix: Add switcher support to chat page - render switcher chips from BotResponse, auto-activate on switch_context suggestion click, include active_switchers in WS payload (#495)
All checks were successful
Botlib CI / build (push) Successful in 6s
BotServer CI / build (push) Successful in 3m11s
Bottest CI / build (push) Successful in 29s
BotUI CI / build (push) Successful in 1m30s
2026-04-24 18:17:29 -03:00
d453eef57d fix: Use event delegation for switcher clicks
All checks were successful
Botlib CI / build (push) Successful in 7s
BotServer / build (push) Successful in 3m56s
Bottest CI / build (push) Successful in 35s
BotUI CI / build (push) Successful in 45s
- Event listeners were lost when renderSwitchers() re-created DOM
- Now using event delegation on parent container
- Listener attached once, persists across re-renders
- Added logging to verify active_switchers payload

Fixes switcher toggle not persisting and LLM modifier not being sent.
2026-04-24 16:57:30 +00:00
2d715b2650 refactor: Split chat.html into modular JS files
All checks were successful
Botlib CI / build (push) Successful in 12s
Bottest CI / build (push) Successful in 32s
BotUI CI / build (push) Successful in 44s
- chat.html reduced from 1623 lines to 59 lines
- Created chat-switchers.js for switcher state management
- Created chat-messages.js for message rendering
- Created chat-main.js for initialization and coordination
- Added console logging to debug switcher toggle functionality
- Follows AGENTS.md 450-line limit rule
2026-04-24 16:22:08 +00:00
cf00a51245 feat: Separate switchers from suggestions - server-side prompt resolution
Some checks failed
Botlib CI / build (push) Successful in 22s
BotServer CI / build (push) Failing after 0s
Bottest CI / build (push) Successful in 31s
BotUI CI / build (push) Successful in 52s
- Add Switcher struct to botlib (id, label, prompt, color, icon)
- Separate Redis key switchers:{bot_id}:{session_id} from suggestions
- Server-side SWITCHER_PROMPT_MAP resolves prompts (not frontend)
- Frontend sends active_switchers array in USER WS message
- Remove SYSTEM message dispatch (type 7 deprecated)
- Remove hardcoded promptMap from chat.html
- Render switchers from BotResponse.switchers (backend-driven)
- Support custom switchers via ADD_SWITCHER keyword
- Filter switcher-type items from get_suggestions()
- Add switchers field to all BotResponse construction sites
2026-04-23 21:36:09 +00:00
7a5cbf9e8f fix(botui): dynamic switchers styling and custom prompt injection 2026-04-23 21:32:34 +00:00
42c22cfcab fix(botui): ensure heuristic switchers are correctly identified
All checks were successful
Botlib CI / build (push) Successful in 2s
BotServer CI / build (push) Successful in 2m19s
Bottest CI / build (push) Successful in 20s
BotUI CI / build (push) Successful in 20s
2026-04-22 22:56:10 -03:00
380ad10177 fix(botui): dynamic switchers styling and custom prompt injection
All checks were successful
Botlib CI / build (push) Successful in 5s
BotServer CI / build (push) Successful in 2m17s
Bottest CI / build (push) Successful in 26s
BotUI CI / build (push) Successful in 27s
2026-04-22 22:37:46 -03:00
b20544d1a0 Merge branch 'main' of github.com:generalbots/generalbots into main
Some checks failed
Botlib CI / build (push) Failing after 2s
Bottest CI / build (push) Failing after 1s
BotServer CI / build (push) Failing after 3m40s
BotUI CI / build (push) Failing after 22s
2026-04-22 21:31:52 -03:00
61c8f709c4 fix(stage): fix message type collision and switcher logic in chat ui 2026-04-22 21:30:26 -03:00
8069fbab28 fix(botui): improve HTML streaming rendering to avoid loading dots lock 2026-04-22 20:45:40 +00:00
c8a02b65be fix: HTML rendering in chat + improved PROMPT.md for ramal queries
All checks were successful
Botlib CI / build (push) Successful in 4s
BotServer CI / build (push) Successful in 23s
Bottest CI / build (push) Successful in 19s
BotUI CI / build (push) Successful in 26s
- Detect HTML content (starts with <) in streaming messages and
  bypass marked.parse() to render directly as innerHTML
- marked.parse() was corrupting the LLM's raw HTML output by
  treating it as Markdown (escaping tags, wrapping in <p>, etc.)
- Updated PROMPT.md for Salesianos to be more explicit about
  returning ramal data directly from KB context without asking
  for unnecessary clarification
- Fixed ramais.bas tool (removed invalid BEGIN/END syntax)
2026-04-22 20:15:21 +00:00
037db5c381 feat: Major workspace reorganization and documentation update
- Add comprehensive documentation in botbook/ with 12 chapters
- Add botapp/ Tauri desktop application
- Add botdevice/ IoT device support
- Add botlib/ shared library crate
- Add botmodels/ Python ML models service
- Add botplugin/ browser extension
- Add botserver/ reorganized server code
- Add bottemplates/ bot templates
- Add bottest/ integration tests
- Add botui/ web UI server
- Add CI/CD workflows in .forgejo/workflows/
- Add AGENTS.md and PROD.md documentation
- Add dependency management scripts (DEPENDENCIES.sh/ps1)
- Remove legacy src/ structure and migrations
- Clean up temporary and backup files
2026-04-19 08:14:25 -03:00