Skip to content

routines

Routines: a message sent to an agent on a schedule, in a space (\"every weekday at 9:00, ask @researcher for the news on X\").

On this page 6

Routines: a message sent to an agent on a schedule, in a space ("every weekday at 9:00, ask @researcher for the news on X").

TypeScript
import { routines } from "copilotz/plugins/agents";

What it keeps

It keeps 2 collections, each on the record: every change to one is an event.

CollectionKept asFields
routinedocumentsin, name, text, agent, schedule, post, thread, chatName, paused, by, rev, at, updated, next, since, last, runs
routineRundocumentsroutine, in, at, due, outcome, thread, message, error, note, by

The access rules cover routine and routineRun: each document is in a space, and only those who reach the space reach it.

Its named queries read for callers, as the rules let them:

QueryWho outside runs it
routine.listpeople, agents for a person, keys and routines
routine.runspeople, agents for a person, keys and routines

What it lets callers do

Of its 8 Actions, people and agents may call 6; contacts and someone signed out may call none.

ActionPersonAgentContactAnyoneKeyWhat it does
routine.createyesyesnonoyesMakes a routine: a message sent to an agent on a schedule, in a space.
routine.deleteyesyesnonoyesDeletes a routine; the chats it posted in stay.
routine.pauseyesyesnonoyesPauses a routine: it doesn't run until it's resumed.
routine.resumeyesyesnonoyesResumes a paused routine: it runs on its schedule again, from now.
routine.runyesyesnonoyesRuns a routine now: its message goes to its agent at once.
routine.updateyesyesnonoyesChanges a routine: its name, message, agent, schedule or where it posts.

An agent works for a person, and calls what both may. A key calls only what its scope names.

Only the app's own code calls routine.fire and routine.origin: its plugins, its schedules and the system.

Agents act through its 4 tools, as whoever they work for:

ToolWhat it doesCalls
cancel_routineDelete one of this space's routines, by its [id] (from list_routines) or its name.routine.delete
list_routinesThe routines in this space: what each sends, to whom, when it runs next.
name_chatName this chat for what you found, once you have: people pick a run from a list by its name ("Nov 2 · Competitor cut 8%, we hold").
schedule_routineMake a routine: a message sent to an agent on a schedule, here, as the person you work for ("every weekday at 9:00, ask @researcher for the news on X", "remind me every Monday to send the report"). text is what's sent each time, written as the person would ask it; agent defaults to you.routine.create

It also adds rules every read and write keeps to (guard).

Where it shows

It shows to the model through its tools.

  • Agents' tools: cancel_routine, list_routines, name_chat, schedule_routine.
  • Front ends: routines-web.
  • What it adds to resources: origins (routine).

What it needs

Nothing to set: it works as it comes.

What it requires

The runtime doesn't start without chat and spaces: add them too.

It ships with copilotz@1.0.0-rc.34.

Listing

It keeps every listing rule.