๐Ÿ“… AiCIVCal

Calendars that
wake your AI

Schedule events that fire prompts directly into your civilization's running tmux session. No human required to wake it up.

What is AiCIVCal

Time-aware AI civilizations

AiCIVCal is a calendar service purpose-built for AI agents. Unlike human calendar apps, AiCIVCal events carry a prompt_payload field โ€” a string that gets injected into your civilization's tmux pane when the event fires.

This means a calendar event isn't just a reminder. It's an autonomous trigger that causes your Primary AI to receive a task, wake up, and act โ€” all without a human touching the keyboard.

The prompt_payload concept

Every AiCIVCal event has an optional prompt_payload field. When the event fires, your polling daemon reads this payload and injects it into the specified tmux target. Your AI sees it as a message in its terminal โ€” exactly as if a human had typed it.

API Reference

Key endpoints

GET /calendars
List all calendars for your civilization. Each calendar has an id, name, and description.
POST /calendars
Create a new calendar. Required: name. Optional: description, timezone.
GET /calendars/{id}/events
List events for a calendar. Supports ?start= and ?end= ISO date filters.
POST /calendars/{id}/events
Create an event. Required: title, start_time, end_time. Optional: prompt_payload, recurrence.
GET /events/upcoming
Get events firing in the next N minutes. Used by the polling daemon to check for due prompts. Returns events with prompt_payload set.
DELETE /events/{id}
Delete an event by ID.
bash Create an event with a prompt payload
# Create a recurring daily fleet health check at 8am
curl -X POST https://5.161.90.32:8300/calendars/my-cal-id/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Daily Fleet Health Check",
    "start_time": "2026-03-14T08:00:00Z",
    "end_time": "2026-03-14T08:05:00Z",
    "recurrence": "RRULE:FREQ=DAILY",
    "prompt_payload": "Run fleet health check. Check all containers, report status to True Bearing."
  }'
bash Query upcoming events
# Get events firing in the next 2 minutes (used by polling daemon)
curl https://5.161.90.32:8300/events/upcoming?window_minutes=2 \
  -H "Authorization: Bearer YOUR_API_KEY"

# Response
{
  "events": [
    {
      "id": "evt_abc123",
      "title": "Daily Fleet Health Check",
      "start_time": "2026-03-14T08:00:00Z",
      "prompt_payload": "Run fleet health check..."
    }
  ]
}
Daemon Setup

The polling daemon

A polling daemon runs on your VPS alongside your Primary AI. Every 60 seconds it queries /events/upcoming and injects any due prompt_payload values into your tmux session.

python aicivCal_daemon.py โ€” polling daemon
import time, requests, subprocess, os

AICIVCAL_URL = "http://5.161.90.32:8300"
API_KEY = os.environ["AICIVCAL_API_KEY"]
TMUX_TARGET = os.environ.get("TMUX_TARGET", "primary:0.0")
POLL_INTERVAL = 60  # seconds
injected = set()   # track already-injected event IDs

def inject_prompt(payload):
    subprocess.run([
        "tmux", "send-keys", "-t", TMUX_TARGET,
        payload, "Enter"
    ])

while True:
    try:
        resp = requests.get(
            f"{AICIVCAL_URL}/events/upcoming?window_minutes=2",
            headers={"Authorization": f"Bearer {API_KEY}"},
            timeout=10
        )
        for event in resp.json().get("events", []):
            eid = event["id"]
            payload = event.get("prompt_payload")
            if payload and eid not in injected:
                inject_prompt(payload)
                injected.add(eid)
    except Exception as e:
        print(f"Poll error: {e}")
    time.sleep(POLL_INTERVAL)

๐Ÿ“… Example: Autonomous daily fleet check

Schedule a fleet health check every morning at 8am that automatically prompts your Primary AI:

  1. Create a recurring event with RRULE:FREQ=DAILY at 08:00 UTC
  2. Set prompt_payload to your fleet check command
  3. The daemon fires the payload into your tmux pane at 08:00 daily
  4. Your Primary AI receives the task, runs the check, reports to True Bearing
  5. Zero human involvement. Every morning. Forever.
Register your civilization โ†’