Documentation
¶
Index ¶
- func AppendPermissionAuditEvent(event permission.AuditEvent) error
- func CloseDaemonConnections() int
- func CompletionAgentIDForSystem(cfg *op.SystemConfig) string
- func ConfigGetHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func ConfigSystemGetHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func CronAddHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func CronGetHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func CronHistoryHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func CronListHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func CronRemoveHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func CronRunHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func CronUpdateHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func CronUpsertHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func DefaultCompletionAgentID() string
- func GetObjectStore() objectstore.Store
- func IsRuntimeIdle(gracePeriod time.Duration) bool
- func NotifyInfo(params *op.InfoNotificationParams) error
- func NotifyProgress(opCode op.OpCode, meta op.Meta, content op.Content)
- func OpAgentHandler(ctx context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpAgentLoopCreateHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpAgentScanHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpEditorCompletionCancelHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpEditorCompletionHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpMessageAckHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpMessageArchiveHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpMessageListHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpMessageReadHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpMessageReplyHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpNodeHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpNodeListHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpPermissionApprovalCancelHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpPermissionApprovalListHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpPermissionApprovalResolveHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpPermissionProfileListHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpPermissionTrustGetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpPermissionTrustSetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpPermissionWorkspaceGetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpPermissionWorkspaceSelectHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpRuntimeEvidenceAnswerHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpSandboxSetupHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpSandboxStatusGetHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadActiveListHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpThreadCompactHandler(ctx context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpThreadCreateHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadFollowUpHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpThreadFollowUpPromoteHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpThreadForkHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadInterruptedHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpThreadMetaGetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadMetaUpdateHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadQueueGetHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpThreadQueueRemoveHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpThreadReviewListHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadReviewResolveHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadReviewRollbackHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadSnapshotGetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func OpThreadSteerHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
- func OpThreadSubmitHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
- func RefreshNodeCache(ctx context.Context, opts scan.ScanOptions) error
- func ResetHostHooks()
- func SetConn(conn *Connection)
- func SetDefaultObjectStore(store objectstore.Store)
- func SetDefaultStorage(storage Storage)
- func SetHostHooks(hooks HostHooks)
- func StartCron(ctx context.Context, cfg *op.SystemConfig) error
- func StartNotify(ctx context.Context)
- func StopCron()
- func SubscribeNotifications(buffer int) (<-chan *op.InfoNotificationParams, func())
- type Agent
- type AgentLoop
- func NewAgentLoop(ctx context.Context, node *op.OpNode, meta op.Meta, content op.Content) (*AgentLoop, error)
- func NewContinuationAgentLoop(ctx context.Context, node *op.OpNode, meta op.Meta) (*AgentLoop, error)
- func NewQueuedPromptAgentLoop(ctx context.Context, node *op.OpNode, meta op.Meta, pending PendingLoopMessage) (*AgentLoop, error)
- type Connection
- func CreateConnection(ctx context.Context, node *op.OpNode) (*Connection, error)
- func CreateSystemConnection(ctx context.Context, node *op.OpNode) (*Connection, error)
- func CreateToolDiscoveryConnection(ctx context.Context, node *op.OpNode) (*Connection, error)
- func EnsureAgentConnection(ctx context.Context, node *op.OpNode, meta op.Meta) (*Connection, error)
- func EnsureConnection(ctx context.Context, node *op.OpNode) (*Connection, error)
- func EnsureToolConnection(ctx context.Context, node *op.OpNode, meta op.Meta, cwd string) (*Connection, error)
- func GetConn(nodeID string) *Connection
- func (conn *Connection) CallAgent(ctx context.Context, agentID string, meta op.Meta, content op.Content) (*op.CallAgentResult, error)
- func (conn *Connection) CallNode(ctx context.Context, meta op.Meta, content op.Content) (*op.CallNodeResult, error)
- func (conn *Connection) CallTool(ctx context.Context, params *op.CallToolParams) (*op.CallToolResult, error)
- func (conn *Connection) Close()
- func (conn *Connection) ForceClose()
- func (conn *Connection) ListToolSpecs() ([]*op.ToolSpec, error)
- func (conn *Connection) ListToolSpecsContext(ctx context.Context) ([]*op.ToolSpec, error)
- func (conn *Connection) NotifyInfo(ctx context.Context, params *op.InfoNotificationParams) error
- func (conn *Connection) OpNode(ctx context.Context, params *op.OpNodeParams) (*op.OpNodeResult, error)
- func (conn *Connection) RuntimeSnapshot(now time.Time) *ConnectionRuntimeSnapshot
- type ConnectionRuntimeSnapshot
- type ContinueLoopConfig
- type CronTask
- type CronTaskHistoryResult
- type CronTaskListResult
- type CronTaskPayload
- type CronTaskRecord
- type CronTaskRunHistoryEntry
- type CronTaskRunResult
- type CronTaskSchedule
- type CronTaskState
- type CronTaskStoreFile
- type CronTaskTarget
- type HostHooks
- type Loop
- type ModelClient
- type PendingLoopMessage
- type RunLoopConfig
- type Storage
- type ToolCall
- type ToolCallDelta
- type ToolCallState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendPermissionAuditEvent ¶
func AppendPermissionAuditEvent(event permission.AuditEvent) error
func CloseDaemonConnections ¶
func CloseDaemonConnections() int
CloseDaemonConnections force closes all cached daemon connections. Used during opagent shutdown to avoid orphan daemon child processes.
func CompletionAgentIDForSystem ¶
func CompletionAgentIDForSystem(cfg *op.SystemConfig) string
func ConfigGetHandler ¶
func ConfigGetHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func ConfigSystemGetHandler ¶
func ConfigSystemGetHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func CronAddHandler ¶
func CronAddHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func CronGetHandler ¶
func CronGetHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func CronHistoryHandler ¶
func CronHistoryHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func CronListHandler ¶
func CronListHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func CronRemoveHandler ¶
func CronRemoveHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func CronRunHandler ¶
func CronRunHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func CronUpdateHandler ¶
func CronUpdateHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func CronUpsertHandler ¶
func CronUpsertHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func DefaultCompletionAgentID ¶
func DefaultCompletionAgentID() string
func GetObjectStore ¶
func GetObjectStore() objectstore.Store
func IsRuntimeIdle ¶
func NotifyInfo ¶
func NotifyInfo(params *op.InfoNotificationParams) error
func NotifyProgress ¶
NotifyProgress sends a notification with metadata to the thread.
func OpAgentHandler ¶
func OpAgentHandler(ctx context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpAgentLoopCreateHandler ¶
func OpAgentLoopCreateHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpAgentScanHandler ¶
func OpAgentScanHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpEditorCompletionCancelHandler ¶
func OpEditorCompletionCancelHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpEditorCompletionHandler ¶
func OpEditorCompletionHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpMessageAckHandler ¶
func OpMessageAckHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpMessageArchiveHandler ¶
func OpMessageArchiveHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpMessageListHandler ¶
func OpMessageListHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpMessageReadHandler ¶
func OpMessageReadHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpMessageReplyHandler ¶
func OpMessageReplyHandler(req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpNodeHandler ¶
func OpNodeHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpNodeListHandler ¶
func OpNodeListHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpPermissionApprovalCancelHandler ¶
func OpPermissionApprovalCancelHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpPermissionApprovalListHandler ¶
func OpPermissionApprovalListHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpPermissionApprovalResolveHandler ¶
func OpPermissionApprovalResolveHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpPermissionProfileListHandler ¶
func OpPermissionProfileListHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpPermissionTrustGetHandler ¶
func OpPermissionTrustGetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpPermissionTrustSetHandler ¶
func OpPermissionTrustSetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpPermissionWorkspaceGetHandler ¶
func OpPermissionWorkspaceGetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpPermissionWorkspaceSelectHandler ¶
func OpPermissionWorkspaceSelectHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpRuntimeEvidenceAnswerHandler ¶
func OpRuntimeEvidenceAnswerHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpSandboxSetupHandler ¶
func OpSandboxSetupHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpSandboxStatusGetHandler ¶
func OpSandboxStatusGetHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadActiveListHandler ¶
func OpThreadActiveListHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpThreadCompactHandler ¶
func OpThreadCompactHandler(ctx context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpThreadCreateHandler ¶
func OpThreadCreateHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadFollowUpHandler ¶
func OpThreadFollowUpHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpThreadFollowUpPromoteHandler ¶
func OpThreadFollowUpPromoteHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpThreadForkHandler ¶
func OpThreadForkHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadInterruptedHandler ¶
func OpThreadInterruptedHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpThreadMetaGetHandler ¶
func OpThreadMetaGetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadMetaUpdateHandler ¶
func OpThreadMetaUpdateHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadQueueGetHandler ¶
func OpThreadQueueGetHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpThreadQueueRemoveHandler ¶
func OpThreadQueueRemoveHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpThreadReviewListHandler ¶
func OpThreadReviewListHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadReviewResolveHandler ¶
func OpThreadReviewResolveHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadReviewRollbackHandler ¶
func OpThreadReviewRollbackHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadSnapshotGetHandler ¶
func OpThreadSnapshotGetHandler(req *op.OpNodeRequest) (*op.OpNodeResult, error)
func OpThreadSteerHandler ¶
func OpThreadSteerHandler(_ context.Context, req *op.OpAgentRequest) (*op.OpAgentResult, error)
func OpThreadSubmitHandler ¶
func OpThreadSubmitHandler(ctx context.Context, req *op.OpNodeRequest) (*op.OpNodeResult, error)
func RefreshNodeCache ¶
func RefreshNodeCache(ctx context.Context, opts scan.ScanOptions) error
RefreshNodeCache rescans the configured baseDir and replaces the cached node set. The cache is updated only after the full scan completes so renames and deletions do not leave stale nodes behind.
func ResetHostHooks ¶
func ResetHostHooks()
func SetConn ¶
func SetConn(conn *Connection)
func SetDefaultObjectStore ¶
func SetDefaultObjectStore(store objectstore.Store)
func SetDefaultStorage ¶
func SetDefaultStorage(storage Storage)
SetDefaultStorage allows external initialization of the default storage instance
func SetHostHooks ¶
func SetHostHooks(hooks HostHooks)
func StartNotify ¶
func SubscribeNotifications ¶
func SubscribeNotifications(buffer int) (<-chan *op.InfoNotificationParams, func())
SubscribeNotifications registers a bounded, best-effort event consumer. A slow subscriber drops events instead of blocking agent execution.
Types ¶
type Agent ¶
type AgentLoop ¶
type AgentLoop struct {
Ctx context.Context `json:"-"`
Cancel context.CancelFunc `json:"-"`
Agent *Agent
Meta op.Meta
ThreadID string
TurnID string
ChatPath string
Workdir string
ThinkingLevel string
ContextWindow int64
PlanTurn bool
SelectedSkillIDs []string
SelectedSkillContext op.Meta
Model *ModelClient
// contains filtered or unexported fields
}
func NewAgentLoop ¶
type Connection ¶
type Connection struct {
NodeID string `json:"nodeID"`
Name string `json:"name"`
// ConnType ConnType `json:"connType"`
Meta op.Meta `json:"meta"`
TransType op.TransportType `json:"type"`
Command []string `json:"command"`
OpCodes []op.OpCode `json:"opcodes"`
URL string `json:"url"`
Description string `json:"description"`
Daemon bool `json:"daemon"`
Session *op.ClientSession `json:"-"`
Ctx context.Context `json:"-"`
Cancel context.CancelFunc `json:"-"`
CacheKey string `json:"-"`
PermissionThreadID string `json:"-"`
PermissionWorkspace string `json:"-"`
PermissionDigest string `json:"-"`
// contains filtered or unexported fields
}
func CreateConnection ¶
func CreateSystemConnection ¶
CreateSystemConnection is the only non-thread local-process entry point. It is limited to product-installed nodes explicitly registered for startup; conversation actions must use the thread-scoped agent/tool helpers instead.
func EnsureAgentConnection ¶
EnsureAgentConnection keeps process-backed agents under the immutable thread permission snapshot. Safe profiles cannot hand an entire remote agent session an unrestricted network channel; use exact-scope remote MCP instead.
func EnsureConnection ¶
func EnsureToolConnection ¶
func GetConn ¶
func GetConn(nodeID string) *Connection
func (*Connection) CallNode ¶
func (conn *Connection) CallNode(ctx context.Context, meta op.Meta, content op.Content) (*op.CallNodeResult, error)
func (*Connection) CallTool ¶
func (conn *Connection) CallTool(ctx context.Context, params *op.CallToolParams) (*op.CallToolResult, error)
func (*Connection) Close ¶
func (conn *Connection) Close()
func (*Connection) ForceClose ¶
func (conn *Connection) ForceClose()
func (*Connection) ListToolSpecs ¶
func (conn *Connection) ListToolSpecs() ([]*op.ToolSpec, error)
func (*Connection) ListToolSpecsContext ¶
func (*Connection) NotifyInfo ¶
func (conn *Connection) NotifyInfo(ctx context.Context, params *op.InfoNotificationParams) error
func (*Connection) OpNode ¶
func (conn *Connection) OpNode(ctx context.Context, params *op.OpNodeParams) (*op.OpNodeResult, error)
func (*Connection) RuntimeSnapshot ¶
func (conn *Connection) RuntimeSnapshot(now time.Time) *ConnectionRuntimeSnapshot
type ConnectionRuntimeSnapshot ¶
type ConnectionRuntimeSnapshot struct {
NodeID string `json:"nodeID"`
Name string `json:"name,omitempty"`
Transport op.TransportType `json:"transport,omitempty"`
Daemon bool `json:"daemon,omitempty"`
ConnectedAt *time.Time `json:"connectedAt,omitempty"`
PID int `json:"pid,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
UptimeSec int64 `json:"uptimeSec,omitempty"`
LastActiveAt *time.Time `json:"lastActiveAt,omitempty"`
URL string `json:"url,omitempty"`
}
func ListActiveConnectionSnapshots ¶
func ListActiveConnectionSnapshots(now time.Time) []*ConnectionRuntimeSnapshot
type ContinueLoopConfig ¶
type CronTask ¶
type CronTask struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
PermissionProfileID op.PermissionProfileID `json:"permissionProfileID,omitempty"`
Schedule CronTaskSchedule `json:"schedule"`
Target CronTaskTarget `json:"target"`
Payload CronTaskPayload `json:"payload"`
CreatedAtMs int64 `json:"createdAtMs,omitempty"`
UpdatedAtMs int64 `json:"updatedAtMs,omitempty"`
}
func (*CronTask) UnmarshalJSON ¶
type CronTaskHistoryResult ¶
type CronTaskHistoryResult struct {
TaskID string `json:"taskID"`
Limit int `json:"limit"`
Runs []CronTaskRunHistoryEntry `json:"runs"`
}
type CronTaskListResult ¶
type CronTaskListResult struct {
Version int `json:"version"`
Tasks []CronTaskRecord `json:"tasks"`
}
type CronTaskPayload ¶
type CronTaskRecord ¶
type CronTaskRecord struct {
Task CronTask `json:"task"`
State *CronTaskState `json:"state,omitempty"`
}
type CronTaskRunHistoryEntry ¶
type CronTaskRunHistoryEntry struct {
RunID string `json:"runID"`
TaskID string `json:"taskID"`
Trigger string `json:"trigger"`
ScheduledAtMs int64 `json:"scheduledAtMs,omitempty"`
StartedAtMs int64 `json:"startedAtMs"`
FinishedAtMs int64 `json:"finishedAtMs,omitempty"`
DurationMs int64 `json:"durationMs,omitempty"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
ThreadID string `json:"threadID,omitempty"`
ChatPath string `json:"chatPath,omitempty"`
AgentID string `json:"agentID,omitempty"`
}
type CronTaskRunResult ¶
type CronTaskRunResult struct {
Queued bool `json:"queued"`
Task CronTaskRecord `json:"task"`
}
type CronTaskSchedule ¶
type CronTaskState ¶
type CronTaskState struct {
TaskID string `json:"taskID"`
SpecHash string `json:"specHash,omitempty"`
NextRunAtMs int64 `json:"nextRunAtMs,omitempty"`
RunNowAtMs int64 `json:"runNowAtMs,omitempty"`
RunNowPayload *CronTaskPayload `json:"runNowPayload,omitempty"`
LastRunAtMs int64 `json:"lastRunAtMs,omitempty"`
RunningAtMs int64 `json:"runningAtMs,omitempty"`
LastError string `json:"lastError,omitempty"`
ConsecutiveErrors int `json:"consecutiveErrors,omitempty"`
}
type CronTaskStoreFile ¶
type CronTaskTarget ¶
type HostHooks ¶
type HostHooks struct {
ResolveHeaders func(context.Context, map[string]string) (map[string]string, error)
AuthorizeSystemService func(context.Context, *op.OpNode) error
AuthorizeRemoteNode func(context.Context, *op.OpNode) error
AugmentPrompt func(context.Context, string, string, op.Meta) (string, error)
TransformToolArguments func(context.Context, op.Meta, string, string, any, any) (any, error)
AuthorizeCron func(context.Context, op.OpCode, op.Meta, op.Content) error
}
HostHooks are process-wide in v0.1 because the runtime supports one instance per process. Product integrations may install policy here; standalone OpAgent keeps the fail-closed defaults below.
type Loop ¶
Loop is the minimal runtime handle for a running agent loop (tool calls, registry). It is built from AgentLoop when running the loop.
type ModelClient ¶
type ModelClient struct {
Canonical ai.CanonicalProvider
Responses ai.ResponsesProvider
Ctx context.Context
// contains filtered or unexported fields
}
func NewModelClient ¶
type PendingLoopMessage ¶
type RunLoopConfig ¶
type RunLoopConfig struct {
GetSteeringMessages func(context.Context) ([]PendingLoopMessage, error)
GetFollowUpMessages func(context.Context) ([]PendingLoopMessage, error)
InitialPendingMessages []PendingLoopMessage
SkipInitialSteeringPoll bool
}
RunLoopConfig holds optional callbacks for steering and follow-up messages (pi-mono style). If a callback is nil, no messages are injected.
type Storage ¶
type Storage interface {
// user task
GetUserTask(ctx context.Context, taskID string) (*op.UserTask, error)
ListUserTasks(ctx context.Context, uid string) ([]*op.UserTask, error)
UpsertUserTask(ctx context.Context, task *op.UserTask) error
BindThreadIDToUserTaskID(ctx context.Context, taskID, threadID string) error
DeleteThreadIDFromUserTask(ctx context.Context, taskID, threadID string) error
DeleteUserTask(ctx context.Context, taskID string) error
// user settings
UpsertUserSettings(ctx context.Context, settings *op.UserSettings) error
GetUserSettings(ctx context.Context, uid string) (*op.UserSettings, error)
// ListUIDs returns distinct UIDs that exist in storage.
ListUIDs(ctx context.Context) ([]string, error)
}
Storage defines the underlying storage interface. Agent/skill/tool records have been moved to nodestore (in-memory cache). This interface retains only thread, user, and model persistence.
type ToolCallDelta ¶
type ToolCallState ¶
type ToolCallState struct {
// contains filtered or unexported fields
}
func NewToolCallState ¶
func NewToolCallState() *ToolCallState
func (*ToolCallState) Accumulate ¶
func (s *ToolCallState) Accumulate(delta ToolCallDelta)
func (*ToolCallState) Finalize ¶
func (s *ToolCallState) Finalize() []ToolCall
func (*ToolCallState) HasPending ¶
func (s *ToolCallState) HasPending() bool
func (*ToolCallState) Reset ¶
func (s *ToolCallState) Reset()
Source Files
¶
- agent.go
- agent_call.go
- agent_node_reload.go
- agent_task.go
- connection.go
- connection_runtime.go
- context_usage.go
- cron.go
- cron_schedule.go
- editor_completion.go
- host_hooks.go
- loop.go
- loop_retry.go
- loop_runtime.go
- message_delivery.go
- message_host_tools.go
- message_store.go
- message_system.go
- model.go
- model_message.go
- model_turn_config.go
- node_refresh.go
- notify.go
- objectstore.go
- opagent.go
- pending_loop_message.go
- permission_ops.go
- reasoning_effort.go
- remote_http.go
- review_ops.go
- review_store.go
- run_header.go
- runtime_evidence_answer.go
- runtime_idle.go
- service_tier.go
- storage.go
- system_connection.go
- thread_compact.go
- thread_compaction_store.go
- thread_control.go
- thread_meta_resolver.go
- thread_ops.go
- thread_replace_unix.go
- thread_storage.go
- thread_store.go
- thread_submit.go
- tool.go
- tools_node.go
- tools_node_runtime.go
- uri_paths.go
- user_message.go