Documentation
¶
Index ¶
- Variables
- func AddUser(ctx context.Context, store *state.Store, email, password string) error
- func AttachTerminal(ctx context.Context, home, id string, since uint64) (*websocket.Conn, error)
- func BinaryTag() string
- func BindLocalAccount(ctx context.Context, store *state.Store, email string) error
- func CheckTailnet(ctx context.Context) error
- func ConfigureDetached(command *exec.Cmd)
- func ConsoleSize(input, _ *os.File) (int, int, error)
- func ConversationAnswerElicitation(ctx context.Context, home, sessionID, elicitationID, value string) error
- func ConversationAnswerPermission(ctx context.Context, home, sessionID, requestID, optionID string) error
- func ConversationLog(ctx context.Context, home, sessionID string, since int64) ([]acp.LogEntry, error)
- func ConversationPrompt(ctx context.Context, home, sessionID, text string) error
- func ConversationPromptImages(ctx context.Context, home, sessionID, text string, images []acp.PromptImage) error
- func DisableUser(ctx context.Context, store *state.Store, email string) error
- func EnsureNode(ctx context.Context, home, executable string) error
- func FetchCache(ctx context.Context, home string, pkg lockfile.Package, destination string) error
- func FolderIdentity(directory string) (string, error)
- func ForgetRecent(home string, info SessionInfo) error
- func GatewayEnabled(home string) (bool, error)
- func GatewayURL(home string) (string, error)
- func HideSession(ctx context.Context, home, id string) (bool, error)
- func NodeRequest(ctx context.Context, home, method, path string, body ...io.Reader) ([]byte, error)
- func NodeRequestStream(ctx context.Context, home, method, path string, dst io.Writer, maxBytes int64) error
- func PrepareArchive(ctx context.Context, home string) (result error)
- func PrepareMeshJoin(ctx context.Context, store *state.Store, peer string) error
- func RecordSessionEnvironment(home, id, digest string) error
- func RegisterPresence(home, version string, info SessionInfo, process *os.Process) (func(), error)
- func ResetOwner(ctx context.Context, store *state.Store, home string) error
- func RestartWorker(ctx context.Context, home, id, operationID string) error
- func RunMCPBridge(ctx context.Context, options MCPBridgeOptions) (int, error)
- func RunTerminal(ctx context.Context, home, id string, input *os.File, output io.Writer) (code int, result error)
- func RunWorker(ctx context.Context, home, version string, launch WorkerLaunch, ...) (code int, result error)
- func ServeGateway(ctx context.Context, options GatewayOptions) (result error)
- func SessionEnvironment(home, id string) (string, error)
- func SetGatewayEnabled(home string, enabled bool) error
- func SetPassword(ctx context.Context, store *state.Store, email, password string) error
- func SignalConsole(uint32) error
- func StartWorker(ctx context.Context, home, executable string, launch WorkerLaunch) (string, error)
- func StopGateway(ctx context.Context, home string) error
- func StopWorker(ctx context.Context, home, id string) error
- func TerminalReplayTail(ctx context.Context, home, sessionID string, maxBytes int) (string, error)
- func TraceEvents(ctx context.Context, home, trace string, all bool) ([]obs.Event, error)
- func WaitForGateway(ctx context.Context, home string) error
- func WebAssets() http.Handler
- func WithPeerCache(ctx context.Context, home string) context.Context
- func WorktreeMain(ctx context.Context, home, dir string) (string, error)
- func WriteSharingConfig(store *state.Store, config SharingConfig) error
- type AccountStatus
- type Actor
- type AgentCapabilities
- type AgentPromptCapabilities
- type AgentSession
- type AgentSessionCapabilities
- type Attachment
- type Catalog
- type CatalogItem
- type CatalogSource
- type ConversationSession
- func (session *ConversationSession) AgentCapabilitiesView() *AgentCapabilities
- func (session *ConversationSession) AgentExited() bool
- func (session *ConversationSession) AnswerElicitation(ctx context.Context, elicitationID, value string) error
- func (session *ConversationSession) AnswerPermission(ctx context.Context, requestID, optionID string) error
- func (session *ConversationSession) Attach(since int64) (entries []acp.LogEntry, truncated bool)
- func (session *ConversationSession) BypassingPermissions() bool
- func (session *ConversationSession) Cancel(ctx context.Context) error
- func (session *ConversationSession) CancelSubagent(ctx context.Context, id string) error
- func (session *ConversationSession) ClearGoal(ctx context.Context) error
- func (session *ConversationSession) ConfigJSON() json.RawMessage
- func (session *ConversationSession) ConversationState() string
- func (session *ConversationSession) EditQueued(id, text string) error
- func (session *ConversationSession) Prompt(ctx context.Context, input acp.PromptInput) (result error)
- func (session *ConversationSession) RemoveQueued(id string) error
- func (session *ConversationSession) ResumeTurns()
- func (session *ConversationSession) RevertTurn(turn int) (int, int, error)
- func (session *ConversationSession) SetAgentCapabilities(capabilities *AgentCapabilities)
- func (session *ConversationSession) SetConfigOption(ctx context.Context, key string, value json.RawMessage) error
- func (session *ConversationSession) SetConfigOptions(raw json.RawMessage)
- func (session *ConversationSession) SetGoal(ctx context.Context, objective, checks string, limits *GoalLimits) error
- func (session *ConversationSession) SetModes(raw json.RawMessage)
- func (session *ConversationSession) SetStateChange(persistedState string, callback func(string))
- func (session *ConversationSession) SetUnpromptedUsageSettle(delay time.Duration)
- func (session *ConversationSession) SteerQueued(ctx context.Context, id string) error
- func (session *ConversationSession) Submit(ctx context.Context, input acp.PromptInput, steer bool) (queueID string, first <-chan error, err error)
- func (session *ConversationSession) UpdateGoal(ctx context.Context, change GoalChange) error
- type Gateway
- type GatewayMCP
- type GatewayOptions
- type Goal
- type GoalChange
- type GoalLimits
- type LibraryOptions
- type MCPBridgeOptions
- type MCPCredentialInfo
- type MCPServerInput
- type ProjectContents
- type ProjectGit
- type ProjectLaunch
- type ProjectMCP
- type ProjectMode
- type ProjectPackage
- type ProjectRow
- type RecentFolder
- type Replay
- type SaveAgentpackInput
- type SavedAgentpack
- type Session
- func (session *Session) Attach(local bool, since uint64) (*Attachment, Replay, error)
- func (session *Session) AttachmentError(attachment *Attachment) error
- func (session *Session) Detach(attachment *Attachment)
- func (session *Session) MarkRestarting() error
- func (session *Session) Resize(attachment *Attachment, rows, columns uint16) error
- func (session *Session) State() TerminalState
- func (session *Session) Stop(ctx context.Context) error
- func (session *Session) Wait(ctx context.Context) (int, error)
- func (session *Session) WriteInput(attachment *Attachment, data []byte) error
- type SessionInfo
- type SharingConfig
- type SubagentSummary
- type TailnetNode
- type TerminalOutput
- type TerminalState
- type User
- type WorkerHTTP
- type WorkerLaunch
- type WorkerRecord
Constants ¶
This section is empty.
Variables ¶
var ( ErrLocalResize = errors.New("only the local terminal may resize the shared grid") ErrSessionEnded = errors.New("terminal session has ended") ErrSlowObserver = errors.New("terminal observer fell behind; reconnect to recover available history") ErrUnsupportedTerminal = errors.New("terminal sharing is not supported on this platform") )
var ErrGatewayDisabled = errors.New("gateway is stopped; run agentpack gateway start to enable sharing")
Functions ¶
func AttachTerminal ¶ added in v0.13.0
AttachTerminal opens a local-viewer connection to an existing worker without taking ownership of it.
func BinaryTag ¶ added in v0.14.1
func BinaryTag() string
BinaryTag identifies the running agentpack executable. Environment digests depend on staging code, so a digest is only comparable with one computed by the same binary; dev builds of a dirty tree share a commit, so the file's own identity is used.
func BindLocalAccount ¶ added in v0.14.0
func CheckTailnet ¶
CheckTailnet verifies the machine can use local Tailscale identity services.
func ConfigureDetached ¶
ConfigureDetached isolates workers from the launching terminal's lifetime.
func ConversationAnswerElicitation ¶ added in v0.13.0
func ConversationAnswerElicitation(ctx context.Context, home, sessionID, elicitationID, value string) error
ConversationAnswerElicitation forwards an elicitation answer to the session worker.
func ConversationAnswerPermission ¶ added in v0.13.0
func ConversationAnswerPermission(ctx context.Context, home, sessionID, requestID, optionID string) error
ConversationAnswerPermission forwards a permission answer to the session worker.
func ConversationLog ¶ added in v0.13.0
func ConversationLog(ctx context.Context, home, sessionID string, since int64) ([]acp.LogEntry, error)
ConversationLog reads the worker conversation NDJSON log for a local session.
func ConversationPrompt ¶ added in v0.13.0
ConversationPrompt sends a text prompt to the session worker.
func ConversationPromptImages ¶ added in v0.13.0
func ConversationPromptImages(ctx context.Context, home, sessionID, text string, images []acp.PromptImage) error
ConversationPromptImages sends a prompt with stored image attachments to the session worker.
func DisableUser ¶ added in v0.14.0
func FetchCache ¶ added in v0.14.0
func FolderIdentity ¶
func ForgetRecent ¶
func ForgetRecent(home string, info SessionInfo) error
func GatewayEnabled ¶
func GatewayURL ¶
func HideSession ¶ added in v0.14.1
HideSession archives a stopped session from the user's view: it leaves every list on the mesh, and its history stays in place until the hourly mover takes it to the archive like any other idle chat.
func NodeRequest ¶
func NodeRequestStream ¶ added in v0.13.0
func NodeRequestStream(ctx context.Context, home, method, path string, dst io.Writer, maxBytes int64) error
NodeRequestStream writes a successful node response to dst, stopping after maxBytes.
func PrepareArchive ¶ added in v0.14.0
PrepareArchive verifies copied attachments, fetching missing ones through the local gateway when it is running.
func PrepareMeshJoin ¶ added in v0.14.0
PrepareMeshJoin closes the claim window before the local operator approves a peer. A failed enrollment leaves it closed; repeating the same join safely retries.
func RegisterPresence ¶
func RegisterPresence(home, version string, info SessionInfo, process *os.Process) (func(), error)
RegisterPresence advertises a native-stdio launch without changing its pipes. Its process is owned by the caller; the node only receives public metadata.
func ResetOwner ¶ added in v0.14.0
func RunMCPBridge ¶ added in v0.14.1
func RunMCPBridge(ctx context.Context, options MCPBridgeOptions) (int, error)
RunMCPBridge serves the harness until it closes standard input.
The ID "chat:<session>" serves a chat's own agentpack tools to an agent that only takes stdio MCP servers; the bearer comes from the chat's private token file, never from the command line.
func RunTerminal ¶
func RunTerminal(ctx context.Context, home, id string, input *os.File, output io.Writer) (code int, result error)
RunTerminal attaches directly to the worker, so gateway shutdown cannot interrupt the local terminal. Local and browser input share the same PTY. Closing the launching terminal stops its worker, including during reconnect.
func RunWorker ¶
func RunWorker(ctx context.Context, home, version string, launch WorkerLaunch, ready func(string) error) (code int, result error)
RunWorker owns a restartable PTY independently of a gateway. ready receives only the non-secret worker ID, which survives supervised child restarts.
func ServeGateway ¶
func ServeGateway(ctx context.Context, options GatewayOptions) (result error)
func SessionEnvironment ¶
SessionEnvironment records only the effective content hash, never configuration or credentials. A digest recorded by another binary reads as absent, so an update never looks like a package change.
func SetGatewayEnabled ¶
func SetPassword ¶ added in v0.14.0
func SignalConsole ¶
func StartWorker ¶
func StopGateway ¶ added in v0.14.1
StopGateway asks the gateway to stop and waits until its process has exited, which it shows by releasing gateway.lock; its listener closes earlier, so a start right after could still collide.
func StopWorker ¶
StopWorker stops a session's worker. One whose endpoint file is gone has already exited, so stopping it again succeeds.
func TerminalReplayTail ¶ added in v0.13.0
TerminalReplayTail returns up to maxBytes from the end of the worker PTY replay.
func TraceEvents ¶ added in v0.14.0
TraceEvents keeps offline CLI reads useful and adds the gateway's mesh view when it is running.
func WaitForGateway ¶ added in v0.14.1
WaitForGateway waits for the selected background launcher to publish a healthy endpoint.
func WebAssets ¶
WebAssets serves the embedded React build. webdist holds only a placeholder until `make ui-stage` copies ui/dist in.
func WithPeerCache ¶ added in v0.14.0
WithPeerCache adds an optional download source; it opens nothing on a cached launch.
func WorktreeMain ¶ added in v0.14.1
WorktreeMain is worktreeMain for the CLI's remote-start check.
func WriteSharingConfig ¶
func WriteSharingConfig(store *state.Store, config SharingConfig) error
Types ¶
type AccountStatus ¶ added in v0.14.0
type AccountStatus struct {
Joining bool `json:"joining,omitempty"`
Claimed bool `json:"claimed"`
Legacy bool `json:"legacy"`
Authenticated bool `json:"authenticated"`
Email string `json:"email"`
}
func GatewayAccountStatus ¶ added in v0.14.0
func GatewayAccountStatus(ctx context.Context, home string) (AccountStatus, error)
type Actor ¶ added in v0.12.0
type Actor struct {
Kind string `json:"kind"`
Account bool `json:"account,omitempty"`
User string `json:"user,omitempty"`
Node string `json:"node,omitempty"`
StableNodeID string `json:"stable_node_id,omitempty"` // Verified tailnet identity; Node is the display name.
// Agent is the harness of the chat that acted for this user through agentpack tools.
Agent string `json:"agent,omitempty"`
// contains filtered or unexported fields
}
Actor is who started or called an operation. It comes from the transport: the local OS user, the gateway's browser account, or a verified tailnet whois. Caller-provided identities have no authority; forwarded accounts require verified mesh membership.
func LocalActor ¶ added in v0.12.0
LocalActor is the OS user running this process on this machine.
type AgentCapabilities ¶ added in v0.13.0
type AgentCapabilities struct {
LoadSession bool `json:"loadSession,omitempty"`
PromptCapabilities *AgentPromptCapabilities `json:"promptCapabilities,omitempty"`
SessionCapabilities *AgentSessionCapabilities `json:"sessionCapabilities,omitempty"`
}
type AgentPromptCapabilities ¶ added in v0.13.0
type AgentPromptCapabilities struct {
Image bool `json:"image,omitempty"`
}
type AgentSession ¶ added in v0.13.0
type AgentSession struct {
NodeID string `json:"node_id,omitempty"`
Reachable bool `json:"reachable"`
ID string `json:"id"`
Title string `json:"title,omitempty"`
Cwd string `json:"cwd,omitempty"`
}
AgentSession is one resumable agent-side conversation from session/list.
func ListAgentSessions ¶ added in v0.13.0
func ListAgentSessions(ctx context.Context, home, directory, harness, definitionRoot, modeName string) ([]AgentSession, error)
ListAgentSessions probes the harness ACP adapter for prior sessions in a workspace.
type AgentSessionCapabilities ¶ added in v0.13.0
type AgentSessionCapabilities struct {
Resume *struct{} `json:"resume,omitempty"`
Fork *struct{} `json:"fork,omitempty"`
}
type Attachment ¶
type Attachment struct {
ID uint64
Ready <-chan struct{}
// contains filtered or unexported fields
}
func (*Attachment) ReadOutput ¶ added in v0.11.2
func (attachment *Attachment) ReadOutput() ([]byte, bool)
ReadOutput drains queued bytes after Ready is signaled, preserving order across bursts.
type Catalog ¶ added in v0.14.1
type Catalog struct {
Items []CatalogItem `json:"items"`
Sources []CatalogSource `json:"sources"`
}
type CatalogItem ¶ added in v0.14.1
type CatalogItem struct {
Kind string `json:"kind"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Publisher string `json:"publisher,omitempty"`
Source string `json:"source"`
Spec string `json:"spec,omitempty"`
Command string `json:"command,omitempty"`
Server *MCPServerInput `json:"server,omitempty"`
URL string `json:"url,omitempty"`
}
CatalogItem is one installable entry from a trusted marketplace or the MCP Registry. Plugins carry an add Spec; MCP servers carry the Server that POST /api/mcp/servers installs and the equivalent `agentpack mcp add` Command.
type CatalogSource ¶ added in v0.14.1
type ConversationSession ¶ added in v0.13.0
type ConversationSession struct {
// contains filtered or unexported fields
}
ConversationSession is the worker-side ACP conversation view.
func NewConversationSession ¶ added in v0.13.0
func NewConversationSession(log *acp.EventLog, broker *acp.Broker) *ConversationSession
func (*ConversationSession) AgentCapabilitiesView ¶ added in v0.13.0
func (session *ConversationSession) AgentCapabilitiesView() *AgentCapabilities
func (*ConversationSession) AgentExited ¶ added in v0.13.0
func (session *ConversationSession) AgentExited() bool
func (*ConversationSession) AnswerElicitation ¶ added in v0.13.0
func (session *ConversationSession) AnswerElicitation(ctx context.Context, elicitationID, value string) error
func (*ConversationSession) AnswerPermission ¶ added in v0.13.0
func (session *ConversationSession) AnswerPermission(ctx context.Context, requestID, optionID string) error
func (*ConversationSession) Attach ¶ added in v0.13.0
func (session *ConversationSession) Attach(since int64) (entries []acp.LogEntry, truncated bool)
func (*ConversationSession) BypassingPermissions ¶ added in v0.14.1
func (session *ConversationSession) BypassingPermissions() bool
BypassingPermissions reports whether the agent's current mode is one where the user is never asked.
func (*ConversationSession) Cancel ¶ added in v0.13.0
func (session *ConversationSession) Cancel(ctx context.Context) error
Cancel is the user's Stop: it ends the running turn and pauses an active goal.
func (*ConversationSession) CancelSubagent ¶ added in v0.14.1
func (session *ConversationSession) CancelSubagent(ctx context.Context, id string) error
CancelSubagent stops one announced subagent session; the parent turn keeps running.
func (*ConversationSession) ClearGoal ¶ added in v0.14.1
func (session *ConversationSession) ClearGoal(ctx context.Context) error
func (*ConversationSession) ConfigJSON ¶ added in v0.13.0
func (session *ConversationSession) ConfigJSON() json.RawMessage
func (*ConversationSession) ConversationState ¶ added in v0.13.0
func (session *ConversationSession) ConversationState() string
func (*ConversationSession) EditQueued ¶ added in v0.14.1
func (session *ConversationSession) EditQueued(id, text string) error
func (*ConversationSession) Prompt ¶ added in v0.13.0
func (session *ConversationSession) Prompt(ctx context.Context, input acp.PromptInput) (result error)
func (*ConversationSession) RemoveQueued ¶ added in v0.14.1
func (session *ConversationSession) RemoveQueued(id string) error
func (*ConversationSession) ResumeTurns ¶ added in v0.14.1
func (session *ConversationSession) ResumeTurns()
ResumeTurns delivers prompts a restarted worker found queued, and continues an active goal.
func (*ConversationSession) RevertTurn ¶ added in v0.14.1
func (session *ConversationSession) RevertTurn(turn int) (int, int, error)
RevertTurn undoes the file edits of one turn, or changes nothing and says why. The status is the HTTP code for a refusal.
func (*ConversationSession) SetAgentCapabilities ¶ added in v0.13.0
func (session *ConversationSession) SetAgentCapabilities(capabilities *AgentCapabilities)
func (*ConversationSession) SetConfigOption ¶ added in v0.13.0
func (session *ConversationSession) SetConfigOption(ctx context.Context, key string, value json.RawMessage) error
func (*ConversationSession) SetConfigOptions ¶ added in v0.13.0
func (session *ConversationSession) SetConfigOptions(raw json.RawMessage)
func (*ConversationSession) SetGoal ¶ added in v0.14.1
func (session *ConversationSession) SetGoal(ctx context.Context, objective, checks string, limits *GoalLimits) error
SetGoal replaces the goal and starts working on it.
func (*ConversationSession) SetModes ¶ added in v0.13.0
func (session *ConversationSession) SetModes(raw json.RawMessage)
func (*ConversationSession) SetStateChange ¶ added in v0.13.0
func (session *ConversationSession) SetStateChange(persistedState string, callback func(string))
func (*ConversationSession) SetUnpromptedUsageSettle ¶ added in v0.14.1
func (session *ConversationSession) SetUnpromptedUsageSettle(delay time.Duration)
SetUnpromptedUsageSettle enables closing an unprompted cycle with a synthetic turn_end once a parent usage_update stays quiet for delay (longer after thought-only steps).
func (*ConversationSession) SteerQueued ¶ added in v0.14.1
func (session *ConversationSession) SteerQueued(ctx context.Context, id string) error
SteerQueued moves a queued prompt to the front and interrupts the running turn so it goes next.
func (*ConversationSession) Submit ¶ added in v0.14.1
func (session *ConversationSession) Submit(ctx context.Context, input acp.PromptInput, steer bool) (queueID string, first <-chan error, err error)
Submit sends input now, or queues it behind the running turn and returns its queue ID. A steer goes to the front of the queue and interrupts the running turn. When the prompt starts immediately, first receives the result of its turn.
func (*ConversationSession) UpdateGoal ¶ added in v0.14.1
func (session *ConversationSession) UpdateGoal(ctx context.Context, change GoalChange) error
type GatewayMCP ¶
type GatewayMCP struct {
// contains filtered or unexported fields
}
func NewGatewayMCP ¶
func NewGatewayMCP(gateway *Gateway) (*GatewayMCP, error)
func (*GatewayMCP) ServeHTTP ¶
func (m *GatewayMCP) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GatewayOptions ¶
type GatewayOptions struct {
Home, Address, PublicURL string
Start func(context.Context, SessionInfo, string) (string, error)
Packages func(context.Context, string) (ProjectContents, error)
Install func(context.Context, string, string, bool) error
InstallMCP func(context.Context, string, MCPServerInput, bool) error
Update func(ctx context.Context, version string) error
Library LibraryOptions
Assets http.Handler
Version string
UIBuildID string
}
type Goal ¶ added in v0.14.1
type Goal struct {
Objective string `json:"objective"`
Checks string `json:"checks,omitempty"`
State string `json:"state"` // active, paused, blocked, limited, met or cleared
Engine string `json:"engine"` // native (the agent's /goal command) or gateway (this worker's loop)
StartedAt int64 `json:"started_at"`
ActiveMS int64 `json:"active_ms"` // active time before the current active stretch
ResumedAt int64 `json:"resumed_at,omitempty"` // set only while active
Turns int `json:"turns"`
LastReason string `json:"last_reason,omitempty"`
Limits *GoalLimits `json:"limits,omitempty"`
UpdatedAt int64 `json:"updated_at"`
}
Goal is a standing objective the agent works toward across turns. Every change is logged as goal_update and saved on the session row, so every viewer and peer sees the same goal.
type GoalChange ¶ added in v0.14.1
type GoalChange struct {
Action string `json:"action"`
Objective *string `json:"objective"`
Checks *string `json:"checks"`
Limits *GoalLimits `json:"limits"`
}
GoalChange is a PATCH: an action (pause or resume), or new objective, checks or limits.
type GoalLimits ¶ added in v0.14.1
type LibraryOptions ¶ added in v0.9.0
type LibraryOptions struct {
Store *registry.Store
Bootstrap func() error
Save func(context.Context, SaveAgentpackInput) (SavedAgentpack, error)
Preview func(context.Context, string, string, string) (registry.DiffResult, error)
Restore func(context.Context, string, string, string, bool) error
DraftState func(context.Context, registry.Draft) (registry.DraftState, error)
}
type MCPBridgeOptions ¶ added in v0.14.1
type MCPBridgeOptions struct {
Home, ID, URL string
SSE bool
Headers map[string]string
Command []string
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
}
MCPBridgeOptions is one `agentpack mcp-bridge` run: a stdio MCP server for the harness that adds a stored credential, fetched from the local gateway, to a remote server's requests (URL) or a local server's environment (Command).
type MCPCredentialInfo ¶ added in v0.14.1
type MCPCredentialInfo struct {
ID string `json:"id"`
Match string `json:"match,omitempty"`
Kind string `json:"kind"`
Label string `json:"label"`
Account string `json:"account"`
Status string `json:"status"`
Names []string `json:"names,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitzero"`
Issuer string `json:"issuer,omitempty"`
CreatedNode string `json:"created_node,omitempty"`
CreatedAt time.Time `json:"created_at"`
Plugins []string `json:"plugins"`
}
MCPCredentialInfo is what lists show: names of headers and variables, never values.
type MCPServerInput ¶ added in v0.14.1
type MCPServerInput struct {
Name string `json:"name"`
Command string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
URL string `json:"url,omitempty"`
Type string `json:"type,omitempty"`
}
MCPServerInput is what `agentpack mcp add` takes: a Command with Args, or a URL with a Type.
type ProjectContents ¶ added in v0.12.0
type ProjectContents struct {
Packages []ProjectPackage `json:"packages"`
MCP []ProjectMCP `json:"mcp"`
Modes []ProjectMode `json:"modes"`
}
ProjectContents is one folder's pack.lock as a node reports it.
type ProjectGit ¶ added in v0.14.1
type ProjectLaunch ¶ added in v0.12.0
type ProjectMCP ¶ added in v0.12.0
type ProjectMCP struct {
Name string `json:"name"`
Source string `json:"source"`
Launcher string `json:"launcher"`
Status string `json:"status"`
Package string `json:"package"`
Version string `json:"version"`
Integrity string `json:"integrity"`
Host string `json:"host"`
Reason string `json:"reason"`
// URL is set for a remote server that a shared MCP login can serve (mcp.LoginURL).
URL string `json:"url,omitempty"`
}
type ProjectMode ¶ added in v0.14.1
type ProjectMode struct {
Name string `json:"name"`
OffPackages []string `json:"off_packages"`
PartialPackages []string `json:"partial_packages"`
OffMCP []string `json:"off_mcp"`
}
ProjectMode names one mode and what it turns off; selectors themselves stay on the node.
type ProjectPackage ¶ added in v0.12.0
type ProjectRow ¶ added in v0.12.0
type ProjectRow struct {
Directory string `json:"directory"`
Name string `json:"name"`
FolderID string `json:"folder_id"`
Available bool `json:"available"`
LastUsed time.Time `json:"last_used"`
Launches []ProjectLaunch `json:"launches"`
Packages []ProjectPackage `json:"packages"`
MCP []ProjectMCP `json:"mcp"`
Modes []ProjectMode `json:"modes"`
Error string `json:"error"`
// Git is the folder's checkout state; absent when it is not a repository or git is missing.
Git *ProjectGit `json:"git,omitempty"`
}
ProjectRow is one folder. Launches are unique per harness and mode, newest first.
func Projects ¶ added in v0.12.0
func Projects(ctx context.Context, home string, contents func(context.Context, string) (ProjectContents, error)) ([]ProjectRow, error)
Projects groups recent launches by cleaned directory. Contents are read only for available folders, at most projectReadConcurrency at a time; a failed read sets Error on that row alone.
type RecentFolder ¶
type RecentFolder struct {
SessionInfo
Available bool `json:"available"`
}
func RecentFolders ¶
func RecentFolders(home string) ([]RecentFolder, error)
Availability is current filesystem state, never a persisted authorization grant.
type Replay ¶
Replay is a byte stream, not a terminal screen snapshot. Offset > 0 means earlier bytes were discarded, including potentially required ANSI state.
type SaveAgentpackInput ¶ added in v0.9.0
type SavedAgentpack ¶ added in v0.9.0
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session owns a single child and PTY. Gateway handlers only attach to it; closing an attachment never signals the child.
func (*Session) Attach ¶
Attach atomically captures history and subscribes to all subsequent bytes. Only the private local transport may identify an attachment as local. Replay starts at since while that byte is still buffered; otherwise it is the whole buffer.
func (*Session) AttachmentError ¶
func (session *Session) AttachmentError(attachment *Attachment) error
func (*Session) Detach ¶
func (session *Session) Detach(attachment *Attachment)
func (*Session) MarkRestarting ¶
MarkRestarting lets attachments distinguish a supervised restart from an exit.
func (*Session) Resize ¶
func (session *Session) Resize(attachment *Attachment, rows, columns uint16) error
func (*Session) State ¶
func (session *Session) State() TerminalState
func (*Session) WriteInput ¶
func (session *Session) WriteInput(attachment *Attachment, data []byte) error
type SessionInfo ¶
type SessionInfo struct {
NodeID string `json:"node_id,omitempty"`
Reachable bool `json:"reachable"`
LastSync time.Time `json:"last_sync,omitzero"`
EndedAt time.Time `json:"ended_at,omitzero"`
ArchivedAt time.Time `json:"archived_at,omitzero"`
LastUsed time.Time `json:"last_used,omitzero"`
LastEventAt time.Time `json:"last_event_at,omitzero"`
FolderID string `json:"folder_id,omitempty"`
ID string `json:"id"`
Name string `json:"name,omitempty"`
Title string `json:"title,omitempty"`
Directory string `json:"directory"`
DefinitionRoot string `json:"definition_root,omitempty"`
Harness string `json:"harness"`
Mode string `json:"mode"`
Transport string `json:"transport,omitempty"`
AgentSessionID string `json:"agent_session_id,omitempty"`
AgentCapabilities *AgentCapabilities `json:"agent_capabilities,omitempty"`
ConversationState string `json:"conversation_state,omitempty"`
State TerminalState `json:"state"`
StartedAt time.Time `json:"started_at,omitzero"`
StartedBy *Actor `json:"started_by,omitempty"`
Goal *Goal `json:"goal,omitempty"`
Subagents []SubagentSummary `json:"subagents,omitempty"`
// ParentID is the chat whose agent started this helper session.
ParentID string `json:"parent_id,omitempty"`
// Tools lets the chat's agent call the agentpack MCP server.
Tools bool `json:"tools,omitempty"`
// WorktreeOf is the main folder of the agentpack worktree Directory is in. Older peers omit it.
WorktreeOf string `json:"worktree_of,omitempty"`
}
func Recent ¶
func Recent(home string) ([]SessionInfo, error)
func RenameSession ¶ added in v0.9.3
func RenameSession(ctx context.Context, home, id, name string) (SessionInfo, error)
type SharingConfig ¶
SharingConfig contains explicit machine/tag exceptions to personal identity. It does not change Tailscale ACLs or expose anything outside the tailnet.
func ReadSharingConfig ¶
func ReadSharingConfig(store *state.Store, home string) (SharingConfig, error)
ReadSharingConfig defaults to sharing on, like Agentnet's tailnet discovery: peers still need your own untagged identity or an explicit allow entry.
type SubagentSummary ¶ added in v0.14.1
type SubagentSummary struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
State string `json:"state"` // running, requires_action or unknown
StartedAt int64 `json:"started_at"`
}
SubagentSummary is a subagent that is still doing something, shown in the session sidebar.
type TailnetNode ¶
type TailnetNode struct {
Main bool `json:"main"`
ID string `json:"id"`
Name string `json:"name"`
Address string `json:"-"`
Online bool `json:"online"`
NeedsUpdate bool `json:"needs_update,omitempty"`
// Version is what a peer's /peer answer reports; empty from a peer that predates it.
Version string `json:"version,omitempty"`
Schema int `json:"schema_version,omitempty"`
}
type TerminalOutput ¶
type TerminalOutput struct {
Offset uint64 `json:"offset"`
NextOffset uint64 `json:"next_offset"`
Output string `json:"output"`
Truncated bool `json:"truncated"`
State TerminalState `json:"state"`
}
type TerminalState ¶
type TerminalState struct {
Interactive bool `json:"interactive"`
Running bool `json:"running"`
Restarting bool `json:"restarting"`
Responder uint64 `json:"responder,omitempty"`
Rows uint16 `json:"rows"`
Columns uint16 `json:"columns"`
ExitCode int `json:"exit_code"`
}
TerminalState contains no command arguments, environment, or credentials.
type User ¶ added in v0.14.0
type WorkerHTTP ¶
type WorkerHTTP struct {
// contains filtered or unexported fields
}
func WorkerHandler ¶
func WorkerHandler(ctx context.Context, session *Session, conversation *ConversationSession, secret, sessionDir string) (*WorkerHTTP, error)
WorkerHandler is private IPC. The gateway authenticates its own callers, then attaches using this worker's secret. Never expose the secret to browsers.
func (*WorkerHTTP) Restart ¶
func (worker *WorkerHTTP) Restart(ctx context.Context, operationID string) (result error)
Restart keeps the private endpoint stable while replacing the agent process. Terminal attachments reconnect to the new PTY; ACP clients retain the worker endpoint.
func (*WorkerHTTP) ServeHTTP ¶
func (worker *WorkerHTTP) ServeHTTP(w http.ResponseWriter, r *http.Request)
type WorkerLaunch ¶
type WorkerLaunch struct {
Session SessionInfo `json:"session"`
Transport string `json:"transport,omitempty"`
ForkSessionID string `json:"fork_session_id,omitempty"`
Program string `json:"program"`
Arguments []string `json:"arguments"`
Directory string `json:"directory"`
Environment []string `json:"environment"`
Rows uint16 `json:"rows"`
Columns uint16 `json:"columns"`
// contains filtered or unexported fields
}
WorkerLaunch is delivered through a private startup pipe, never HTTP or disk. Launching agentpack itself here keeps staging, auth and cleanup in the CLI.
type WorkerRecord ¶
type WorkerRecord struct {
Session SessionInfo `json:"session,omitzero"`
ID string `json:"id"`
PID int `json:"pid"`
Address string `json:"address"`
Secret string `json:"secret"`
}
WorkerRecord is private connection material, readable only by the local OS user. Public node listings must use a separate allowlisted session view.
Source Files
¶
- acp_session_owners.go
- agent_credentials.go
- agent_login.go
- agent_sessions.go
- archive.go
- archive_blobs.go
- archive_reads.go
- assets.go
- auth.go
- auth_accounts.go
- auth_limiter.go
- blob_transfer.go
- cache_transfer.go
- client.go
- console_unix.go
- conversation.go
- conversation_blobs.go
- conversation_cancel_subagent.go
- conversation_client.go
- conversation_config_store.go
- conversation_events.go
- conversation_goal.go
- conversation_prompt.go
- conversation_queue.go
- conversation_retry.go
- conversation_revert.go
- conversation_store.go
- conversation_subagents.go
- discovery.go
- environment.go
- etag.go
- events.go
- folder_unix.go
- gateway.go
- gateway_agents.go
- gateway_goal.go
- gateway_limits.go
- gateway_logs.go
- gateway_observe.go
- gateway_omp.go
- gateway_settings.go
- gateway_telemetry.go
- identity.go
- library.go
- library_catalog.go
- library_drafts.go
- lifecycle.go
- locations.go
- log_forward.go
- machine.go
- machine_linux.go
- mcp.go
- mcp_bridge.go
- mcp_chat.go
- mcp_credentials.go
- mcp_credentials_oauth.go
- mcp_worker.go
- mesh_reads.go
- oauth.go
- oauth_store.go
- presence.go
- projects.go
- public.go
- push.go
- recent.go
- release.go
- replication.go
- session.go
- session_name.go
- session_start.go
- session_store.go
- sync.go
- sync_transfer.go
- terminal_client.go
- terminal_output_client.go
- terminal_unix.go
- topology.go
- usage.go
- worker.go
- worker_acp.go
- worker_files.go
- worker_http.go
- worker_http_conversation.go
- worker_http_queue.go
- worker_observe.go
- worker_reap.go
- worker_reap_unix.go
- worker_record_patch.go
- worktree.go
- worktree_routes.go