| Files | Last commit | Last update |
|---|---|---|
feat(tui): add /cron command for interactive job management Add comprehensive TUI interface for managing cron scheduled jobs with three dialog modes: List, EditForm, and ConfirmDelete. Changes: - Create services::cron_service module * load_cron_snapshot(): read config.toml and jobs.toml * write_jobs(): persist changes to jobs.toml with pretty format * validate_cron_expr(): reuse agent_types parser for validation * CronJobEntry: TUI-friendly job representation with validation status - Create state::cron_dialog module * CronDialogMode: state machine for List/EditForm/ConfirmDelete * CronEditForm: 8-field form with Tab navigation * Real-time cron expression validation * Duplicate name detection in edit mode * save_edit_form(): validation and persistence logic - Add /cron slash command * Tab-completion support in slash_complete.rs * Command spec: "管理 cron 定时任务:查看、配置、删除、启用/禁用" - Add InputMode::CronManagement enum variant * AppState integration with cron_dialog field * event_key.rs handler for keyboard navigation * render/root.rs rendering for all three dialog modes Dialog modes: - List: Browse jobs with Up/Down, actions (a/e/d/Space) - EditForm: 8-field editor with Tab navigation and validation - ConfirmDelete: Safety confirmation before deletion User workflow: 1. Type /cron in TUI input 2. List mode shows all jobs with status indicators 3. Press "a" to add, "e" to edit, "d" to delete 4. Space toggles enabled/disabled 5. Changes written to jobs.toml immediately 6. Restart daemon to apply changes Validation: - Name, Cron, Prompt fields required - Cron syntax validated via agent_types::cron::CronExpression - Duplicate names rejected - Numeric fields (timeout, retries) validated Adapted from 0003-adapted-tui-cron-management.patch for the current codebase (apps/endside/ instead of apps/xiaoo-app/src/tui/). | 2 days ago | |
feat: implement daemon cron scheduler with retry logic Implement cron-based scheduled task execution in xiaoO daemon with robust retry mechanism and concurrency control. Changes: - Add 'cron', 'shellexpand' dependencies to serverside - Create cron::scheduler module with CronScheduler * Per-job tokio timer loops with CancellationToken * Retry logic with configurable attempts and delay * Concurrency control via tokio::Semaphore * Graceful shutdown on daemon exit * Execution statistics (trigger_count, success_count, failure_count) - Extend daemon_config with cron configuration parsing * CronSectionRaw: parse [cron] section from config.toml * CronJobRaw: parse [[job]] entries from jobs.toml * resolve_cron_jobs(): load, validate, and merge configs * Duplicate job name detection using HashSet * Use dirs::home_dir() for HOME directory resolution - Integrate CronScheduler into daemon main.rs * Initialize after channel services setup * Graceful shutdown before backend manager cleanup * Diagnostic logging for empty/no config scenarios Configuration layout: ~/.config/xiaoo/config.toml [cron] section (global settings) ~/.config/xiaoo/cron/jobs.toml [[job]] array (job definitions) Error handling: - Fail-open: config errors don't block daemon startup - Invalid cron expressions logged and job skipped - Timeout and retry errors properly categorized Files added: apps/serverside/src/cron/mod.rs apps/serverside/src/cron/scheduler.rs Files modified: Cargo.toml, Cargo.lock apps/serverside/Cargo.toml apps/serverside/src/daemon_config.rs apps/serverside/src/main.rs | 2 days ago | |
feat(hooker): support plugin-requested session actions executed daemon-side Co-Authored-By: GLM-5.2 | 4 days ago | |
optimize: add proactive token estimation and config validation with URL optimization Co-Authored-By: GLM-5 | 1 month ago |