diff --git a/app.py b/app.py index cc30920..acebb20 100644 --- a/app.py +++ b/app.py @@ -296,215 +296,258 @@ async def root(request: Request):
-

LETTA SWITCHBOARD

-
-
SERVICE:  MESSAGE ROUTING FOR LETTA AGENTS
-VERSION:  1.0.0
-STATUS:   OPERATIONAL
-HOSTING:  FREE SERVERLESS DEPLOYMENT
-
- - → OPEN WEB DASHBOARD ← - -

FEATURES

- - -

QUICK START

- -
-

SEND ONE-TIME MESSAGE:

+

Letta Switchboard

+

Message scheduling and routing for Letta agents

+
Operational
+
+ Open Dashboard + +

Features

+
+
+
Scheduled Messages
+
Send messages now or schedule for later
+
+
+
Recurring Schedules
+
Cron expressions for repeated delivery
+
+
+
API Key Isolation
+
Secure per-user schedule storage
+
+
+
Execution Tracking
+
Track results with run IDs
+
+
+ +

Quick Start

+

Schedule a one-time message:

curl -X POST https://letta--switchboard-api.modal.run/schedules/one-time \\
   -H 'Authorization: Bearer YOUR_LETTA_API_KEY' \\
   -H 'Content-Type: application/json' \\
   -d '{
-    "agent_id": "agent-xxx",
-    "execute_at": "2025-11-13T09:00:00Z",
-    "message": "Hello from Switchboard!"
+    "agent_id": "agent-xxx",
+    "execute_at": "2025-12-09T09:00:00Z",
+    "message": "Hello from Switchboard!"
   }'
-
- -
-

CREATE RECURRING SCHEDULE:

+ +

Create a recurring schedule:

curl -X POST https://letta--switchboard-api.modal.run/schedules/recurring \\
   -H 'Authorization: Bearer YOUR_LETTA_API_KEY' \\
   -H 'Content-Type: application/json' \\
   -d '{
-    "agent_id": "agent-xxx",
-    "cron": "0 9 * * 1-5",
-    "message": "Daily standup reminder"
+    "agent_id": "agent-xxx",
+    "cron": "0 9 * * 1-5",
+    "message": "Daily standup reminder"
   }'
-
- -

CLI TOOL

-

NATURAL LANGUAGE SCHEDULING SUPPORT

- -
-

INSTALLATION:

-
git clone https://github.com/cpfiffer/letta-switchboard.git
-cd letta-switchboard/cli
-go build -o letta-switchboard
-./letta-switchboard config set-api-key YOUR_LETTA_API_KEY
-
- -
-

USAGE:

-
# Send immediately
-./letta-switchboard send --agent-id agent-xxx --message "Hello!"
-
-# Schedule with natural language
-./letta-switchboard send --agent-id agent-xxx --message "Reminder" --execute-at "tomorrow at 9am"
 
-# Recurring schedule
-./letta-switchboard recurring create --agent-id agent-xxx --message "Daily standup" --cron "every weekday"
-
- -

API ENDPOINTS

-
POST /schedules/one-time - Create a one-time schedule
-
POST /schedules/recurring - Create a recurring schedule
-
GET /schedules/one-time - List your one-time schedules
-
GET /schedules/recurring - List your recurring schedules
-
GET /schedules/one-time/{id} - Get specific one-time schedule
-
GET /schedules/recurring/{id} - Get specific recurring schedule
-
DELETE /schedules/one-time/{id} - Delete one-time schedule
-
DELETE /schedules/recurring/{id} - Delete recurring schedule
-
GET /results - List execution results
-
GET /results/{schedule_id} - Get result for specific schedule
- -
- AUTHENTICATION: ALL ENDPOINTS REQUIRE
- Authorization: Bearer YOUR_LETTA_API_KEY -
- -

DOCUMENTATION & SUPPORT

-

WEB DASHBOARD - Manage schedules in browser

-

DOCUMENTATION - Full technical reference

-

SUPPORT - Issue tracker

-

JSON API - View as JSON response

+

CLI Tool

+

Natural language scheduling from your terminal:

+
# Install
+git clone https://github.com/cpfiffer/letta-switchboard.git
+cd letta-switchboard/cli && go build -o letta-schedules
+./letta-schedules config set-api-key YOUR_LETTA_API_KEY
+
+# Send a message
+./letta-schedules send --agent-id agent-xxx --message "Hello!"
+
+# Schedule with natural language
+./letta-schedules send --agent-id agent-xxx --message "Reminder" --at "tomorrow 9am"
+
+# Create recurring schedule
+./letta-schedules recurring create --agent-id agent-xxx --cron "every weekday" --message "Standup"
+ +

API Endpoints

+
+
+ POST /schedules/one-time + Create one-time schedule +
+
+ POST /schedules/recurring + Create recurring schedule +
+
+ GET /schedules/one-time + List one-time schedules +
+
+ GET /schedules/recurring + List recurring schedules +
+
+ DELETE /schedules/{type}/{id} + Delete a schedule +
+
+ GET /results + List execution results +
+
+ +
+ Authentication required: All endpoints need Authorization: Bearer YOUR_LETTA_API_KEY +
+ +

Links

+
@@ -779,13 +822,14 @@ async def execute_schedule( error=error_msg, status="failed" ) - - # Terminate recurring schedules on failure (no retries) - if schedule_type == "recurring": + + # Only terminate recurring schedules on permanent errors (401, 404) + # Transient errors (timeouts, rate limits, 5xx) should not remove the schedule + if schedule_type == "recurring" and result.get("permanent", False): try: Path(file_path).unlink() volume.commit() - logger.warning(f"Terminated recurring schedule {schedule_id} due to execution failure: {error_msg}") + logger.warning(f"Terminated recurring schedule {schedule_id} due to permanent error: {error_msg}") except Exception as e: logger.error(f"Failed to delete failed recurring schedule {schedule_id}: {e}") diff --git a/dashboard.html b/dashboard.html index 8c75df2..fd7f5fb 100644 --- a/dashboard.html +++ b/dashboard.html @@ -7,370 +7,436 @@
-

LETTA SWITCHBOARD — MESSAGE ROUTING SERVICE

-
-
SYSTEM:   MESSAGE ROUTING TERMINAL
-VERSION:  1.0.0
-STATUS:   OPERATIONAL
-PROTOCOL: REST API + SCHEDULED EXECUTION
+
+

Switchboard Dashboard

+
- + -
- - - - +
+
Authentication
+ +
+ + +
- + - +