40 Commits

Author SHA1 Message Date
Chelsea
215c3d7f95 fix yesterdays schedule blocking todays 2026-02-20 20:04:35 +00:00
019561e7cd Fix bot routine scheduling field mismatch and add debug logging
Bot was sending days_of_week/times but API expects days/time, so
bot-scheduled routines never got reminders. Also handle NULL frequency
from pre-migration rows and add detailed logging to routine reminder
checks for diagnosing further issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:21:22 -06:00
cc1aace73d Fix presence tracking and med reminder bugs 2026-02-19 20:31:43 -06:00
ecb79af44e Fix bugs, add auto-refresh, quick-complete tasks, and every-N-day routines
- Fix bot auth: merge duplicate on_ready handlers so session restore runs (#13)
- Fix push notifications: pass Uint8Array directly as applicationServerKey (#6)
- Show specific conflict reason on schedule save instead of generic error (#17)
- Add inline checkmark button to complete tasks on routines timeline (#18)
- Add visibility-change + 60s polling auto-refresh to routines, meds, tasks (#15)
- Add every-N-day routine scheduling: schema, API, scheduler, and UI (#16)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 19:04:52 -06:00
bebc609091 Add one-off tasks/appointments feature
- DB: tasks table with scheduled_datetime, reminder_minutes_before, advance_notified, status
- API: CRUD routes GET/POST /api/tasks, PATCH/DELETE /api/tasks/<id>
- Scheduler: check_task_reminders() fires advance + at-time notifications, tracks advance_notified to prevent double-fire
- Bot: handle_task() with add/list/done/cancel/delete actions + datetime resolution helper
- AI: task interaction type + examples added to command_parser
- Web: task list page with overdue/notified color coding + new task form with datetime-local picker
- Nav: replaced Templates with Tasks in bottom nav

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 16:43:42 -06:00
2951382c51 Fix auth persistence: web client session timeout + bot cache loss
Web client: trustDevice now defaults to true so a refresh token is always
issued on login, preventing deauth after the 1-hour access token expiry.
Users can still uncheck the box on shared devices.

Bot: cache file path is now env-configurable (BOT_CACHE_FILE) and
defaults to /app/cache/user_cache.pkl. Docker Compose mounts a named
volume at /app/cache so the session cache survives container restarts.
saveCache() now creates the directory if it doesn't exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 16:32:07 -06:00
95ebae6766 Add AI task composition for routines (bot + web client)
Users can now describe a goal and have AI auto-generate 4-7 ADHD-friendly
steps, which they can review and modify before saving.

- ai/ai_config.json: Add step_generator prompt and ai_compose examples
  to command_parser so bot recognises vague task descriptions
- api/routes/ai.py: New POST /api/ai/generate-steps endpoint — calls
  LLM via ai_parser, validates and sanitises returned steps
- api/main.py: Register new ai_routes module
- bot/commands/routines.py: Add ai_compose action — generates steps,
  shows numbered list with durations, uses existing yes/no confirm flow
- synculous-client/src/lib/api.ts: Add api.ai.generateSteps(goal)
- synculous-client/src/app/dashboard/routines/new/page.tsx: Add
  Generate with AI panel with collapsible textarea, loading spinner,
  and inline error; generated steps slot into existing editable list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 13:56:54 -06:00
d4adbde3df Fix issues #6, #7, #11, #12, #13: med reminders, push notifications, auth persistence, scheduling conflicts
- Fix TIME object vs string comparison in scheduler preventing adaptive med
  reminders from ever firing (#12, #6)
- Add frequency filtering to midnight schedule creation for every_n_days meds
- Require start_date and interval_days for every_n_days medications
- Add refresh token support (30-day) to API and bot for persistent sessions (#13)
- Add "trusted device" checkbox to frontend login for long-lived sessions (#7)
- Auto-refresh expired tokens in both bot (apiRequest) and frontend (api.ts)
- Restore bot sessions from cache on restart using refresh tokens
- Duration-aware routine scheduling conflict detection (#11)
- Add conflict check when starting routine sessions against medication times
- Add diagnostic logging to notification delivery channels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 13:05:48 -06:00
cf2b4be033 med scheduling fixes 2026-02-17 18:33:43 -06:00
8ac7a5129a fixed spamming i hope 2026-02-17 18:11:44 -06:00
123a7ce3e7 claude bugpass 2026-02-17 00:20:06 -06:00
Chelsea
3d3b80fe96 partial 2026-02-17 05:46:59 +00:00
98706702da Fix snitch test to not send to wrong user, implement Discord DM sending for snitches 2026-02-16 21:16:33 -06:00
d4fb41ae6b Add adaptive medication timing, Discord presence tracking, and nagging system 2026-02-16 20:00:53 -06:00
1ed187b0dd Properly merge original Discord bot with JurySystem DBT integration 2026-02-16 19:29:35 -06:00
2feaf0cdc0 Convert JurySystem to Discord bot 2026-02-16 19:26:16 -06:00
c7be19611a Merge branch 'main' of https://git.scorpi.us/chelsea/Synculous-2 2026-02-16 19:08:19 -06:00
b1bb05e879 Fix knowledge base loader to handle list format embeddings
Handle both dict and list formats in load_knowledge_base function to fix AttributeError
2026-02-16 19:06:31 -06:00
Bongobutt
b3dab95cf9 Please enter the commit message for your changes. Lines starting 2026-02-16 18:58:35 -06:00
Bongobutt
d5737e97bf fixe 2026-02-16 18:52:38 -06:00
Bongobutt
ad0faf72e1 i sniffed the wrong week to quit picking glue. 2026-02-16 18:51:15 -06:00
832c1e1a23 i bliggleblorfed 2026-02-16 14:00:18 -06:00
028bdfa4f9 mr potato head 2026-02-16 13:42:24 -06:00
a395f221cc i quit the wrong week the pick sniffing glue 2026-02-16 13:29:44 -06:00
f140f8f75c no 2026-02-16 13:16:18 -06:00
d262d80199 debug: add API call logging to medication take action 2026-02-16 12:46:22 -06:00
7cf0681deb debug: add logging and partial name matching for med context lookup 2026-02-16 12:30:25 -06:00
a53187d6a9 fix: make AI parser async to prevent Discord heartbeat blocking 2026-02-16 12:24:13 -06:00
9cc2f19ce8 fix: include scheduled_time when logging medication intake from reminders 2026-02-16 12:13:25 -06:00
398e1ce334 fix: correct embedding model name from l2 to v2 2026-02-16 11:32:06 -06:00
d407a4bd9d Add knowledge base RAG module for book Q&A 2026-02-16 11:27:48 -06:00
0f270dbba2 Add knowledge base RAG module for book Q&A
- Create knowledge.py handler with dynamic book selection
- Support list/select/query actions for multiple books
- Implement vector search with cosine similarity
- Add knowledge detection to AI parser config
- Cache embeddings per-book for performance
2026-02-16 11:20:22 -06:00
1621141e76 fix(bot): use duration_minutes instead of duration_seconds when creating steps
- API expects duration_minutes field, not duration_seconds
- Fixed in both create_with_steps and add_steps actions
2026-02-16 06:16:02 -06:00
20f995119c feat(bot): add delete action for medications and routines
- Added delete action to medications handler with confirmation flow
- Added delete action to routines handler with confirmation flow
- Updated AI config with delete examples for both meds and routines
- Added 'delete', 'remove', 'get rid of' to action recognition
2026-02-16 06:04:19 -06:00
7d7d6fb3a0 fix(bot): fix syntax error in f-string with backslash 2026-02-16 05:57:45 -06:00
c903363f6e feat(bot): comprehensive natural language command parsing
- Enhanced AI prompts with time/frequency conversion rules and 20+ examples
- Added smart medication name resolution and confirmation flows
- New medication commands: today, refills, snooze, adherence
- New routine commands: create_with_steps, add_steps, steps, schedule
- Added active session awareness with shortcuts (done, skip, pause, resume)
- Confirmation handling for destructive/create actions
- Improved help message with natural language examples
2026-02-16 05:53:40 -06:00
16d89d07f6 bug fixes 2026-02-16 05:34:27 -06:00
12bbc5c0b4 bot improvements 2026-02-16 04:49:31 -06:00
3e1134575b First synculous 2 Big-Pickle pass. 2026-02-12 23:07:48 -06:00
25d05e0e86 first commit 2026-02-12 22:11:52 -06:00