Package-level declarations

Types

Link copied to clipboard
fun interface ScheduledAgentHost

Where scheduled runs get their agent: implement it on your Application. Return the same backend your chat uses (e.g. harness.backend(approver)), so a scheduled task sees the user's current provider, tools and skills.

Link copied to clipboard
class ScheduledAgentWorker(context: Context, params: WorkerParameters) : CoroutineWorker

Runs one ScheduledTask with the app's agent (ScheduledAgentHost) and posts the answer as a notification. Tools that need approval are denied (nobody is there to approve). A failed run is recorded on the task and not retried, so a broken prompt cannot loop.

Link copied to clipboard
@Serializable
data class ScheduledTask(val id: String, val title: String, val prompt: String, val firstRunAt: String, val everyMinutes: Int? = null, val lastRunAt: String? = null, val lastResult: String? = null, val lastError: String? = null)

A prompt the agent runs later; everyMinutes null runs it once. Times are ISO 8601 instants.

Link copied to clipboard
class Scheduler(context: Context) : Capability

Scheduled and recurring agent runs: the agent can schedule_task a prompt for later (once, or every N minutes), list_scheduled_tasks and cancel_scheduled_task. Runs happen in the background on WorkManager (ScheduledAgentWorker), survive reboots, and post their answer as a notification (if the app may post notifications).