Documentation
¶
Overview ¶
Package bots binds saved profiles and scoped runtime tools to an actual chat. The daemon selects the profile; prompts and client arguments cannot grant a child bot access to another bot's configuration or conversations.
Index ¶
- func Instructions(bot registry.Bot) string
- func ToolHelper(ctx context.Context, args []string, out io.Writer) error
- type ChatExcerpt
- type Peer
- type PeerCheck
- type PeerIdentity
- type PeerRoute
- type Runtime
- type Service
- func (s *Service) Agents(actor registry.Bot) ([]registry.Agent, []registry.Project, error)
- func (s *Service) Bind(ctx context.Context, adapter agent.Adapter, turn runner.Turn) (runner.Turn, func(), error)
- func (s *Service) CancelTask(actor registry.Bot, botID, runID string) (Task, error)
- func (s *Service) CheckPeer(ctx context.Context, id string) (PeerCheck, error)
- func (s *Service) Close()
- func (s *Service) Delegate(actor registry.Bot, botID string, in TaskRequest) (Task, error)
- func (s *Service) Input(actor registry.Bot, botID, runID string, in TaskInput) (Task, error)
- func (s *Service) IsBotChat(chatID string) bool
- func (s *Service) PeerAuthorize(user string, key ssh.PublicKey) (string, bool)
- func (s *Service) PeerDirectoryReaders() []computer.PeerDirectoryReader
- func (s *Service) PeerIdentity() (PeerIdentity, error)
- func (s *Service) Peers() ([]Peer, error)
- func (s *Service) RemovePeer(id string) error
- func (s *Service) SavePeer(id string, input Peer) (Peer, error)
- func (s *Service) ScheduledTurn(chatID string, ...) (session.Run, error)
- func (s *Service) ServePeerChannel(id string, incoming ssh.NewChannel)
- func (s *Service) SetApps(apps *shortcuts.Service)
- func (s *Service) SetComputerPeerIdentity(identity func() (string, []PeerRoute))
- func (s *Service) SetPeerDiscovery(grant func(string) (*computer.PeerDiscoveryGrant, error), changed func())
- func (s *Service) SetRuntime(runtime Runtime)
- func (s *Service) StartPeerListener(port int) (PeerIdentity, error)
- func (s *Service) Task(actor registry.Bot, botID, runID string) (Task, error)
- func (s *Service) Tasks(actor registry.Bot, botID string) ([]Task, error)
- type Task
- type TaskInput
- type TaskInteraction
- type TaskRequest
- type TaskTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Instructions ¶
Types ¶
type ChatExcerpt ¶
type PeerIdentity ¶
type Runtime ¶
type Runtime interface {
StartBotTurn(botID string, chat registry.Chat, profile registry.Agent, project registry.Project, message, requestID string) (session.Run, error)
SendInputChecked(runID, text, requestID string, attachments []agent.Attachment) (session.Run, error)
Cancel(runID string) bool
BotRunSnapshot(runID string) (session.Run, []agent.Part, bool)
}
Runtime is the existing supervisor, never a second process runner or transcript store. Owner HTTP and per-run tools use exactly these task operations.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Bind ¶
func (s *Service) Bind(ctx context.Context, adapter agent.Adapter, turn runner.Turn) (runner.Turn, func(), error)
Bind leaves conversations without a bot unchanged. Bot settings are re-read for each turn; the current turn holds its own profile revision and scoped MCP capability.
func (*Service) CancelTask ¶
func (*Service) PeerAuthorize ¶
func (*Service) PeerDirectoryReaders ¶
func (s *Service) PeerDirectoryReaders() []computer.PeerDirectoryReader
PeerDirectoryReaders exposes public reader identities only. It does not add peers to the phone device registry or grant them the workspace API.
func (*Service) PeerIdentity ¶
func (s *Service) PeerIdentity() (PeerIdentity, error)
func (*Service) RemovePeer ¶
func (*Service) ScheduledTurn ¶ added in v0.1.55
func (s *Service) ScheduledTurn(chatID string, start func(registry.Chat, registry.Agent, registry.Project) (session.Run, error)) (session.Run, error)
A scheduled prompt resolves the same saved chat and profile as an owner send. It retains the native session, approvals, instructions and notification rules.
func (*Service) ServePeerChannel ¶
func (s *Service) ServePeerChannel(id string, incoming ssh.NewChannel)
ServePeerChannel is also plugged into the existing computer SSH server. It deliberately accepts no direct-tcpip, shell, owner API or approval-response channel.
func (*Service) SetComputerPeerIdentity ¶
A computer's existing SSH listener can carry the same peer-only channel. The callback supplies its pinned host identity/routes; no phone key is reused.
func (*Service) SetPeerDiscovery ¶
func (s *Service) SetPeerDiscovery(grant func(string) (*computer.PeerDiscoveryGrant, error), changed func())
func (*Service) SetRuntime ¶
func (*Service) StartPeerListener ¶
func (s *Service) StartPeerListener(port int) (PeerIdentity, error)
type Task ¶
type Task struct {
BotID string `json:"botId"`
ChatID string `json:"chatId"`
Run session.Run `json:"run"`
Messages []ChatExcerpt `json:"messages,omitempty"`
Output string `json:"output,omitempty"`
HistoryError string `json:"historyError,omitempty"`
Interactions []TaskInteraction `json:"interactions,omitempty"`
Tools []TaskTool `json:"tools,omitempty"`
CancelRequested *bool `json:"cancelRequested,omitempty"`
}