Versions in this module Expand all Collapse all v0 v0.1.1 Aug 6, 2026 v0.1.0 Aug 5, 2026 Changes in this version + const ForkSessionMethod + const RawEventMethod + const SessionStoreFormat + const SessionStoreMainSubpath + var ErrProcessContainmentIncomplete = internalpi.ErrProcessContainmentIncomplete + func CallForkSession(ctx context.Context, conn *acp.ClientSideConnection, ...) (acp.UnstableForkSessionResponse, error) + func CancelRequest(sessionID acp.SessionId, turnNonce string) acp.CancelNotification + func DeleteSessionRequest(sessionID acp.SessionId) acp.UnstableDeleteSessionRequest + func ForkSessionRequest(sessionID acp.SessionId, cwd string, opts ...SessionRequestOption) acp.UnstableForkSessionRequest + func HTTPMCPServer(name string, url string, headers map[string]string) acp.McpServer + func ListSessionsRequest(opts ...ListSessionsRequestOption) acp.ListSessionsRequest + func LoadSessionRequest(sessionID acp.SessionId, cwd string, opts ...SessionRequestOption) acp.LoadSessionRequest + func NewSessionRequest(cwd string, opts ...SessionRequestOption) acp.NewSessionRequest + func PromptRequest(sessionID acp.SessionId, turnNonce string, blocks ...acp.ContentBlock) acp.PromptRequest + func ResumeSessionRequest(sessionID acp.SessionId, cwd string, opts ...SessionRequestOption) acp.ResumeSessionRequest + func Serve(ctx context.Context, input io.Reader, output io.Writer, opts ...Option) (returnErr error) + func SetConfigOptionRequest(sessionID acp.SessionId, configID acp.SessionConfigId, ...) acp.SetSessionConfigOptionRequest + func SetModelRequest(sessionID acp.SessionId, model string) acp.SetSessionConfigOptionRequest + func StdioMCPServer(name string, command string, args []string, env map[string]string) acp.McpServer + func TextPromptRequest(sessionID acp.SessionId, turnNonce, text string) acp.PromptRequest + type Agent struct + func NewAgent(opts ...Option) *Agent + func (a *Agent) Authenticate(ctx context.Context, params acp.AuthenticateRequest) (resp acp.AuthenticateResponse, err error) + func (a *Agent) Cancel(ctx context.Context, params acp.CancelNotification) (err error) + func (a *Agent) Close() error + func (a *Agent) CloseSession(ctx context.Context, params acp.CloseSessionRequest) (resp acp.CloseSessionResponse, err error) + func (a *Agent) ContainmentMode() RuntimeContainmentMode + func (a *Agent) HandleExtensionMethod(ctx context.Context, method string, params json.RawMessage) (any, error) + func (a *Agent) Initialize(ctx context.Context, params acp.InitializeRequest) (resp acp.InitializeResponse, err error) + func (a *Agent) ListSessions(ctx context.Context, params acp.ListSessionsRequest) (resp acp.ListSessionsResponse, err error) + func (a *Agent) LoadSession(ctx context.Context, params acp.LoadSessionRequest) (resp acp.LoadSessionResponse, err error) + func (a *Agent) Logout(_ context.Context, _ acp.LogoutRequest) (acp.LogoutResponse, error) + func (a *Agent) NewSession(ctx context.Context, params acp.NewSessionRequest) (resp acp.NewSessionResponse, err error) + func (a *Agent) Prompt(ctx context.Context, params acp.PromptRequest) (resp acp.PromptResponse, err error) + func (a *Agent) ResumeSession(ctx context.Context, params acp.ResumeSessionRequest) (resp acp.ResumeSessionResponse, err error) + func (a *Agent) SetSessionConfigOption(ctx context.Context, params acp.SetSessionConfigOptionRequest) (acp.SetSessionConfigOptionResponse, error) + func (a *Agent) SetSessionMode(context.Context, acp.SetSessionModeRequest) (acp.SetSessionModeResponse, error) + func (a *Agent) UnstableDeleteSession(ctx context.Context, params acp.UnstableDeleteSessionRequest) (acp.UnstableDeleteSessionResponse, error) + type ConcurrencyLimits struct + MaxActiveSessions int + MaxConcurrentClientCalls int + type ImageLimits struct + MaxInputBytesPerImage int64 + MaxInputBytesPerPrompt int64 + MaxOutputBytesPerImage int64 + MaxOutputBytesPerToolCall int64 + type InMemorySessionStore struct + func NewInMemorySessionStore() *InMemorySessionStore + func (s *InMemorySessionStore) Append(ctx context.Context, key SessionKey, entries []SessionStoreEntry) error + func (s *InMemorySessionStore) Delete(ctx context.Context, key SessionKey) error + func (s *InMemorySessionStore) ListSessions(ctx context.Context) ([]SessionSummary, error) + func (s *InMemorySessionStore) ListSubkeys(ctx context.Context, key SessionKey) ([]string, error) + func (s *InMemorySessionStore) Load(ctx context.Context, key SessionKey) ([]SessionStoreEntry, error) + func (s *InMemorySessionStore) Replace(ctx context.Context, main SessionKey, replacements []SessionStoreReplacement) error + type ListSessionsRequestOption func(*acp.ListSessionsRequest) + func WithListSessionsCursor(cursor string) ListSessionsRequestOption + func WithListSessionsCwd(cwd string) ListSessionsRequestOption + func WithListSessionsMeta(meta map[string]any) ListSessionsRequestOption + type Option func(*Options) + func WithAgentName(name string) Option + func WithAgentTitle(title string) Option + func WithAgentVersion(version string) Option + func WithConcurrencyLimits(limits ConcurrencyLimits) Option + func WithDarwinBestEffortContainment() Option + func WithDefaultModel(model string) Option + func WithEnv(env map[string]string) Option + func WithExecutablePath(path string) Option + func WithExtraPathDirs(dirs ...string) Option + func WithImageLimits(limits ImageLimits) Option + func WithInputHandoffRoot(dir string) Option + func WithLogger(logger *slog.Logger) Option + func WithMeterProvider(provider metric.MeterProvider) Option + func WithProcessIsolation(isolation ProcessIsolation) Option + func WithRuntimeResourceHooks(hooks RuntimeResourceHooks) Option + func WithScratchDir(dir string) Option + func WithSeedFiles(files map[string]string) Option + func WithSessionStore(store SessionStore) Option + func WithSessionStoreLoadTimeout(timeout time.Duration) Option + func WithTextMapPropagator(propagator propagation.TextMapPropagator) Option + func WithTracerProvider(provider trace.TracerProvider) Option + func WithTurnTimeout(timeout time.Duration) Option + type Options struct + AgentName string + AgentTitle string + AgentVersion string + ConcurrencyLimits ConcurrencyLimits + DarwinBestEffortContainment bool + DefaultModel string + Env map[string]string + ExecutablePath string + ExtraPathDirs []string + ImageLimits ImageLimits + InputHandoffRoot string + Logger *slog.Logger + MeterProvider metric.MeterProvider + ProcessIsolation *ProcessIsolation + RuntimeResourceHooks RuntimeResourceHooks + ScratchDir string + SeedFiles map[string]string + SessionStore SessionStore + SessionStoreLoadTimeout time.Duration + TextMapPropagator propagation.TextMapPropagator + TracerProvider trace.TracerProvider + TurnTimeout time.Duration + type PiOption func(*PiOptions) + func WithPiAutoRetry(enabled bool) PiOption + func WithPiEnv(env map[string]string) PiOption + func WithPiExtraPathDirs(dirs ...string) PiOption + func WithPiModel(model string) PiOption + func WithPiOutputSchema(schema map[string]any) PiOption + func WithPiPermission(mode string) PiOption + func WithPiThinkingLevel(level string) PiOption + type PiOptions struct + AutoRetry bool + Env map[string]string + ExtraPathDirs []string + Model string + OutputSchema map[string]any + Permission string + ThinkingLevel string + func NewPiOptions(opts ...PiOption) PiOptions + func (options PiOptions) Meta() map[string]any + type ProcessIdentityLockCapability interface + Duplicate func() (*os.File, error) + type ProcessIsolation struct + AuthorityDomain ProcessIdentityLockCapability + BaseEnvironment map[string]string + GID uint32 + IdentityLock ProcessIdentityLockCapability + StandaloneOwnerID string + StandaloneStateRoot string + UID uint32 + type RuntimeContainmentMode string + const RuntimeContainmentAuthoritative + const RuntimeContainmentBestEffort + const RuntimeContainmentUnavailable + type RuntimeProcessKind string + const RuntimeProcessProviderDescendant + type RuntimeResourceHooks struct + AcquireNativeRoot func(context.Context, RuntimeResourceKind) (func(), error) + ObserveContainment func(context.Context, RuntimeContainmentMode) + ObserveProcess func(context.Context, RuntimeProcessKind, int64) + ObserveProcessSnapshot func(context.Context, RuntimeProcessKind, int) + ObserveStartupStage func(context.Context, RuntimeResourceKind, RuntimeStartupStage, time.Duration, ...) + ReserveScratchRoot func(context.Context, RuntimeResourceKind) (func(), error) + type RuntimeResourceKind string + const RuntimeResourceDiscovery + const RuntimeResourcePrompt + const RuntimeResourceRuntime + const RuntimeResourceSession + type RuntimeStartupStage string + const RuntimeStartupConfiguration + const RuntimeStartupReadiness + const RuntimeStartupSession + const RuntimeStartupSpawn + type SessionKey struct + SessionID string + Subpath string + type SessionRequestOption func(*sessionRequestConfig) + func WithSessionAdditionalDirectories(paths ...string) SessionRequestOption + func WithSessionMCPServers(servers ...acp.McpServer) SessionRequestOption + func WithSessionMeta(meta map[string]any) SessionRequestOption + func WithSessionOutputSchema(schema map[string]any) SessionRequestOption + func WithSessionPiOptions(options PiOptions) SessionRequestOption + func WithSessionRawEvents(enabled bool) SessionRequestOption + type SessionStore interface + Append func(ctx context.Context, key SessionKey, entries []SessionStoreEntry) error + Delete func(ctx context.Context, key SessionKey) error + ListSessions func(ctx context.Context) ([]SessionSummary, error) + ListSubkeys func(ctx context.Context, key SessionKey) ([]string, error) + Load func(ctx context.Context, key SessionKey) ([]SessionStoreEntry, error) + Replace func(ctx context.Context, main SessionKey, replacements []SessionStoreReplacement) error + type SessionStoreEntry = json.RawMessage + type SessionStoreReplacement struct + Entries []SessionStoreEntry + Key SessionKey + type SessionSummary struct + Cwd string + Meta map[string]any + SessionID string + Title string + UpdatedAtUnixMilli int64