Documentation
¶
Index ¶
- Constants
- func NormalizeWorkspaceID(workspaceID string) string
- type AgentExecutor
- type AgentInfo
- type BrowserProfile
- type BrowserState
- type ChannelMessage
- type CommandExecutor
- type CommandExecutorOptions
- type ExecuteRequest
- type GatewayStatus
- type NodeInfo
- type ProjectTaskRunner
- type PromptExecutor
- type PromptExecutorOptions
- type ReportChannels
- type ReportRuns
- type ReportSummary
- type Run
- type RunStatus
- type Runtime
- func (r *Runtime) Agents() []map[string]any
- func (r *Runtime) BrowserAct(action string, target string, value string) (BrowserState, error)
- func (r *Runtime) BrowserCheck(ctx context.Context, siteID string, profile string) (browser.CheckResult, error)
- func (r *Runtime) BrowserLogin(ctx context.Context, siteID string, profile string) (browser.LoginResult, error)
- func (r *Runtime) BrowserOpen(url string) (BrowserState, error)
- func (r *Runtime) BrowserProfiles() []BrowserProfile
- func (r *Runtime) BrowserRun(ctx context.Context, siteID string, flowAction string, profile string) (browser.RunResult, error)
- func (r *Runtime) BrowserScreenshot(name string) (BrowserState, error)
- func (r *Runtime) BrowserSnapshot() (BrowserState, error)
- func (r *Runtime) BrowserStart() BrowserState
- func (r *Runtime) BrowserStartWithProfile(profile string) BrowserState
- func (r *Runtime) BrowserStatus() BrowserState
- func (r *Runtime) BrowserStop() BrowserState
- func (r *Runtime) Cancel(runID string) (Run, error)
- func (r *Runtime) CancelByWorkspace(workspaceID, runID string) (Run, error)
- func (r *Runtime) Close(ctx context.Context) error
- func (r *Runtime) Enabled() bool
- func (r *Runtime) Get(runID string) (Run, bool)
- func (r *Runtime) GetByWorkspace(workspaceID, runID string) (Run, bool)
- func (r *Runtime) GetOrZero(runID string) Run
- func (r *Runtime) InboundTelegram(botID, threadID, text string, payload map[string]any) (ChannelMessage, error)
- func (r *Runtime) InboundTelegramByWorkspace(workspaceID, botID, threadID, text string, payload map[string]any) (ChannelMessage, error)
- func (r *Runtime) InboundWebhook(channelID, threadID, text string, payload map[string]any) (ChannelMessage, error)
- func (r *Runtime) InboundWebhookByWorkspace(workspaceID, channelID, threadID, text string, payload map[string]any) (ChannelMessage, error)
- func (r *Runtime) List(limit int) []Run
- func (r *Runtime) ListByWorkspace(workspaceID string, limit int) []Run
- func (r *Runtime) MessageRead(channelID string, limit int) ([]ChannelMessage, error)
- func (r *Runtime) MessageReadByWorkspace(workspaceID, channelID string, limit int) ([]ChannelMessage, error)
- func (r *Runtime) MessageSend(channelID, threadID, text string) (ChannelMessage, error)
- func (r *Runtime) MessageSendByWorkspace(workspaceID, channelID, threadID, text string) (ChannelMessage, error)
- func (r *Runtime) NodeDescribe(name string) (NodeInfo, error)
- func (r *Runtime) NodeInvoke(name string, args map[string]any) (map[string]any, error)
- func (r *Runtime) Nodes() []NodeInfo
- func (r *Runtime) OutboundTelegram(botID, chatID, threadID, text string, payload map[string]any) (ChannelMessage, error)
- func (r *Runtime) OutboundTelegramByWorkspace(workspaceID, botID, chatID, threadID, text string, payload map[string]any) (ChannelMessage, error)
- func (r *Runtime) Reload() GatewayStatus
- func (r *Runtime) ReportsChannels(limit int) (ReportChannels, error)
- func (r *Runtime) ReportsChannelsByWorkspace(workspaceID string, limit int) (ReportChannels, error)
- func (r *Runtime) ReportsRuns(limit int) (ReportRuns, error)
- func (r *Runtime) ReportsRunsByWorkspace(workspaceID string, limit int) (ReportRuns, error)
- func (r *Runtime) ReportsSummary() (ReportSummary, error)
- func (r *Runtime) ReportsSummaryByWorkspace(workspaceID string) (ReportSummary, error)
- func (r *Runtime) Restart() GatewayStatus
- func (r *Runtime) SetAgentsWatchEnabled(enabled bool)
- func (r *Runtime) SetExecutors(executors []AgentExecutor, defaultAgent string)
- func (r *Runtime) Spawn(ctx context.Context, req SpawnRequest) (Run, error)
- func (r *Runtime) Status() GatewayStatus
- func (r *Runtime) ThreadReply(channelID, threadID, text string) (ChannelMessage, error)
- func (r *Runtime) ThreadReplyByWorkspace(workspaceID, channelID, threadID, text string) (ChannelMessage, error)
- func (r *Runtime) Wait(ctx context.Context, runID string) (Run, error)
- type RuntimeOptions
- type SpawnRequest
Constants ¶
View Source
const DefaultWorkspaceID = "default"
Variables ¶
This section is empty.
Functions ¶
func NormalizeWorkspaceID ¶
Types ¶
type AgentExecutor ¶
type AgentInfo ¶
type AgentInfo struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
Kind string `json:"kind,omitempty"`
Source string `json:"source,omitempty"`
Entry string `json:"entry,omitempty"`
PolicyMode string `json:"policy_mode"`
ToolsAllow []string `json:"tools_allow,omitempty"`
ToolsAllowCount int `json:"tools_allow_count"`
ToolsDeny []string `json:"tools_deny,omitempty"`
ToolsDenyCount int `json:"tools_deny_count"`
ToolsRiskMax string `json:"tools_risk_max,omitempty"`
ToolsAllowGroups []string `json:"tools_allow_groups,omitempty"`
ToolsAllowPatterns []string `json:"tools_allow_patterns,omitempty"`
SessionRoutingMode string `json:"session_routing_mode,omitempty"`
SessionFixedID string `json:"session_fixed_id,omitempty"`
}
type BrowserProfile ¶
type BrowserState ¶
type BrowserState struct {
Running bool `json:"running"`
Profile string `json:"profile,omitempty"`
Driver string `json:"driver,omitempty"`
CurrentURL string `json:"current_url,omitempty"`
LastSnapshot string `json:"last_snapshot,omitempty"`
LastAction string `json:"last_action,omitempty"`
LastScreenshot string `json:"last_screenshot,omitempty"`
ExtensionConnected bool `json:"extension_connected,omitempty"`
AttachedTabs int `json:"attached_tabs,omitempty"`
LastError string `json:"last_error,omitempty"`
}
type ChannelMessage ¶
type ChannelMessage struct {
ID string `json:"id"`
WorkspaceID string `json:"-"`
ChannelID string `json:"channel_id"`
ThreadID string `json:"thread_id,omitempty"`
Direction string `json:"direction"`
Source string `json:"source"`
Text string `json:"text"`
Payload map[string]any `json:"payload,omitempty"`
Timestamp string `json:"timestamp"`
}
type CommandExecutor ¶
type CommandExecutor struct {
// contains filtered or unexported fields
}
func NewCommandExecutor ¶
func NewCommandExecutor(opts CommandExecutorOptions) (*CommandExecutor, error)
func (*CommandExecutor) Execute ¶
func (e *CommandExecutor) Execute(ctx context.Context, req ExecuteRequest) (string, error)
func (*CommandExecutor) Info ¶
func (e *CommandExecutor) Info() AgentInfo
type CommandExecutorOptions ¶
type ExecuteRequest ¶
type GatewayStatus ¶
type GatewayStatus struct {
Enabled bool `json:"enabled"`
Version int64 `json:"version"`
RunsTotal int `json:"runs_total"`
RunsActive int `json:"runs_active"`
AgentsCount int `json:"agents_count"`
AgentsWatchEnabled bool `json:"agents_watch_enabled"`
AgentsReloadVersion int64 `json:"agents_reload_version"`
AgentsLastReloadAt string `json:"agents_last_reload_at,omitempty"`
ChannelsLocal bool `json:"channels_local_enabled"`
ChannelsWebhook bool `json:"channels_webhook_enabled"`
ChannelsTelegram bool `json:"channels_telegram_enabled"`
PersistenceEnabled bool `json:"persistence_enabled"`
RunsPersistenceEnabled bool `json:"runs_persistence_enabled"`
ChannelsPersistenceEnabled bool `json:"channels_persistence_enabled"`
RestoreOnStartup bool `json:"restore_on_startup"`
PersistenceDir string `json:"persistence_dir,omitempty"`
RunsRestored int `json:"runs_restored"`
ChannelsRestored int `json:"channels_restored"`
LastPersistAt string `json:"last_persist_at,omitempty"`
LastRestoreAt string `json:"last_restore_at,omitempty"`
LastRestoreError string `json:"last_restore_error,omitempty"`
LastReloadAt string `json:"last_reload_at,omitempty"`
LastRestartAt string `json:"last_restart_at,omitempty"`
Browser BrowserState `json:"browser"`
Nodes []NodeInfo `json:"nodes"`
}
type ProjectTaskRunner ¶ added in v0.3.0
type ProjectTaskRunner struct {
// contains filtered or unexported fields
}
func NewProjectTaskRunner ¶ added in v0.3.0
func NewProjectTaskRunner(runtime projectTaskRuntime, workspaceID string) *ProjectTaskRunner
func (*ProjectTaskRunner) Start ¶ added in v0.3.0
func (r *ProjectTaskRunner) Start(ctx context.Context, req project.TaskRunRequest) (project.TaskRun, error)
type PromptExecutor ¶
type PromptExecutor struct {
// contains filtered or unexported fields
}
func NewPromptExecutor ¶
func NewPromptExecutorWithOptions ¶
func NewPromptExecutorWithOptions(opts PromptExecutorOptions) (*PromptExecutor, error)
func (*PromptExecutor) Execute ¶
func (e *PromptExecutor) Execute(ctx context.Context, req ExecuteRequest) (string, error)
func (*PromptExecutor) Info ¶
func (e *PromptExecutor) Info() AgentInfo
type PromptExecutorOptions ¶
type PromptExecutorOptions struct {
Name string
Description string
Source string
Entry string
PolicyMode string
ToolsAllow []string
ToolsDeny []string
ToolsRiskMax string
ToolsAllowGroups []string
ToolsAllowPatterns []string
SessionRoutingMode string
SessionFixedID string
RunPrompt func(ctx context.Context, runLabel string, prompt string, allowedTools []string) (string, error)
}
type ReportChannels ¶
type ReportChannels struct {
GeneratedAt string `json:"generated_at"`
ArchiveEnabled bool `json:"archive_enabled"`
Count int `json:"count"`
Messages map[string][]ChannelMessage `json:"messages"`
}
type ReportRuns ¶
type ReportSummary ¶
type ReportSummary struct {
GeneratedAt string `json:"generated_at"`
SummaryEnabled bool `json:"summary_enabled"`
ArchiveEnabled bool `json:"archive_enabled"`
RunsTotal int `json:"runs_total"`
RunsActive int `json:"runs_active"`
RunsByStatus map[string]int `json:"runs_by_status"`
ChannelsTotal int `json:"channels_total"`
MessagesTotal int `json:"messages_total"`
MessagesBySource map[string]int `json:"messages_by_source"`
}
type Run ¶
type Run struct {
ID string `json:"run_id"`
WorkspaceID string `json:"-"`
SessionID string `json:"session_id,omitempty"`
ProjectID string `json:"project_id,omitempty"`
Agent string `json:"agent,omitempty"`
Prompt string `json:"prompt,omitempty"`
Status RunStatus `json:"status"`
Accepted bool `json:"accepted"`
Response string `json:"response,omitempty"`
Error string `json:"error,omitempty"`
DiagnosticCode string `json:"diagnostic_code,omitempty"`
DiagnosticReason string `json:"diagnostic_reason,omitempty"`
PolicyBlockedTool string `json:"policy_blocked_tool,omitempty"`
PolicyAllowedTools []string `json:"policy_allowed_tools,omitempty"`
PolicyDeniedTools []string `json:"policy_denied_tools,omitempty"`
PolicyRiskMax string `json:"policy_risk_max,omitempty"`
CreatedAt string `json:"created_at"`
StartedAt string `json:"started_at,omitempty"`
CompletedAt string `json:"completed_at,omitempty"`
UpdatedAt string `json:"updated_at"`
}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(opts RuntimeOptions) *Runtime
func (*Runtime) BrowserAct ¶
func (*Runtime) BrowserCheck ¶
func (*Runtime) BrowserLogin ¶
func (*Runtime) BrowserOpen ¶
func (r *Runtime) BrowserOpen(url string) (BrowserState, error)
func (*Runtime) BrowserProfiles ¶
func (r *Runtime) BrowserProfiles() []BrowserProfile
func (*Runtime) BrowserRun ¶
func (*Runtime) BrowserScreenshot ¶
func (r *Runtime) BrowserScreenshot(name string) (BrowserState, error)
func (*Runtime) BrowserSnapshot ¶
func (r *Runtime) BrowserSnapshot() (BrowserState, error)
func (*Runtime) BrowserStart ¶
func (r *Runtime) BrowserStart() BrowserState
func (*Runtime) BrowserStartWithProfile ¶
func (r *Runtime) BrowserStartWithProfile(profile string) BrowserState
func (*Runtime) BrowserStatus ¶
func (r *Runtime) BrowserStatus() BrowserState
func (*Runtime) BrowserStop ¶
func (r *Runtime) BrowserStop() BrowserState
func (*Runtime) CancelByWorkspace ¶
func (*Runtime) GetByWorkspace ¶
func (*Runtime) InboundTelegram ¶
func (*Runtime) InboundTelegramByWorkspace ¶
func (*Runtime) InboundWebhook ¶
func (*Runtime) InboundWebhookByWorkspace ¶
func (*Runtime) ListByWorkspace ¶
func (*Runtime) MessageRead ¶
func (r *Runtime) MessageRead(channelID string, limit int) ([]ChannelMessage, error)
func (*Runtime) MessageReadByWorkspace ¶
func (r *Runtime) MessageReadByWorkspace(workspaceID, channelID string, limit int) ([]ChannelMessage, error)
func (*Runtime) MessageSend ¶
func (r *Runtime) MessageSend(channelID, threadID, text string) (ChannelMessage, error)
func (*Runtime) MessageSendByWorkspace ¶
func (r *Runtime) MessageSendByWorkspace(workspaceID, channelID, threadID, text string) (ChannelMessage, error)
func (*Runtime) NodeInvoke ¶
func (*Runtime) OutboundTelegram ¶
func (*Runtime) OutboundTelegramByWorkspace ¶
func (*Runtime) Reload ¶
func (r *Runtime) Reload() GatewayStatus
func (*Runtime) ReportsChannels ¶
func (r *Runtime) ReportsChannels(limit int) (ReportChannels, error)
func (*Runtime) ReportsChannelsByWorkspace ¶
func (r *Runtime) ReportsChannelsByWorkspace(workspaceID string, limit int) (ReportChannels, error)
func (*Runtime) ReportsRuns ¶
func (r *Runtime) ReportsRuns(limit int) (ReportRuns, error)
func (*Runtime) ReportsRunsByWorkspace ¶
func (r *Runtime) ReportsRunsByWorkspace(workspaceID string, limit int) (ReportRuns, error)
func (*Runtime) ReportsSummary ¶
func (r *Runtime) ReportsSummary() (ReportSummary, error)
func (*Runtime) ReportsSummaryByWorkspace ¶
func (r *Runtime) ReportsSummaryByWorkspace(workspaceID string) (ReportSummary, error)
func (*Runtime) Restart ¶
func (r *Runtime) Restart() GatewayStatus
func (*Runtime) SetAgentsWatchEnabled ¶
func (*Runtime) SetExecutors ¶
func (r *Runtime) SetExecutors(executors []AgentExecutor, defaultAgent string)
func (*Runtime) Status ¶
func (r *Runtime) Status() GatewayStatus
func (*Runtime) ThreadReply ¶
func (r *Runtime) ThreadReply(channelID, threadID, text string) (ChannelMessage, error)
func (*Runtime) ThreadReplyByWorkspace ¶
func (r *Runtime) ThreadReplyByWorkspace(workspaceID, channelID, threadID, text string) (ChannelMessage, error)
type RuntimeOptions ¶
type RuntimeOptions struct {
Enabled bool
WorkspaceDir string
SessionStore *session.Store
SessionStoreForWorkspace func(workspaceID string) *session.Store
RunPrompt func(ctx context.Context, runLabel string, prompt string) (string, error)
Executors []AgentExecutor
DefaultAgent string
GatewayAgentsWatchEnabled bool
ChannelsLocalEnabled bool
ChannelsWebhookEnabled bool
ChannelsTelegramEnabled bool
GatewayPersistenceEnabled bool
GatewayRunsPersistenceEnabled bool
GatewayChannelsPersistenceEnabled bool
GatewayRunsMaxRecords int
GatewayChannelsMaxMessagesPerChannel int
GatewayPersistenceDir string
GatewayRestoreOnStartup bool
GatewayReportSummaryEnabled bool
GatewayArchiveEnabled bool
GatewayArchiveDir string
GatewayArchiveRetentionDays int
GatewayArchiveMaxFileBytes int
BrowserDefaultProfile string
BrowserManagedHeadless bool
BrowserManagedExecutablePath string
BrowserManagedUserDataDir string
BrowserSiteFlowsDir string
BrowserAutoLoginSiteAllowlist []string
BrowserVaultReader browser.SecretReader
BrowserService *browser.Service
Now func() time.Time
}
Click to show internal directories.
Click to hide internal directories.