Documentation
¶
Index ¶
Constants ¶
const ( Key = hooksconfig.Key + ".shell" // Commands to run on agent events, a list of definitions by event name Events = Key + ".events" // Every hook the events name runs without asking first AutoAccept = Key + ".auto_accept" // Addresses agent events are posted to, a table of targets by a key of their own Outbound = Key + ".outbound" // The hooks folders of the profile and of every profile declare in their HOOK.yaml run Folders = Key + ".folders" // Hook folders, by the names of their folders, that are kept and do not run FoldersOff = Key + ".folders_off" )
const ( Command = "command" Matcher = "matcher" Timeout = "timeout" Block = "fail_closed" )
Fields of one hook of the events setting
const ( HookTimeout = 60 MaxHookTimeout = 300 )
Seconds a hook may take when its entry gives none, and the most it may take
const ( PostTimeout = 10 MaxPostTimeout = 60 )
Seconds a post may take when its webhook gives none, and the most it may take
const ( URL = "url" Posted = "events" Name = "name" SecretEnv = "secret_env" Secret = "secret" )
Fields of one webhook of the outbound setting, besides the matcher and the time limit a hook has too
const ( GroupTools = "Tools" GroupReplies = "Replies" GroupSessions = "Sessions" GroupAsking = "Commands and questions" GroupHelpers = "Subagents and skills" GroupRequests = "Model requests" GroupChat = "Chat apps" GroupBoard = "Task board" )
Headings the events are listed under, in the order they show
const PickTools = "tool-pattern"
Kind of thing a value of tools names, a pattern of the names of the tools a hook or a webhook is for, by the name the hooks page registers its picker under
Variables ¶
var Points = []Point{ {hooks.PreToolCall, "Before a tool runs", "Runs before each tool call and can block it, change it or ask you", GroupTools}, {hooks.PostToolCall, "After a tool runs", "Runs after each tool call, with what the tool did", GroupTools}, {hooks.TransformToolResult, "Tool results", "Can change the result of a tool before the model reads it", GroupTools}, {hooks.TransformTerminalOutput, "Command output", "Can change the output of a terminal command before the model reads it", GroupTools}, {hooks.PreLLMCall, "Before a reply starts", "Can refuse your message or give the agent more to go on", GroupReplies}, {hooks.TransformLLMOutput, "The agent's reply", "Can rewrite the reply the agent ends with", GroupReplies}, {hooks.PostLLMCall, "Reply answered", "Runs once the agent has answered your message", GroupReplies}, {hooks.SessionEnd, "Reply ended", "Runs as each reply ends, also one that failed or was stopped", GroupReplies}, {hooks.PreVerify, "Code changes checked", "Can send the agent back to check the code it changed", GroupReplies}, {hooks.InterimMessage, "While the agent works", "Runs on what the agent says between its steps", GroupReplies}, {hooks.StreamStart, "Reply starts", "Runs when a reply begins to stream", GroupReplies}, {hooks.StreamDelta, "Reply streams", "Runs on each piece of a reply as it streams", GroupReplies}, {hooks.StreamEnd, "Reply stops streaming", "Runs when a reply stops streaming", GroupReplies}, {hooks.AgentLoopStopped, "Reply stopped", "Runs when a reply is stopped before it ended, with why", GroupReplies}, {hooks.SessionStart, "Session starts", "Runs when a session starts", GroupSessions}, {hooks.SessionFinalize, "Session closes", "Runs when a session closes for good", GroupSessions}, {hooks.SessionReset, "New session in a window", "Runs when a window leaves its session for a new one", GroupSessions}, {hooks.SessionMove, "Session moved", "Runs when a session moves to work in another folder", GroupSessions}, {hooks.SessionDelete, "Sessions deleted", "Runs when sessions are deleted", GroupSessions}, {hooks.PostCompaction, "Session summarized", "Runs after a long session is summarized to fit the model", GroupSessions}, {hooks.PreCommand, "Before a slash command", "Runs before a slash command and can refuse it, answer it or change it", GroupAsking}, {hooks.PreApprovalRequest, "Before an approval", "Runs before the agent asks you to approve something", GroupAsking}, {hooks.PostApprovalResponse, "Approval answered", "Runs once an approval was given, refused or not answered in time", GroupAsking}, {hooks.HumanInputRequest, "You are asked something", "Runs when the agent asks you for an approval, an answer or a password", GroupAsking}, {hooks.HumanInputResolved, "You answered", "Runs on what came of asking you", GroupAsking}, {hooks.SubagentStart, "Subagent starts", "Runs when a subagent starts a task", GroupHelpers}, {hooks.SubagentProgress, "Subagent at work", "Runs each time a subagent starts a tool call", GroupHelpers}, {hooks.SubagentStop, "Subagent finishes", "Runs when a subagent finishes its task", GroupHelpers}, {hooks.SkillLifecycle, "Skill used or changed", "Runs when a skill is loaded, read, changed or installed", GroupHelpers}, {hooks.PreAPIRequest, "Before a model request", "Runs before each request goes to the provider", GroupRequests}, {hooks.PostAPIRequest, "After a model request", "Runs on each answer from the provider", GroupRequests}, {hooks.APIRequestError, "Model request failed", "Runs on each request to the provider that failed", GroupRequests}, {hooks.PreAuxiliaryCall, "Before a helper request", "Runs before each request of a helper model", GroupRequests}, {hooks.PostAuxiliaryCall, "After a helper request", "Runs on each answer to a helper model, or its failure", GroupRequests}, {hooks.PreTranscription, "Speech to text starts", "Can set the model, language and prompt of a transcription", GroupRequests}, {hooks.LoginExhausted, "An account is used up", "Runs when an account of a provider reaches a limit or is refused", GroupRequests}, {hooks.CronIncident, "A job keeps failing", "Runs as an incident of a scheduled job opens, is told or closes", GroupRequests}, {hooks.GatewayStartup, "Chat apps start", "Runs when the chat apps of the profile start to connect", GroupChat}, {hooks.PreGatewayDispatch, "Chat app message arrives", "Runs on a message from a chat app before it is handled", GroupChat}, {hooks.PostGatewayAdmission, "Chat app message let in", "Runs on a message from a chat app once it is let in", GroupChat}, {hooks.GatewayPlatformEvent, "Chat app events", "Runs on the events of your chat apps", GroupChat}, {hooks.RoomMemberActivity, "Room activity", "Runs on what the members of a room do", GroupChat}, {hooks.KanbanTaskClaimed, "Board task taken", "Runs when a task on the board is taken", GroupBoard}, {hooks.KanbanTaskCompleted, "Board task done", "Runs when a task on the board is done", GroupBoard}, {hooks.KanbanTaskBlocked, "Board task blocked", "Runs when a task on the board is blocked", GroupBoard}, {hooks.KanbanTaskUpdated, "Board task changed", "Runs when a task on the board changes", GroupBoard}, {hooks.KanbanWorkerSpawned, "Board worker starts", "Runs when a worker of the board starts", GroupBoard}, {hooks.KanbanWorkerExited, "Board worker exits", "Runs when a worker of the board exits", GroupBoard}, {hooks.KanbanWorkerStaleClaim, "Board worker stalls", "Runs when a worker holds a task too long", GroupBoard}, {hooks.KanbanDispatchTick, "Board hands out tasks", "Runs each time the board hands out tasks", GroupBoard}, }
Events hooks and webhooks hear of under their headings, in the order a person is shown them, those hooks are set on most first