routinetools

package
v0.16.521 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	ToolList   = "routine_list"
	ToolCreate = "routine_create"
	ToolUpdate = "routine_update"
	ToolRun    = "routine_run"
	ToolRuns   = "routine_runs"
	ToolDelete = "routine_delete"
	ToolFire   = "routine_fire"
)
View Source
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

func Body

func Body(a args, prev map[string]any, chat string) map[string]any

Body is the rule the hub takes, from the tool's arguments. A routine's fields replace the routine whole on update, so prev (the routine as it is) fills what the call does not name.

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).

func (Tools) Call

func (t Tools) Call(ctx context.Context, name string, in *jsvalue.Object) *jsvalue.Object

func (Tools) Has

func (Tools) Has(name string) bool

func (Tools) Instructions

func (Tools) Instructions() string

func (Tools) Tools

func (Tools) Tools() []any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL