Documentation
¶
Index ¶
- Constants
- Variables
- func NewLocalTools(workspaceRoot string, skills *SkillRegistry) ([]tool.BaseTool, error)
- type Agent
- func (a *Agent) Cancel(runID string) bool
- func (a *Agent) Run(parent context.Context, conversationID, userMessage string, ...) (runID string, err error)
- func (a *Agent) RunWithID(parent context.Context, runID, conversationID, userMessage string, ...) (_ string, err error)
- func (a *Agent) RunWithOptions(parent context.Context, conversationID, userMessage string, ...) (runID string, err error)
- type Config
- type DecisionReplayReport
- type DecisionReplayRequest
- type DecisionReplayStep
- type Event
- type MCPManager
- type MemoryStore
- type ReplayToolCall
- type RunManager
- func (m *RunManager) Cancel(runID string) bool
- func (m *RunManager) Close()
- func (m *RunManager) Get(runID string) (*RunState, bool)
- func (m *RunManager) Start(runID, conversationID, message string, captureTrajectory bool) (*RunState, bool, error)
- func (m *RunManager) Subscribe(ctx context.Context, runID string, after int64, send func(Event) error, ...) error
- type RunState
- type Server
- type SkillRegistry
- type TrajectoryRecord
- type TrajectoryStore
Constants ¶
View Source
const ( EventRunStarted = "run.started" EventMessageDelta = "message.delta" EventToolStarted = "tool.started" EventToolOutput = "tool.output" EventToolCompleted = "tool.completed" EventRunCompleted = "run.completed" EventRunFailed = "run.failed" EventRunCancelled = "run.cancelled" EventPing = "ping" )
View Source
const ( EventTrajectoryRecord = "trajectory.record" TrajectoryRunStarted = "run.started" TrajectoryModelInput = "model.input" TrajectoryModelOutput = "model.output" TrajectoryToolResult = "tool.result" TrajectoryRunFinished = "run.finished" )
View Source
const DefaultSystemPrompt = `` /* 427-byte string literal not displayed */
Variables ¶
View Source
var ErrConversationBusy = errors.New("conversation already has an active run")
Functions ¶
func NewLocalTools ¶
func NewLocalTools(workspaceRoot string, skills *SkillRegistry) ([]tool.BaseTool, error)
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func NewAgent ¶
func NewAgent(ctx context.Context, chatModel model.ToolCallingChatModel, tools []tool.BaseTool, memory *MemoryStore, systemPrompt string) (*Agent, error)
type Config ¶
type Config struct {
Port string
WorkspaceRoot string
BuiltinSkillsDir string
MCPConfigPaths []string
Model string
ModelBaseURL string
ModelAPIKey string
SummaryModel string
SystemPrompt string
ContextTokens int
AuthEnabled bool
SandboxJWTPublicPath string
SandboxJWTIssuer string
SandboxJWTAudience string
SandboxJWTClockSkew time.Duration
}
type DecisionReplayReport ¶
type DecisionReplayReport struct {
Mode string `json:"mode"`
Status string `json:"status"`
TotalSteps int `json:"total_steps"`
MatchedSteps int `json:"matched_steps"`
Score float64 `json:"score"`
Steps []DecisionReplayStep `json:"steps"`
Output string `json:"output,omitempty"`
Error string `json:"error,omitempty"`
}
type DecisionReplayRequest ¶
type DecisionReplayRequest struct {
Records []TrajectoryRecord `json:"records"`
}
type DecisionReplayStep ¶
type DecisionReplayStep struct {
Step int `json:"step"`
Matched bool `json:"matched"`
Expected []ReplayToolCall `json:"expected"`
Actual []ReplayToolCall `json:"actual"`
ContentChanged bool `json:"content_changed"`
}
type MCPManager ¶
type MCPManager struct {
// contains filtered or unexported fields
}
func LoadMCPTools ¶
func (*MCPManager) Close ¶
func (m *MCPManager) Close() error
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore(workspaceRoot string, contextTokens int, compressionModels ...string) *MemoryStore
func (*MemoryStore) Append ¶
func (s *MemoryStore) Append(conversationID string, message *schema.Message) error
type ReplayToolCall ¶
type RunManager ¶
type RunManager struct {
// contains filtered or unexported fields
}
func NewRunManager ¶
func NewRunManager(agent *Agent, root string) (*RunManager, error)
func (*RunManager) Cancel ¶
func (m *RunManager) Cancel(runID string) bool
func (*RunManager) Close ¶
func (m *RunManager) Close()
type SkillRegistry ¶
type SkillRegistry struct {
// contains filtered or unexported fields
}
func LoadSkills ¶
func LoadSkills(builtinDir, workspaceRoot string) (*SkillRegistry, error)
func (*SkillRegistry) Index ¶
func (r *SkillRegistry) Index() string
type TrajectoryRecord ¶
type TrajectoryRecord struct {
Version int `json:"version"`
RunID string `json:"run_id"`
ConversationID string `json:"conversation_id"`
Sequence int64 `json:"sequence"`
Type string `json:"type"`
Step int `json:"step,omitempty"`
Timestamp string `json:"timestamp"`
Payload json.RawMessage `json:"payload,omitempty"`
PreviousHash string `json:"previous_hash,omitempty"`
Hash string `json:"hash"`
}
type TrajectoryStore ¶
type TrajectoryStore struct {
// contains filtered or unexported fields
}
func NewTrajectoryStore ¶
func NewTrajectoryStore(workspaceRoot string) *TrajectoryStore
func (*TrajectoryStore) Append ¶
func (s *TrajectoryStore) Append(runID, conversationID, recordType string, step int, payload any) (*TrajectoryRecord, error)
func (*TrajectoryStore) Records ¶
func (s *TrajectoryStore) Records(runID string) ([]TrajectoryRecord, error)
Click to show internal directories.
Click to hide internal directories.