Documentation
¶
Overview ¶
Package routinetools is the agents' MCP tools of the person's routines — recurring agent tasks the hub runs on a schedule (docs/hub/routines.md): the same acts as `harnessly routine`, over the same call.
Index ¶
Constants ¶
const ( ToolList = "routine_list" ToolCreate = "routine_create" ToolUpdate = "routine_update" ToolRun = "routine_run" ToolRuns = "routine_runs" ToolDelete = "routine_delete" ToolFire = "routine_fire" )
const Instruction = "Routines (регулярные задачи): when the person asks for something to happen again and again — «каждый " +
"понедельник присылай аналитику», «каждое утро дайджест в файл», «следи за выкатом и пиши, если упал», «раз в неделю " +
"проверяй лимиты» — or once at a later time («25-го в 12:00 убери флаг»), make a routine with routine_create (or " +
"`harnessly routine create`), never a cron job, /loop or CronCreate of your own: those die with this session. The hub runs " +
"a routine on one of the person's machines in a new chat with no one watching; its agent reports ok, quiet (nothing new) " +
"or failed with a summary and artifacts, the hub checks the report and tells the person. Write the prompt as a full " +
"brief for that agent (it does not see this chat): what to gather, from where, what the result looks like, what is " +
"«nothing new». When the task lives in this chat's context («каждое утро проверяй, что выкат этой ветки сошёлся»), set " +
"context continue: its runs come into this chat instead of a new one. Put the schedule as cron in the person's zone and as their own words in `words`. Add deterministic " +
"checks the result must pass (contains a section, a file written, today's date). Pick the channels the person named " +
"(telegram, file with a path, doc, notice); none named: notice. Say back in one line what was made: name, schedule in " +
"words, next start, where the result goes. Change one with routine_update (enabled false pauses it; state \"\" clears " +
"its memory), run it now with routine_run, read its history with routine_runs. When the check «is there anything new» is " +
"mechanical (a file, a count, a connector's answer), give the routine a gate: a read-only shell command run on the " +
"machine before each run that prints {\"wake\": false} when there is nothing, so no agent and no tokens are spent " +
"(or {\"wake\": true, \"message\": \"what it found\", \"state\": \"…\"}; without JSON exit 0 wakes, 1 sleeps). For " +
"«разбери алерт, когда придёт», make it with signal true and fire it with routine_fire (or a fire key from " +
"`harnessly routine fire-key ID` for an outside webhook): the text reaches the run's agent."
Instruction is what an agent is told of routines.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tools ¶
type Tools struct {
Hub func(ctx context.Context, call hubproto.RoutinesCall) (int, []byte, error)
// Chat is the calling agent's chat: a routine made here remembers it.
Chat string
}
Tools are the routines' MCP tools; Hub carries a call to the hub (the runtime's agent relay).