mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-06 01:27:43 +01:00
* feat(bots): a bot writes first, on the person's own key A person can tell one of their bots to write first, every day at a time they pick, with a prompt they wrote. The run happens on the person's own OpenRouter key only; without a key the routine is kept, shown as waiting, and skipped with the reason, so no platform key is ever spent by a timer (fleet standing rule 2026-09-25). - companion_routines table (one per person per bot, owner-only RLS), routines-store (time validation, next run in the person's zone) and the runner behind a cron route + 15-minute systemd timer, registered as a person-asked timer in the no-background-ai gate with a marker check. - GET/PUT/DELETE /api/ai-assistants/[id]/routine for the owner. - RoutineRow in a bot's own chat: "Writes first, every day", time and prompt inline, a line to Settings when a key is missing. - Hands: the proposal line names what will be set up, never only "Sure"; a created event's outcome carries its link. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et * feat(bots): a bot can ask Loki, as the person — the first connector ask_loki: a Cat action (communication, low risk, confirmed) in the hands launch set. The bot relays a question over the signed OrangeCat → Loki rail to Loki's POST /api/orangecat/ask, which runs a read-only turn as the Loki user linked to the actor; Loki's own sentence is the outcome the person reads, and a refusal (no linked account, a spent budget) is relayed as written. A relayed question can never dispatch, approve or spend: that stays with send_task_to_loki, and the two verbs name each other so a question is never dispatched as a task. ADR-0013: D6 first connector and D7 recorded as shipped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et * fix(bots): the routine's day-in-zone comes from the timezone helper check:app-locale (new on main) refuses a literal locale handed to Intl; the routine's next-run computation now takes the day in the person's zone from instantToWallTime, the one rendering the app already trusts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et * fix(bots): the chip knows the verb of ask_loki The tool-label table of leading verbs gains ask → Asking / Asked, so the chip for a bot's question to Loki never falls back to the generic label. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmrXvMqAqZtbpQ4x3et --------- Co-authored-by: Claude <noreply@anthropic.com>
Scripts Directory
This directory contains all automation scripts organized by purpose.
Directory Structure
analysis/- Bundle analysis, documentation checking, and optimization toolsauth-fix/- Scripts to fix authentication and RLS policy issuesdb/- Database operations, migrations, and schema management- Migration scripts moved from root:
apply-migration.js,apply-*-migration.js
- Migration scripts moved from root:
deployment/- Deployment, production setup, and monitoring scriptsdev/- Development helpers, local setup, and debugging toolsdiagnostics/- Health checks and system diagnosticsmaintenance/- Cleanup, optimization, and maintenance scriptsmonitoring/- Performance monitoring and bundle size trackingoauth/- OAuth provider setup and configurationprofile-fix/- Scripts to fix profile-related issuesschema-fix/- Database schema fixes and migrationsstorage/- Supabase storage bucket setup and managementtest/- Testing utilities and validation scripts- Test/debug scripts moved from root:
test-*.js,check-*.js,debug-*.js
- Test/debug scripts moved from root:
Usage
Most scripts can be run with:
node scripts/{category}/script-name.js
For deployment scripts:
bash scripts/deployment/script-name.sh
Important Scripts
scripts/dev/dev-start.js- Main development server starterscripts/deployment/browser-verify.js- Post-deploy browser smoke test (deploys run from.github/workflows/cd.ymlviascripts/deploy-selfhost.sh— see docs/operations/deployment/DEPLOYMENT_PROCESS.md)scripts/apply-migrations.sh- Applies pendingsupabase/migrations/*.sqlon every deploy (run byscripts/deploy-selfhost.sh).scripts/db/apply-migrations.tsis a legacy script, not the deploy path.scripts/maintenance/cleanup-console-logs.ts- Remove console.log statements