bots

package
v0.1.54 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 32 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 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instructions

func Instructions(bot registry.Bot) string

func ToolHelper

func ToolHelper(ctx context.Context, args []string, out io.Writer) error

ToolHelper gives command-based harnesses the same scoped tools, without the daemon's owner credential or persistent changes to native MCP configuration.

Types

type ChatExcerpt

type ChatExcerpt struct {
	Role      string `json:"role"`
	Text      string `json:"text"`
	CreatedAt string `json:"createdAt"`
}

type Peer

type Peer struct {
	WorkspaceID        string      `json:"workspaceId"`
	Name               string      `json:"name"`
	PublicKey          string      `json:"publicKey"`
	HostKeyFingerprint string      `json:"hostKeyFingerprint"`
	Routes             []PeerRoute `json:"routes"`
	Enabled            bool        `json:"enabled"`
}

type PeerCheck

type PeerCheck struct {
	WorkspaceID     string `json:"workspaceId"`
	Reachable       bool   `json:"reachable"`
	Error           string `json:"error,omitempty"`
	AddressRecovery bool   `json:"addressRecovery,omitempty"`
}

type PeerIdentity

type PeerIdentity struct {
	WorkspaceID        string      `json:"workspaceId"`
	PublicKey          string      `json:"publicKey"`
	HostKeyFingerprint string      `json:"hostKeyFingerprint"`
	Port               int         `json:"port,omitempty"`
	SSHPort            int         `json:"sshPort,omitempty"`
	Routes             []PeerRoute `json:"routes,omitempty"`
}

type PeerRoute

type PeerRoute struct {
	Kind string `json:"kind"`
	Host string `json:"host,omitempty"`
	Port int    `json:"port,omitempty"`
	URL  string `json:"url,omitempty"`
}

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 New

func New(db *registry.Store, history *session.Store, mutation *sync.Mutex) *Service

func (*Service) Agents

func (s *Service) Agents(actor registry.Bot) ([]registry.Agent, []registry.Project, error)

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 (s *Service) CancelTask(actor registry.Bot, botID, runID string) (Task, error)

func (*Service) CheckPeer

func (s *Service) CheckPeer(ctx context.Context, id string) (PeerCheck, error)

func (*Service) Close

func (s *Service) Close()

func (*Service) Delegate

func (s *Service) Delegate(actor registry.Bot, botID string, in TaskRequest) (Task, error)

func (*Service) Input

func (s *Service) Input(actor registry.Bot, botID, runID string, in TaskInput) (Task, error)

func (*Service) IsBotChat

func (s *Service) IsBotChat(chatID string) bool

func (*Service) PeerAuthorize

func (s *Service) PeerAuthorize(user string, key ssh.PublicKey) (string, bool)

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

func (s *Service) Peers() ([]Peer, error)

func (*Service) RemovePeer

func (s *Service) RemovePeer(id string) error

func (*Service) SavePeer

func (s *Service) SavePeer(id string, input Peer) (Peer, error)

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

func (s *Service) SetApps(apps *shortcuts.Service)

func (*Service) SetComputerPeerIdentity

func (s *Service) SetComputerPeerIdentity(identity func() (string, []PeerRoute))

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 (s *Service) SetRuntime(runtime Runtime)

func (*Service) StartPeerListener

func (s *Service) StartPeerListener(port int) (PeerIdentity, error)

func (*Service) Task

func (s *Service) Task(actor registry.Bot, botID, runID string) (Task, error)

func (*Service) Tasks

func (s *Service) Tasks(actor registry.Bot, botID string) ([]Task, 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"`
}

type TaskInput

type TaskInput struct {
	RequestID string `json:"requestId"`
	Message   string `json:"message"`
}

type TaskInteraction

type TaskInteraction struct {
	ID            string `json:"id"`
	Kind          string `json:"kind"`
	Title         string `json:"title,omitempty"`
	Detail        string `json:"detail,omitempty"`
	NeedsResponse bool   `json:"needsResponse"`
}

type TaskRequest

type TaskRequest struct {
	RequestID string `json:"requestId"`
	Message   string `json:"message"`
	ChatID    string `json:"chatId,omitempty"`
	Title     string `json:"title,omitempty"`
	ProjectID string `json:"projectId,omitempty"`
}

type TaskTool

type TaskTool struct {
	Name   string `json:"name"`
	Status string `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

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