botserver/src/basic/keywords/mod.rs

388 lines
11 KiB
Rust
Raw Normal View History

pub mod a2a_protocol;
pub mod add_bot;
2025-11-22 01:27:29 -03:00
pub mod add_member;
`@media (prefers-color-scheme: dark)` - ✅ Enhanced accessibility features (focus states, reduced motion) - ✅ Added connection status component styles - ✅ Improved responsive design - ✅ Added utility classes for common patterns - ✅ Added semantic HTML5 elements (`<header>`, `<main>`, `<nav>`) - ✅ Comprehensive ARIA labels and roles for accessibility - ✅ Keyboard navigation support (Alt+1-4 for sections, Esc for menus) - ✅ Better event handling and state management - ✅ Theme change subscriber with meta theme-color sync - ✅ Online/offline connection monitoring - ✅ Enhanced console logging with app info - ✅ `THEMES.md` (400+ lines) - Complete theme system guide - ✅ `README.md` (433+ lines) - Main application documentation - ✅ `COMPONENTS.md` (773+ lines) - UI component library reference - ✅ `QUICKSTART.md` (359+ lines) - Quick start guide for developers - ✅ `REBUILD_NOTES.md` - This summary document **Theme files define base colors:** ```css :root { --primary: 217 91% 60%; /* HSL: blue */ --background: 0 0% 100%; /* HSL: white */ } ``` **App.css bridges to working variables:** ```css :root { --accent-color: hsl(var(--primary)); --primary-bg: hsl(var(--background)); --accent-light: hsla(var(--primary) / 0.1); } ``` **Components use working variables:** ```css .button { background: var(--accent-color); color: hsl(var(--primary-foreground)); } ``` - ✅ Keyboard shortcuts (Alt+1-4, Esc) - ✅ System dark mode detection - ✅ Theme change event subscription - ✅ Automatic document title updates - ✅ Meta theme-color synchronization - ✅ Enhanced console logging - ✅ Better error handling - ✅ Improved accessibility - ✅ Theme switching via dropdown - ✅ Theme persistence to localStorage - ✅ Apps menu with section switching - ✅ Dynamic section loading (Chat, Drive, Tasks, Mail) - ✅ WebSocket chat functionality - ✅ Alpine.js integration for other modules - ✅ Responsive design - ✅ Loading states - [x] Theme switching works across all 19 themes - [x] All sections load correctly - [x] Keyboard shortcuts functional - [x] Responsive on mobile/tablet/desktop - [x] Accessibility features working - [x] No console errors - [x] Theme persistence works - [x] Dark mode detection works ``` documentation/ ├── README.md # Main docs - start here ├── QUICKSTART.md # 5-minute guide ├── THEMES.md # Theme system details ├── COMPONENTS.md # UI component library └── REBUILD_NOTES.md # This summary ``` 1. **HSL Bridge System**: Allows theme files to use shadcn-style HSL variables while the app automatically derives working CSS properties 2. **No Breaking Changes**: All existing functionality preserved and enhanced 3. **Developer-Friendly**: Comprehensive documentation for customization 4. **Accessibility First**: ARIA labels, keyboard navigation, focus management 5. **Performance Optimized**: Instant theme switching, minimal reflows - **Rebuild**: ✅ Complete - **Testing**: ✅ Passed - **Documentation**: ✅ Complete - **Production Ready**: ✅ Yes The rebuild successfully integrates the theme system throughout the UI while maintaining all functionality and adding comprehensive documentation for future development.
2025-11-21 09:28:02 -03:00
pub mod add_suggestion;
pub mod agent_reflection;
pub mod ai_tools;
pub mod api_tool_generator;
pub mod arrays;
pub mod auto_task;
pub mod autotask_api;
2025-11-22 01:27:29 -03:00
pub mod book;
pub mod bot_memory;
`@media (prefers-color-scheme: dark)` - ✅ Enhanced accessibility features (focus states, reduced motion) - ✅ Added connection status component styles - ✅ Improved responsive design - ✅ Added utility classes for common patterns - ✅ Added semantic HTML5 elements (`<header>`, `<main>`, `<nav>`) - ✅ Comprehensive ARIA labels and roles for accessibility - ✅ Keyboard navigation support (Alt+1-4 for sections, Esc for menus) - ✅ Better event handling and state management - ✅ Theme change subscriber with meta theme-color sync - ✅ Online/offline connection monitoring - ✅ Enhanced console logging with app info - ✅ `THEMES.md` (400+ lines) - Complete theme system guide - ✅ `README.md` (433+ lines) - Main application documentation - ✅ `COMPONENTS.md` (773+ lines) - UI component library reference - ✅ `QUICKSTART.md` (359+ lines) - Quick start guide for developers - ✅ `REBUILD_NOTES.md` - This summary document **Theme files define base colors:** ```css :root { --primary: 217 91% 60%; /* HSL: blue */ --background: 0 0% 100%; /* HSL: white */ } ``` **App.css bridges to working variables:** ```css :root { --accent-color: hsl(var(--primary)); --primary-bg: hsl(var(--background)); --accent-light: hsla(var(--primary) / 0.1); } ``` **Components use working variables:** ```css .button { background: var(--accent-color); color: hsl(var(--primary-foreground)); } ``` - ✅ Keyboard shortcuts (Alt+1-4, Esc) - ✅ System dark mode detection - ✅ Theme change event subscription - ✅ Automatic document title updates - ✅ Meta theme-color synchronization - ✅ Enhanced console logging - ✅ Better error handling - ✅ Improved accessibility - ✅ Theme switching via dropdown - ✅ Theme persistence to localStorage - ✅ Apps menu with section switching - ✅ Dynamic section loading (Chat, Drive, Tasks, Mail) - ✅ WebSocket chat functionality - ✅ Alpine.js integration for other modules - ✅ Responsive design - ✅ Loading states - [x] Theme switching works across all 19 themes - [x] All sections load correctly - [x] Keyboard shortcuts functional - [x] Responsive on mobile/tablet/desktop - [x] Accessibility features working - [x] No console errors - [x] Theme persistence works - [x] Dark mode detection works ``` documentation/ ├── README.md # Main docs - start here ├── QUICKSTART.md # 5-minute guide ├── THEMES.md # Theme system details ├── COMPONENTS.md # UI component library └── REBUILD_NOTES.md # This summary ``` 1. **HSL Bridge System**: Allows theme files to use shadcn-style HSL variables while the app automatically derives working CSS properties 2. **No Breaking Changes**: All existing functionality preserved and enhanced 3. **Developer-Friendly**: Comprehensive documentation for customization 4. **Accessibility First**: ARIA labels, keyboard navigation, focus management 5. **Performance Optimized**: Instant theme switching, minimal reflows - **Rebuild**: ✅ Complete - **Testing**: ✅ Passed - **Documentation**: ✅ Complete - **Production Ready**: ✅ Yes The rebuild successfully integrates the theme system throughout the UI while maintaining all functionality and adding comprehensive documentation for future development.
2025-11-21 09:28:02 -03:00
pub mod clear_kb;
2025-10-18 18:19:08 -03:00
pub mod clear_tools;
pub mod code_sandbox;
pub mod core_functions;
2025-11-22 01:27:29 -03:00
pub mod create_draft;
2025-10-06 10:30:17 -03:00
pub mod create_site;
2025-11-22 01:27:29 -03:00
pub mod create_task;
pub mod crm;
pub mod data_operations;
pub mod datetime;
pub mod episodic_memory;
pub mod errors;
pub mod file_operations;
2025-10-06 10:30:17 -03:00
pub mod find;
pub mod first;
pub mod for_next;
2025-10-07 10:53:09 -03:00
pub mod format;
2025-10-06 10:30:17 -03:00
pub mod get;
2025-10-11 12:29:03 -03:00
pub mod hear_talk;
pub mod http_operations;
pub mod human_approval;
pub mod import_export;
pub mod intent_compiler;
pub mod kb_statistics;
pub mod knowledge_graph;
2025-10-07 10:53:09 -03:00
pub mod last;
pub mod lead_scoring;
2025-10-06 10:30:17 -03:00
pub mod llm_keyword;
pub mod llm_macros;
pub mod math;
pub mod mcp_client;
pub mod mcp_directory;
pub mod messaging;
pub mod model_routing;
pub mod multimodal;
2025-10-06 10:30:17 -03:00
pub mod on;
pub mod on_form_submit;
pub mod play;
2025-10-06 10:30:17 -03:00
pub mod print;
pub mod procedures;
pub mod qrcode;
2025-11-22 01:27:29 -03:00
pub mod remember;
pub mod safety_layer;
2025-11-22 01:27:29 -03:00
pub mod save_from_unstructured;
pub mod send_mail;
pub mod send_template;
2025-10-06 10:30:17 -03:00
pub mod set;
`@media (prefers-color-scheme: dark)` - ✅ Enhanced accessibility features (focus states, reduced motion) - ✅ Added connection status component styles - ✅ Improved responsive design - ✅ Added utility classes for common patterns - ✅ Added semantic HTML5 elements (`<header>`, `<main>`, `<nav>`) - ✅ Comprehensive ARIA labels and roles for accessibility - ✅ Keyboard navigation support (Alt+1-4 for sections, Esc for menus) - ✅ Better event handling and state management - ✅ Theme change subscriber with meta theme-color sync - ✅ Online/offline connection monitoring - ✅ Enhanced console logging with app info - ✅ `THEMES.md` (400+ lines) - Complete theme system guide - ✅ `README.md` (433+ lines) - Main application documentation - ✅ `COMPONENTS.md` (773+ lines) - UI component library reference - ✅ `QUICKSTART.md` (359+ lines) - Quick start guide for developers - ✅ `REBUILD_NOTES.md` - This summary document **Theme files define base colors:** ```css :root { --primary: 217 91% 60%; /* HSL: blue */ --background: 0 0% 100%; /* HSL: white */ } ``` **App.css bridges to working variables:** ```css :root { --accent-color: hsl(var(--primary)); --primary-bg: hsl(var(--background)); --accent-light: hsla(var(--primary) / 0.1); } ``` **Components use working variables:** ```css .button { background: var(--accent-color); color: hsl(var(--primary-foreground)); } ``` - ✅ Keyboard shortcuts (Alt+1-4, Esc) - ✅ System dark mode detection - ✅ Theme change event subscription - ✅ Automatic document title updates - ✅ Meta theme-color synchronization - ✅ Enhanced console logging - ✅ Better error handling - ✅ Improved accessibility - ✅ Theme switching via dropdown - ✅ Theme persistence to localStorage - ✅ Apps menu with section switching - ✅ Dynamic section loading (Chat, Drive, Tasks, Mail) - ✅ WebSocket chat functionality - ✅ Alpine.js integration for other modules - ✅ Responsive design - ✅ Loading states - [x] Theme switching works across all 19 themes - [x] All sections load correctly - [x] Keyboard shortcuts functional - [x] Responsive on mobile/tablet/desktop - [x] Accessibility features working - [x] No console errors - [x] Theme persistence works - [x] Dark mode detection works ``` documentation/ ├── README.md # Main docs - start here ├── QUICKSTART.md # 5-minute guide ├── THEMES.md # Theme system details ├── COMPONENTS.md # UI component library └── REBUILD_NOTES.md # This summary ``` 1. **HSL Bridge System**: Allows theme files to use shadcn-style HSL variables while the app automatically derives working CSS properties 2. **No Breaking Changes**: All existing functionality preserved and enhanced 3. **Developer-Friendly**: Comprehensive documentation for customization 4. **Accessibility First**: ARIA labels, keyboard navigation, focus management 5. **Performance Optimized**: Instant theme switching, minimal reflows - **Rebuild**: ✅ Complete - **Testing**: ✅ Passed - **Documentation**: ✅ Complete - **Production Ready**: ✅ Yes The rebuild successfully integrates the theme system throughout the UI while maintaining all functionality and adding comprehensive documentation for future development.
2025-11-21 09:28:02 -03:00
pub mod set_context;
pub mod set_schedule;
pub mod set_user;
pub mod sms;
pub mod social;
pub mod social_media;
pub mod string_functions;
pub mod switch_case;
pub mod table_definition;
pub mod transfer_to_human;
2025-11-22 01:27:29 -03:00
pub mod universal_messaging;
2025-11-21 23:23:53 -03:00
pub mod use_kb;
pub mod use_tool;
pub mod use_website;
pub mod user_memory;
pub mod validation;
`@media (prefers-color-scheme: dark)` - ✅ Enhanced accessibility features (focus states, reduced motion) - ✅ Added connection status component styles - ✅ Improved responsive design - ✅ Added utility classes for common patterns - ✅ Added semantic HTML5 elements (`<header>`, `<main>`, `<nav>`) - ✅ Comprehensive ARIA labels and roles for accessibility - ✅ Keyboard navigation support (Alt+1-4 for sections, Esc for menus) - ✅ Better event handling and state management - ✅ Theme change subscriber with meta theme-color sync - ✅ Online/offline connection monitoring - ✅ Enhanced console logging with app info - ✅ `THEMES.md` (400+ lines) - Complete theme system guide - ✅ `README.md` (433+ lines) - Main application documentation - ✅ `COMPONENTS.md` (773+ lines) - UI component library reference - ✅ `QUICKSTART.md` (359+ lines) - Quick start guide for developers - ✅ `REBUILD_NOTES.md` - This summary document **Theme files define base colors:** ```css :root { --primary: 217 91% 60%; /* HSL: blue */ --background: 0 0% 100%; /* HSL: white */ } ``` **App.css bridges to working variables:** ```css :root { --accent-color: hsl(var(--primary)); --primary-bg: hsl(var(--background)); --accent-light: hsla(var(--primary) / 0.1); } ``` **Components use working variables:** ```css .button { background: var(--accent-color); color: hsl(var(--primary-foreground)); } ``` - ✅ Keyboard shortcuts (Alt+1-4, Esc) - ✅ System dark mode detection - ✅ Theme change event subscription - ✅ Automatic document title updates - ✅ Meta theme-color synchronization - ✅ Enhanced console logging - ✅ Better error handling - ✅ Improved accessibility - ✅ Theme switching via dropdown - ✅ Theme persistence to localStorage - ✅ Apps menu with section switching - ✅ Dynamic section loading (Chat, Drive, Tasks, Mail) - ✅ WebSocket chat functionality - ✅ Alpine.js integration for other modules - ✅ Responsive design - ✅ Loading states - [x] Theme switching works across all 19 themes - [x] All sections load correctly - [x] Keyboard shortcuts functional - [x] Responsive on mobile/tablet/desktop - [x] Accessibility features working - [x] No console errors - [x] Theme persistence works - [x] Dark mode detection works ``` documentation/ ├── README.md # Main docs - start here ├── QUICKSTART.md # 5-minute guide ├── THEMES.md # Theme system details ├── COMPONENTS.md # UI component library └── REBUILD_NOTES.md # This summary ``` 1. **HSL Bridge System**: Allows theme files to use shadcn-style HSL variables while the app automatically derives working CSS properties 2. **No Breaking Changes**: All existing functionality preserved and enhanced 3. **Developer-Friendly**: Comprehensive documentation for customization 4. **Accessibility First**: ARIA labels, keyboard navigation, focus management 5. **Performance Optimized**: Instant theme switching, minimal reflows - **Rebuild**: ✅ Complete - **Testing**: ✅ Passed - **Documentation**: ✅ Complete - **Production Ready**: ✅ Yes The rebuild successfully integrates the theme system throughout the UI while maintaining all functionality and adding comprehensive documentation for future development.
2025-11-21 09:28:02 -03:00
pub mod wait;
2025-11-21 10:44:29 -03:00
pub mod weather;
pub mod web_data;
pub mod webhook;
// Re-export key types for convenience
pub use auto_task::{AutoTask, AutoTaskStatus, ExecutionMode, TaskPriority};
pub use intent_compiler::{CompiledIntent, ExecutionPlan, IntentCompiler, PlanStep};
pub use mcp_client::{McpClient, McpRequest, McpResponse, McpServer, McpTool};
pub use mcp_directory::{McpDirectoryScanResult, McpDirectoryScanner, McpServerConfig};
pub use safety_layer::{AuditEntry, ConstraintCheckResult, SafetyLayer, SimulationResult};
// Re-export API handlers for route configuration
pub use autotask_api::{
cancel_task_handler, compile_intent_handler, execute_plan_handler, get_approvals_handler,
get_decisions_handler, get_stats_handler, list_tasks_handler, pause_task_handler,
resume_task_handler, simulate_plan_handler, simulate_task_handler, submit_approval_handler,
submit_decision_handler,
};
/// Configure Auto Task API routes
pub fn configure_autotask_routes() -> axum::Router<std::sync::Arc<crate::shared::state::AppState>> {
use axum::routing::{get, post};
axum::Router::new()
// Intent compilation
.route("/api/autotask/compile", post(compile_intent_handler))
// Plan execution
.route("/api/autotask/execute", post(execute_plan_handler))
.route(
"/api/autotask/simulate/:plan_id",
post(simulate_plan_handler),
)
// Task listing and stats
.route("/api/autotask/list", get(list_tasks_handler))
.route("/api/autotask/stats", get(get_stats_handler))
// Task actions
.route("/api/autotask/:task_id/pause", post(pause_task_handler))
.route("/api/autotask/:task_id/resume", post(resume_task_handler))
.route("/api/autotask/:task_id/cancel", post(cancel_task_handler))
.route(
"/api/autotask/:task_id/simulate",
post(simulate_task_handler),
)
// Decisions
.route(
"/api/autotask/:task_id/decisions",
get(get_decisions_handler),
)
.route(
"/api/autotask/:task_id/decide",
post(submit_decision_handler),
)
// Approvals
.route(
"/api/autotask/:task_id/approvals",
get(get_approvals_handler),
)
.route(
"/api/autotask/:task_id/approve",
post(submit_approval_handler),
)
}
/// List of all available BASIC keywords for the Intent Compiler
pub fn get_all_keywords() -> Vec<String> {
vec![
// Bot/Multi-Agent
"ADD BOT".to_string(),
"BOT REFLECTION".to_string(),
"BROADCAST TO BOTS".to_string(),
"DELEGATE TO BOT".to_string(),
"TRANSFER CONVERSATION".to_string(),
// Communication
"ADD MEMBER".to_string(),
"CREATE DRAFT".to_string(),
"SEND MAIL".to_string(),
"SEND TEMPLATE".to_string(),
"SMS".to_string(),
// UI
"ADD SUGGESTION".to_string(),
"CLEAR SUGGESTIONS".to_string(),
// Tools
"ADD TOOL".to_string(),
"CLEAR TOOLS".to_string(),
"CREATE SITE".to_string(),
"CREATE TASK".to_string(),
"USE TOOL".to_string(),
// Data Operations
"AGGREGATE".to_string(),
"DELETE".to_string(),
"FILL".to_string(),
"FILTER".to_string(),
"FIND".to_string(),
"FIRST".to_string(),
"GROUP BY".to_string(),
"INSERT".to_string(),
"JOIN".to_string(),
"LAST".to_string(),
"MAP".to_string(),
"MERGE".to_string(),
"PIVOT".to_string(),
"SAVE".to_string(),
"SAVE FROM UNSTRUCTURED".to_string(),
"UPDATE".to_string(),
// Files
"COMPRESS".to_string(),
"COPY".to_string(),
"DELETE FILE".to_string(),
"DOWNLOAD".to_string(),
"EXTRACT".to_string(),
"GENERATE PDF".to_string(),
"LIST".to_string(),
"MERGE PDF".to_string(),
"MOVE".to_string(),
"READ".to_string(),
"UPLOAD".to_string(),
"WRITE".to_string(),
// HTTP
"CLEAR HEADERS".to_string(),
"DELETE HTTP".to_string(),
"GET".to_string(),
"GRAPHQL".to_string(),
"PATCH".to_string(),
"POST".to_string(),
"PUT".to_string(),
"SET HEADER".to_string(),
"SOAP".to_string(),
// Control Flow
"EXIT FOR".to_string(),
"FOR EACH".to_string(),
"IF".to_string(),
"SWITCH".to_string(),
"WAIT".to_string(),
"WHILE".to_string(),
// Variables
"GET".to_string(),
"SET".to_string(),
// Memory
"GET BOT MEMORY".to_string(),
"GET USER MEMORY".to_string(),
"REMEMBER".to_string(),
"SET BOT MEMORY".to_string(),
"SET CONTEXT".to_string(),
"SET USER FACT".to_string(),
"SET USER MEMORY".to_string(),
"USER FACTS".to_string(),
// Knowledge
"CLEAR KB".to_string(),
"USE KB".to_string(),
"USE WEBSITE".to_string(),
// AI/LLM
"LLM".to_string(),
"SET CONTEXT".to_string(),
"USE MODEL".to_string(),
// Code Execution
"RUN BASH".to_string(),
"RUN JAVASCRIPT".to_string(),
"RUN PYTHON".to_string(),
// Dialog
"HEAR".to_string(),
"TALK".to_string(),
// Events
"ON".to_string(),
"SET SCHEDULE".to_string(),
"WEBHOOK".to_string(),
// Session
"SET USER".to_string(),
// Special
"BOOK".to_string(),
"WEATHER".to_string(),
// Debug
"PRINT".to_string(),
// String Functions
"FORMAT".to_string(),
"INSTR".to_string(),
"IS NUMERIC".to_string(),
// Safety & Approval (NEW)
"REQUIRE APPROVAL".to_string(),
"SIMULATE IMPACT".to_string(),
"CHECK CONSTRAINTS".to_string(),
"AUDIT LOG".to_string(),
// Auto Task (NEW)
"PLAN START".to_string(),
"PLAN END".to_string(),
"STEP".to_string(),
"AUTO TASK".to_string(),
// MCP Integration (NEW)
"USE MCP".to_string(),
"MCP LIST TOOLS".to_string(),
"MCP INVOKE".to_string(),
// Decision Framework (NEW)
"OPTION A OR B".to_string(),
"DECIDE".to_string(),
"ESCALATE".to_string(),
]
}
/// Keyword categories for documentation and UI
pub fn get_keyword_categories() -> std::collections::HashMap<String, Vec<String>> {
let mut categories = std::collections::HashMap::new();
categories.insert(
"Multi-Agent".to_string(),
vec![
"ADD BOT".to_string(),
"BOT REFLECTION".to_string(),
"BROADCAST TO BOTS".to_string(),
"DELEGATE TO BOT".to_string(),
"TRANSFER CONVERSATION".to_string(),
],
);
categories.insert(
"Communication".to_string(),
vec![
"ADD MEMBER".to_string(),
"CREATE DRAFT".to_string(),
"SEND MAIL".to_string(),
"SEND TEMPLATE".to_string(),
"SMS".to_string(),
],
);
categories.insert(
"Data".to_string(),
vec![
"AGGREGATE".to_string(),
"DELETE".to_string(),
"FILL".to_string(),
"FILTER".to_string(),
"FIND".to_string(),
"FIRST".to_string(),
"GROUP BY".to_string(),
"INSERT".to_string(),
"JOIN".to_string(),
"LAST".to_string(),
"MAP".to_string(),
"MERGE".to_string(),
"PIVOT".to_string(),
"SAVE".to_string(),
"UPDATE".to_string(),
],
);
categories.insert(
"HTTP".to_string(),
vec![
"GET".to_string(),
"POST".to_string(),
"PUT".to_string(),
"PATCH".to_string(),
"DELETE HTTP".to_string(),
"GRAPHQL".to_string(),
"SOAP".to_string(),
"SET HEADER".to_string(),
"CLEAR HEADERS".to_string(),
],
);
categories.insert(
"AI".to_string(),
vec![
"LLM".to_string(),
"SET CONTEXT".to_string(),
"USE MODEL".to_string(),
],
);
categories.insert(
"Code Execution".to_string(),
vec![
"RUN PYTHON".to_string(),
"RUN JAVASCRIPT".to_string(),
"RUN BASH".to_string(),
],
);
categories.insert(
"Safety".to_string(),
vec![
"REQUIRE APPROVAL".to_string(),
"SIMULATE IMPACT".to_string(),
"CHECK CONSTRAINTS".to_string(),
"AUDIT LOG".to_string(),
],
);
categories.insert(
"MCP".to_string(),
vec![
"USE MCP".to_string(),
"MCP LIST TOOLS".to_string(),
"MCP INVOKE".to_string(),
],
);
categories.insert(
"Auto Task".to_string(),
vec![
"PLAN START".to_string(),
"PLAN END".to_string(),
"STEP".to_string(),
"AUTO TASK".to_string(),
"OPTION A OR B".to_string(),
"DECIDE".to_string(),
"ESCALATE".to_string(),
],
);
categories
}