Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupStaleACPManagedMCPServers(ctx context.Context, db libdb.DBManager) error
- func New(deps Deps) libacp.AgentFactory
- func NewACPCommandRunner(transport func() *Transport) localtools.CommandRunner
- func NewACPCommandRunnerWithShell(transport func() *Transport, shell localtools.PlatformShell) localtools.CommandRunner
- func NewACPCwdResolver(transport func() *Transport) func(context.Context) string
- func NewACPFileIO(transport func() *Transport) localtools.FileIO
- func NewServeCwdResolver(db libdb.DBManager, roots *vfs.Factory) func(context.Context) string
- func NotifyAgentDeclarationsChanged()
- func ReadConfigValue(ctx context.Context, db libdb.DBManager, key string) string
- type ChainRegistry
- type Deps
- type EnvSetupSpec
- type LiveDefaults
- type MissionAgentResolver
- type MissionDispatcher
- type MissionForwardConfig
- type SessionRouter
- func (r *SessionRouter) AskApproval(ctx context.Context, req hitlservice.ApprovalRequest) (bool, error)
- func (r *SessionRouter) DeliverToContenoxSession(ctx context.Context, contenoxSessionID string, n libacp.SessionNotification) error
- func (r *SessionRouter) PromptContenoxSession(ctx context.Context, contenoxSessionID, text string) error
- type Transport
- func (t *Transport) AskApproval(ctx context.Context, req hitlservice.ApprovalRequest) (bool, error)
- func (t *Transport) Authenticate(ctx context.Context, req libacp.AuthenticateRequest) (libacp.AuthenticateResponse, error)
- func (t *Transport) Cancel(ctx context.Context, req libacp.CancelNotification) error
- func (t *Transport) Close(ctx context.Context) error
- func (t *Transport) CloseSession(ctx context.Context, req libacp.CloseSessionRequest) (libacp.CloseSessionResponse, error)
- func (t *Transport) DeleteSession(ctx context.Context, req libacp.DeleteSessionRequest) (libacp.DeleteSessionResponse, error)
- func (t *Transport) DeliverToContenoxSession(ctx context.Context, contenoxSessionID string, n libacp.SessionNotification) error
- func (t *Transport) Initialize(ctx context.Context, req libacp.InitializeRequest) (libacp.InitializeResponse, error)
- func (t *Transport) ListSessions(ctx context.Context, req libacp.ListSessionsRequest) (libacp.ListSessionsResponse, error)
- func (t *Transport) LoadSession(ctx context.Context, req libacp.LoadSessionRequest) (libacp.LoadSessionResponse, error)
- func (t *Transport) Logout(_ context.Context, _ libacp.LogoutRequest) (libacp.LogoutResponse, error)
- func (t *Transport) NewSession(ctx context.Context, req libacp.NewSessionRequest) (libacp.NewSessionResponse, error)
- func (t *Transport) Prompt(ctx context.Context, req libacp.PromptRequest) (libacp.PromptResponse, error)
- func (t *Transport) PromptContenoxSession(ctx context.Context, contenoxSessionID, text string) error
- func (t *Transport) ResumeSession(ctx context.Context, req libacp.ResumeSessionRequest) (libacp.ResumeSessionResponse, error)
- func (t *Transport) SetSessionConfigOption(ctx context.Context, req libacp.SetSessionConfigOptionRequest) (libacp.SetSessionConfigOptionResponse, error)
- func (t *Transport) SetSessionMode(_ context.Context, _ libacp.SetSessionModeRequest) (libacp.SetSessionModeResponse, error)
- func (t *Transport) SetSessionModel(_ context.Context, _ libacp.SetSessionModelRequest) (libacp.SetSessionModelResponse, error)
Constants ¶
const ( // ExtMethodWorkspaceConfigOptions returns the current session-less config // options: result {"configOptions": [...]}. ExtMethodWorkspaceConfigOptions = "_contenox/workspaceConfigOptions" // ExtNotifyWorkspaceConfigOptionsChanged is pushed (no response) whenever // backend state changes: params {"configOptions": [...]}. ExtNotifyWorkspaceConfigOptionsChanged = "_contenox/workspaceConfigOptionsChanged" )
const ( TerminalOutputMetaKey = "contenox.terminalOutput" TerminalOutputUpdateKind libacp.SessionUpdateKind = "_contenox.terminalOutput" )
const AdoptMetaKey = "contenox.adopt"
const AgentMetaKey = "contenox.agent"
const AgentModeConfigOptionID = "contenox.agent-mode"
const AgentModelConfigOptionID = "contenox.agent-model"
const AvailableCommandsMetaKey = "contenox.availableCommands"
AvailableCommandsMetaKey carries the static slash-command list in the initialize response, so clients can offer commands before any session exists.
const ExtMethodAgentConfigOptions = "_contenox/agents/configOptions"
const ExtMethodAgentProblems = "_contenox/agents/problems"
ExtMethodAgentProblems reports what the last declaration sync could not do: a refused or ignored file, or a field this build does not carry. The app shows it instead of leaving it in the log.
const ExtMethodEnvelopesList = "_contenox/envelopes/list"
const ExtNotifyAgentDeclarationsChanged = "_contenox/agents/changed"
ExtNotifyAgentDeclarationsChanged is pushed to every connected client after a compile pass: the folder's files or their problems changed, so the app should re-read `_contenox/agents/problems`.
const (
WorkspaceConfigOptionsMetaKey = "contenox.workspaceConfigOptions"
)
Variables ¶
var ErrNoBoundSession = errors.New("acpsvc: no ACP transport bound to contenox-runtime session")
var ErrSessionBusy = fmt.Errorf("acpsvc: the session already has a turn in flight")
var ErrSessionNotLive = errors.New("acpsvc: no live session for that contenox id on this connection")
Functions ¶
func CleanupStaleACPManagedMCPServers ¶ added in v0.29.0
func New ¶
func New(deps Deps) libacp.AgentFactory
func NewACPCommandRunner ¶
func NewACPCommandRunner(transport func() *Transport) localtools.CommandRunner
func NewACPCommandRunnerWithShell ¶ added in v0.28.4
func NewACPCommandRunnerWithShell(transport func() *Transport, shell localtools.PlatformShell) localtools.CommandRunner
func NewACPCwdResolver ¶
func NewACPFileIO ¶
func NewACPFileIO(transport func() *Transport) localtools.FileIO
func NewServeCwdResolver ¶ added in v0.36.0
func NotifyAgentDeclarationsChanged ¶
func NotifyAgentDeclarationsChanged()
NotifyAgentDeclarationsChanged tells every connected client that the declaration folder was recompiled.
Types ¶
type ChainRegistry ¶
type ChainRegistry struct {
// contains filtered or unexported fields
}
func LoadChainRegistry ¶
func LoadChainRegistry() (*ChainRegistry, error)
func LoadChainRegistryFrom ¶
func LoadChainRegistryFrom(filename, envVar string) (*ChainRegistry, error)
func LoadChainRegistryPath ¶
func LoadChainRegistryPath(path string) (*ChainRegistry, error)
func NewChainRegistryFor ¶
func NewChainRegistryFor(chain *taskengine.TaskChainDefinition, source string) *ChainRegistry
func (*ChainRegistry) Default ¶
func (r *ChainRegistry) Default() *taskengine.TaskChainDefinition
func (*ChainRegistry) Reload ¶
func (r *ChainRegistry) Reload() error
Reload re-reads the chain from the file it was loaded from, so a session started after the declaration watcher recompiled sees the new version without a restart. An in-memory chain (shipped-tree fallback) has nothing to reload.
func (*ChainRegistry) Source ¶
func (r *ChainRegistry) Source() string
type Deps ¶
type Deps struct {
Engine *enginesvc.Engine
DB libdb.DBManager
ChainRegistry *ChainRegistry
DefaultModel string
DefaultProvider string
DefaultAltModel string
DefaultAltProvider string
DefaultMaxTokens string
DefaultThink string
// LiveDefaults, when set, is consulted (TTL-cached) so defaults saved by
// another process or the HTTP API take effect without a restart. Non-empty
// fields override the static Default* values above, which remain the fallback.
LiveDefaults func(ctx context.Context) LiveDefaults
WorkspaceID string
ContenoxDir string
WorkspaceRoots *vfs.Factory
ShellSessions shellsession.Manager
PolicyCatalog func(workspaceID string) []string
PolicyResolver func(workspaceID, name string) string
HITLDefaultPolicyName string
UpdateBanner string
EnvSetup *EnvSetupSpec
SessionRouter *SessionRouter
// DecisionRecorder, when set, receives every interactive approval decision
// answered through session/request_permission, so hitl_approvals keeps an
// audit row for it. Optional: nil disables recording.
DecisionRecorder hitlservice.DecisionRecorder
HITL hitlservice.PolicyEvaluator
Instances agentinstance.Manager
NativeTurns *nativeturn.Registry
Fleet MissionDispatcher
Agents MissionAgentResolver
MissionForwarded *MissionForwardConfig
}
type EnvSetupSpec ¶ added in v0.36.0
type EnvSetupSpec struct {
Vars []libacp.AuthEnvVar
Complete func(ctx context.Context) error
}
type LiveDefaults ¶
type LiveDefaults struct {
Model string
Provider string
AltModel string
AltProvider string
MaxTokens string
Think string
}
LiveDefaults is a snapshot of the persisted default-* configuration. Empty fields mean "not configured" and fall back to the startup values.
type MissionAgentResolver ¶
type MissionDispatcher ¶
type MissionDispatcher interface {
Dispatch(ctx context.Context, req fleetservice.DispatchRequest) (fleetservice.DispatchResult, error)
}
type MissionForwardConfig ¶
type SessionRouter ¶
type SessionRouter struct {
// contains filtered or unexported fields
}
func NewSessionRouter ¶
func NewSessionRouter() *SessionRouter
func (*SessionRouter) AskApproval ¶
func (r *SessionRouter) AskApproval(ctx context.Context, req hitlservice.ApprovalRequest) (bool, error)
func (*SessionRouter) DeliverToContenoxSession ¶
func (r *SessionRouter) DeliverToContenoxSession(ctx context.Context, contenoxSessionID string, n libacp.SessionNotification) error
func (*SessionRouter) PromptContenoxSession ¶
func (r *SessionRouter) PromptContenoxSession(ctx context.Context, contenoxSessionID, text string) error
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) AskApproval ¶
func (t *Transport) AskApproval(ctx context.Context, req hitlservice.ApprovalRequest) (bool, error)
func (*Transport) Authenticate ¶
func (t *Transport) Authenticate(ctx context.Context, req libacp.AuthenticateRequest) (libacp.AuthenticateResponse, error)
func (*Transport) CloseSession ¶ added in v0.36.0
func (t *Transport) CloseSession(ctx context.Context, req libacp.CloseSessionRequest) (libacp.CloseSessionResponse, error)
func (*Transport) DeleteSession ¶ added in v0.36.0
func (t *Transport) DeleteSession(ctx context.Context, req libacp.DeleteSessionRequest) (libacp.DeleteSessionResponse, error)
func (*Transport) DeliverToContenoxSession ¶
func (*Transport) Initialize ¶
func (t *Transport) Initialize(ctx context.Context, req libacp.InitializeRequest) (libacp.InitializeResponse, error)
func (*Transport) ListSessions ¶
func (t *Transport) ListSessions(ctx context.Context, req libacp.ListSessionsRequest) (libacp.ListSessionsResponse, error)
func (*Transport) LoadSession ¶
func (t *Transport) LoadSession(ctx context.Context, req libacp.LoadSessionRequest) (libacp.LoadSessionResponse, error)
func (*Transport) Logout ¶ added in v0.36.0
func (t *Transport) Logout(_ context.Context, _ libacp.LogoutRequest) (libacp.LogoutResponse, error)
func (*Transport) NewSession ¶
func (t *Transport) NewSession(ctx context.Context, req libacp.NewSessionRequest) (libacp.NewSessionResponse, error)
func (*Transport) Prompt ¶
func (t *Transport) Prompt(ctx context.Context, req libacp.PromptRequest) (libacp.PromptResponse, error)
func (*Transport) PromptContenoxSession ¶
func (*Transport) ResumeSession ¶ added in v0.36.0
func (t *Transport) ResumeSession(ctx context.Context, req libacp.ResumeSessionRequest) (libacp.ResumeSessionResponse, error)
func (*Transport) SetSessionConfigOption ¶ added in v0.29.0
func (t *Transport) SetSessionConfigOption(ctx context.Context, req libacp.SetSessionConfigOptionRequest) (libacp.SetSessionConfigOptionResponse, error)
func (*Transport) SetSessionMode ¶ added in v0.36.0
func (t *Transport) SetSessionMode(_ context.Context, _ libacp.SetSessionModeRequest) (libacp.SetSessionModeResponse, error)
func (*Transport) SetSessionModel ¶ added in v0.36.0
func (t *Transport) SetSessionModel(_ context.Context, _ libacp.SetSessionModelRequest) (libacp.SetSessionModelResponse, error)
Source Files
¶
- adopt.go
- agent_events.go
- agent_options_ext.go
- audio.go
- authenticate.go
- chain.go
- commandrunner.go
- commands.go
- commands_plan.go
- commands_session.go
- config_options.go
- config_refresh.go
- droppedcontent.go
- events.go
- external.go
- external_modes.go
- external_terminal.go
- fileio.go
- images.go
- initialize.go
- mission.go
- mission_command.go
- model_options.go
- native_turn.go
- permission.go
- plan_projection.go
- prompt.go
- prompt_capabilities.go
- provisional_title.go
- router.go
- session.go
- supervise.go
- terminal.go
- transport.go