Documentation
¶
Overview ¶
Package harnessbridge owns the rocketcode library bridge.
Index ¶
- Constants
- Variables
- func DeleteSessionIn(ctx context.Context, workspace, runtimeDir, conversationID string) (int64, error)
- func ExternalMCPAgentsIn(cfg *config.Config, runtimeDir string) ([]string, error)
- func IsBridgeStopped(err error) bool
- func LoadRuntimeDefinitions(cfg *config.Config, runtimeDir string) (rocketcode.Agents, rocketcode.Skills, error)
- func NoopActivationHook(_ context.Context, _ *events.InboundMessage) error
- func SessionDBPathIn(workspace, runtimeDir string) string
- func SlackThreadConversationID(channelID, threadTS string) string
- func SlackThreadTarget(conversationID string) (channelID, threadTS string, ok bool)
- func ValidateGoalCheckScriptStart(cfg *config.Config, agentName, script string) error
- type ActivationHook
- type ActiveTurnState
- type Bridge
- func (b *Bridge) InterruptActiveTurn() *events.InboundMessage
- func (b *Bridge) RecoverActiveTurn(ctx context.Context, turn *ActiveTurnState) error
- func (b *Bridge) ResetScheduledMessages() error
- func (b *Bridge) ScheduleMessage(delay time.Duration, message string, recurring bool) error
- func (b *Bridge) Start(ctx context.Context) error
- func (b *Bridge) Stop() error
- func (b *Bridge) Submit(ctx context.Context, msg *events.InboundMessage) error
- func (b *Bridge) SubmitWhenActive(ctx context.Context, msg *events.InboundMessage, activation ActivationHook) error
- func (b *Bridge) SwitchAgent(agent string)
- type CheckAndRecoverSessionDBResult
- type Config
- type CronScheduleRun
- type CronScheduleState
- type ExternalMCPSessionState
- type GoalRequest
- type GoalState
- type ObservedSessionEntry
- type PrimaryTextRouter
- type PruneStateStats
- type RawRunProgress
- type RawRunResult
- type ScheduledMessageState
- type SessionListOptions
- type SessionService
- func (s *SessionService) AccountGoalTurn(conversationID string) (GoalState, bool, error)
- func (s *SessionService) ActiveGoalThreads() (map[string]ThreadState, error)
- func (s *SessionService) ActiveGoals() (map[string]GoalState, error)
- func (s *SessionService) ActiveTurn(ctx context.Context, turnID string) (ActiveTurnState, bool, error)
- func (s *SessionService) AppendEntryID(ctx context.Context, conversationID string, entry *harness.SessionEntry) (int64, error)
- func (s *SessionService) ApplyPendingRestartNotifications(ctx context.Context) error
- func (s *SessionService) BeginGoal(conversationID, objective, checkScript string, maxTurns int) error
- func (s *SessionService) CheckpointWAL(ctx context.Context) (WALCheckpointStats, error)
- func (s *SessionService) ClaimCronSchedule(due CronScheduleState, nextDue, now time.Time) (CronScheduleRun, bool, error)
- func (s *SessionService) ClaimScheduledMessage(id, conversationID string, dueAt, now time.Time) (ScheduledMessageState, bool, error)
- func (s *SessionService) ClearActiveTurn(ctx context.Context, turnID string) error
- func (s *SessionService) ClearCompletedActiveTurn(ctx context.Context, turnID string) error
- func (s *SessionService) CompleteCronRun(relativePath string, now time.Time) error
- func (s *SessionService) DeleteScheduledMessage(id string) error
- func (s *SessionService) DueCronSchedules(now time.Time, limit int) ([]CronScheduleState, error)
- func (s *SessionService) ExternalMCPSession(externalConversationID string) (ExternalMCPSessionState, bool, error)
- func (s *SessionService) ExternalMCPSessionByConversationID(conversationID string) (externalConversationID string, session ExternalMCPSessionState, ok bool, ...)
- func (s *SessionService) Goal(conversationID string) (GoalState, bool, error)
- func (s *SessionService) MarkRestartRequester(ctx context.Context, conversationID string) error
- func (s *SessionService) ObserveEntries(ctx context.Context, conversationID string, lastID int64) ([]ObservedSessionEntry, error)
- func (s *SessionService) PruneStateBefore(ctx context.Context, cutoff time.Time) (PruneStateStats, error)
- func (s *SessionService) PutScheduledMessage(id string, message *ScheduledMessageState) error
- func (s *SessionService) RecordActiveTurnCheckpoint(ctx context.Context, checkpoint *harness.ActiveTurnCheckpoint) error
- func (s *SessionService) RecoverableActiveTurns(ctx context.Context) ([]ActiveTurnState, error)
- func (s *SessionService) RegisterExternalMCPConversation(externalConversationID, managedAgent string, session *ExternalMCPSessionState) error
- func (s *SessionService) ReleaseExternalMCPRecovery(conversationID string) error
- func (s *SessionService) RemoveExternalMCPConversation(externalConversationID string) error
- func (s *SessionService) ReserveExternalMCPRecovery(conversationID string) error
- func (s *SessionService) ResetCronSchedules() error
- func (s *SessionService) ResetScheduledMessages(conversationID string) error
- func (s *SessionService) ScheduledMessages() (map[string]ScheduledMessageState, error)
- func (s *SessionService) ScheduledMessagesForConversation(conversationID string) (map[string]ScheduledMessageState, error)
- func (s *SessionService) SetThreadAgentIfExists(conversationID, agent string) (bool, error)
- func (s *SessionService) StartActiveTurn(ctx context.Context, checkpoint *harness.ActiveTurnCheckpoint) error
- func (s *SessionService) Stop(context.Context) error
- func (s *SessionService) StopGoal(conversationID string) error
- func (s *SessionService) SyncCronSchedules(schedules []CronScheduleState, now time.Time) error
- func (s *SessionService) Thread(conversationID string) (ThreadState, bool, error)
- func (s *SessionService) UpdateGoalStatus(conversationID, status, note string) (GoalState, error)
- func (s *SessionService) UpsertActiveTurn(ctx context.Context, checkpoint *harness.ActiveTurnCheckpoint, ...) error
- func (s *SessionService) UpsertExternalMCPSession(externalConversationID string, session *ExternalMCPSessionState) error
- func (s *SessionService) UpsertThread(conversationID string, thread ThreadState) error
- func (s *SessionService) Vacuum(ctx context.Context) (VacuumStats, error)
- type SessionSummary
- type State
- type StateStoreLock
- type ThreadCreator
- type ThreadState
- type VacuumStats
- type WALCheckpointStats
Constants ¶
const ( GoalStatusActive = "active" GoalStatusProgress = "progress" GoalStatusComplete = "complete" GoalStatusBlocked = "blocked" GoalStatusStopped = "stopped" GoalStatusBudgetExhausted = "budget_exhausted" )
GoalStatusActive and related constants are persisted goal-loop statuses.
const RawRunExposedToolName = rawRunToolName
RawRunExposedToolName is the tool cron prompts use for human-visible output.
Variables ¶
var ErrGoalAlreadyActive = errors.New("goal already active")
ErrGoalAlreadyActive reports that a conversation already has an active goal.
var ErrStateStoreLocked = errors.New("rocketclaw state store is locked")
ErrStateStoreLocked reports that another RocketClaw process owns the state store.
Functions ¶
func DeleteSessionIn ¶
func DeleteSessionIn(ctx context.Context, workspace, runtimeDir, conversationID string) (int64, error)
DeleteSessionIn removes all entries for one conversation ID in runtimeDir and returns deleted rows.
func ExternalMCPAgentsIn ¶
ExternalMCPAgentsIn returns agents externally selectable through MCP in runtimeDir.
func IsBridgeStopped ¶ added in v0.0.29
IsBridgeStopped reports whether err was caused by a stopped bridge.
func LoadRuntimeDefinitions ¶ added in v0.0.32
func LoadRuntimeDefinitions(cfg *config.Config, runtimeDir string) (rocketcode.Agents, rocketcode.Skills, error)
LoadRuntimeDefinitions loads RocketCode definitions from runtimeDir without starting a run.
func NoopActivationHook ¶ added in v0.0.29
func NoopActivationHook(_ context.Context, _ *events.InboundMessage) error
NoopActivationHook leaves queued request activation unchanged.
func SessionDBPathIn ¶
SessionDBPathIn returns the SQLite database path for rocketcode session inspection in runtimeDir.
func SlackThreadConversationID ¶
SlackThreadConversationID returns the stable conversation ID for a Slack thread.
func SlackThreadTarget ¶ added in v0.0.7
SlackThreadTarget returns the Slack channel and thread timestamp for a Slack thread conversation ID.
Types ¶
type ActivationHook ¶ added in v0.0.29
type ActivationHook func(context.Context, *events.InboundMessage) error
ActivationHook runs after a queued request becomes active and before its turn starts.
type ActiveTurnState ¶ added in v0.0.29
type ActiveTurnState struct {
Checkpoint harness.ActiveTurnCheckpoint `json:"checkpoint"`
SourceMetadata map[string]string `json:"source_metadata,omitempty"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
}
ActiveTurnState records one durable RocketCode active-turn checkpoint.
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge forwards rocketclaw messages into one turn-lived rocketcode run per turn.
func NewConversation ¶
func NewConversation(cfg *config.Config, bus *events.Bus, bridgeConfig *Config, logger *slog.Logger) *Bridge
NewConversation constructs a rocketcode bridge for one conversation.
func (*Bridge) InterruptActiveTurn ¶ added in v0.0.7
func (b *Bridge) InterruptActiveTurn() *events.InboundMessage
InterruptActiveTurn interrupts current work and clears queued work for this bridge.
func (*Bridge) RecoverActiveTurn ¶ added in v0.0.29
func (b *Bridge) RecoverActiveTurn(ctx context.Context, turn *ActiveTurnState) error
RecoverActiveTurn enqueues a startup recovery continuation for this conversation.
func (*Bridge) ResetScheduledMessages ¶
ResetScheduledMessages deletes pending scheduled prompts for this conversation.
func (*Bridge) ScheduleMessage ¶
ScheduleMessage schedules one delayed prompt for this conversation.
func (*Bridge) SubmitWhenActive ¶ added in v0.0.29
func (b *Bridge) SubmitWhenActive(ctx context.Context, msg *events.InboundMessage, activation ActivationHook) error
SubmitWhenActive enqueues one inbound message and runs activation after earlier requests finish.
func (*Bridge) SwitchAgent ¶ added in v0.0.11
SwitchAgent changes the agent used for future turns in this conversation.
type CheckAndRecoverSessionDBResult ¶ added in v0.0.27
CheckAndRecoverSessionDBResult reports the manual state-store check outcome.
func CheckAndRecoverSessionDB ¶ added in v0.0.27
func CheckAndRecoverSessionDB(ctx context.Context, workspace, runtimeDir string, logger *slog.Logger) (CheckAndRecoverSessionDBResult, error)
CheckAndRecoverSessionDB checks and recovers the state DB for the fc check command.
type Config ¶
type Config struct {
ConversationID, Agent, AgentAfterRecovery, ManagedConversationID, ExternalConversationID string
OutputTargets []events.OutputTarget
RecoveringActiveTurn bool
RequestRestart func(context.Context, string) (string, error)
RequestReload func(context.Context, string) (string, error)
AskUserQuestion func(context.Context, *events.AskUserQuestionRequest) (events.AskUserQuestionAnswer, error)
StartNewThread func(context.Context, *events.StartNewThreadRequest) (events.StartNewThreadResult, error)
SessionService *SessionService
}
Config controls one rocketcode bridge conversation.
type CronScheduleRun ¶ added in v0.0.25
CronScheduleRun is a claimed scheduled cron run.
type CronScheduleState ¶ added in v0.0.25
CronScheduleState records one observed scheduled cron trigger.
type ExternalMCPSessionState ¶
type ExternalMCPSessionState struct {
Agent string `json:"agent,omitempty"`
PrivateConversationID string `json:"private_conversation_id,omitempty"`
ManagedConversationID string `json:"managed_conversation_id,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
SlackChannel string `json:"slack_channel,omitempty"`
}
ExternalMCPSessionState binds an external MCP conversation ID to private and managed sessions.
type GoalRequest ¶ added in v0.0.7
GoalRequest is one parsed text-connector goal start request.
func ParseGoalRequest ¶ added in v0.0.7
func ParseGoalRequest(text string) (GoalRequest, string, bool)
ParseGoalRequest parses a text-connector goal trigger. The boolean reports whether the text was a goal trigger.
type GoalState ¶ added in v0.0.7
type GoalState struct {
Objective string `json:"objective,omitempty"`
CheckScript string `json:"check_script,omitempty"`
MaxTurns int `json:"max_turns,omitempty"`
TurnsUsed int `json:"turns_used,omitempty"`
Status string `json:"status,omitempty"`
Note string `json:"note,omitempty"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
}
GoalState records one active or terminal managed-thread goal loop.
type ObservedSessionEntry ¶
type ObservedSessionEntry struct {
ID int64
Entry harness.SessionEntry
}
ObservedSessionEntry is one stored rocketcode entry with its SQLite row ID.
func ObserveSessionEntries ¶
func ObserveSessionEntries(ctx context.Context, dbPath, conversationID string, lastID int64) ([]ObservedSessionEntry, error)
ObserveSessionEntries returns replay entries and their row IDs after lastID.
type PrimaryTextRouter ¶ added in v0.0.7
type PrimaryTextRouter interface {
StartThread(ctx context.Context, agent string, target events.TextConversationTarget, inbound *events.InboundMessage) error
StartGoalInThread(ctx context.Context, agent, objective, checkScript string, maxTurns int, target events.TextConversationTarget, inbound *events.InboundMessage) error
InterruptThread(target events.TextConversationTarget) (*events.InboundMessage, error)
RegisterCronThread(ctx context.Context, target events.TextConversationTarget, agent string) error
ThreadAgent(target events.TextConversationTarget) (agent string, handled bool, err error)
SwitchThreadAgent(target events.TextConversationTarget, agent string) (bool, error)
SubmitThreadReply(ctx context.Context, target events.TextConversationTarget, inbound *events.InboundMessage) (bool, error)
}
PrimaryTextRouter routes primary text connector conversations to app-owned bridges.
type PruneStateStats ¶
PruneStateStats reports how much stale persisted state was removed.
type RawRunProgress ¶
type RawRunProgress struct {
SessionService *SessionService
ConversationID string
Thinking, Message func(context.Context, string) error
ScheduleMessage func(time.Duration, string, bool) error
ResetScheduledMessages func() error
RequestRestart func(context.Context, string) (string, error)
RequestReload func(context.Context, string) (string, error)
}
RawRunProgress controls raw rocketcode run persistence and receives observable output.
type RawRunResult ¶
type RawRunResult struct {
Text, VerbatimMessage string
Attachments []events.OutboundAttachment
}
RawRunResult is the observable result of one non-publishing raw rocketcode turn.
func RunRawWithProgress ¶
func RunRawWithProgress(ctx context.Context, cfg *config.Config, agent, prompt string, logger *slog.Logger, progress *RawRunProgress) (result RawRunResult, err error)
RunRawWithProgress executes a raw rocketcode turn and reports optional progress.
type ScheduledMessageState ¶
type ScheduledMessageState struct {
ConversationID string `json:"conversation_id,omitempty"`
Agent string `json:"agent,omitempty"`
Message string `json:"message,omitempty"`
DueAt time.Time `json:"due_at,omitzero"`
Recurring bool `json:"recurring,omitempty"`
Interval time.Duration `json:"interval,omitempty"`
}
ScheduledMessageState records one pending delayed system prompt.
type SessionListOptions ¶ added in v0.0.7
SessionListOptions bounds read-only session summary inspection.
type SessionService ¶
type SessionService struct {
// contains filtered or unexported fields
}
SessionService owns runtime SQLite session and state access inside one rocketclaw process.
func NewSessionServiceIn ¶
func NewSessionServiceIn(workspace, runtimeDir string, logger *slog.Logger) (*SessionService, error)
NewSessionServiceIn starts a runtime-owned SQLite session service in runtimeDir.
func (*SessionService) AccountGoalTurn ¶ added in v0.0.7
func (s *SessionService) AccountGoalTurn(conversationID string) (GoalState, bool, error)
AccountGoalTurn increments one active goal turn and applies budget exhaustion.
func (*SessionService) ActiveGoalThreads ¶ added in v0.0.25
func (s *SessionService) ActiveGoalThreads() (map[string]ThreadState, error)
ActiveGoalThreads returns managed thread state for conversations with active goals.
func (*SessionService) ActiveGoals ¶ added in v0.0.7
func (s *SessionService) ActiveGoals() (map[string]GoalState, error)
ActiveGoals returns persisted active goals keyed by conversation ID.
func (*SessionService) ActiveTurn ¶ added in v0.0.29
func (s *SessionService) ActiveTurn(ctx context.Context, turnID string) (ActiveTurnState, bool, error)
ActiveTurn returns a durable active-turn checkpoint.
func (*SessionService) AppendEntryID ¶
func (s *SessionService) AppendEntryID(ctx context.Context, conversationID string, entry *harness.SessionEntry) (int64, error)
AppendEntryID appends one entry through the runtime service and returns its row ID.
func (*SessionService) ApplyPendingRestartNotifications ¶
func (s *SessionService) ApplyPendingRestartNotifications(ctx context.Context) error
ApplyPendingRestartNotifications appends one developer notice to pending requester sessions.
func (*SessionService) BeginGoal ¶ added in v0.0.7
func (s *SessionService) BeginGoal(conversationID, objective, checkScript string, maxTurns int) error
BeginGoal records a new active goal for a managed conversation.
func (*SessionService) CheckpointWAL ¶
func (s *SessionService) CheckpointWAL(ctx context.Context) (WALCheckpointStats, error)
CheckpointWAL checkpoints and truncates the SQLite WAL through the runtime service handle.
func (*SessionService) ClaimCronSchedule ¶ added in v0.0.25
func (s *SessionService) ClaimCronSchedule(due CronScheduleState, nextDue, now time.Time) (CronScheduleRun, bool, error)
ClaimCronSchedule verifies one due scheduled cron trigger and records per-file running state.
func (*SessionService) ClaimScheduledMessage ¶ added in v0.0.25
func (s *SessionService) ClaimScheduledMessage(id, conversationID string, dueAt, now time.Time) (ScheduledMessageState, bool, error)
ClaimScheduledMessage verifies one due scheduled message and advances recurring messages atomically.
func (*SessionService) ClearActiveTurn ¶ added in v0.0.29
func (s *SessionService) ClearActiveTurn(ctx context.Context, turnID string) error
ClearActiveTurn removes an active root-turn checkpoint.
func (*SessionService) ClearCompletedActiveTurn ¶ added in v0.0.29
func (s *SessionService) ClearCompletedActiveTurn(ctx context.Context, turnID string) error
ClearCompletedActiveTurn deletes the restart handoff after the completed session entry is durable.
func (*SessionService) CompleteCronRun ¶ added in v0.0.25
func (s *SessionService) CompleteCronRun(relativePath string, now time.Time) error
CompleteCronRun clears per-file scheduled cron running state.
func (*SessionService) DeleteScheduledMessage ¶ added in v0.0.25
func (s *SessionService) DeleteScheduledMessage(id string) error
DeleteScheduledMessage deletes one scheduled message.
func (*SessionService) DueCronSchedules ¶ added in v0.0.25
func (s *SessionService) DueCronSchedules(now time.Time, limit int) ([]CronScheduleState, error)
DueCronSchedules returns observed scheduled cron definitions due at now.
func (*SessionService) ExternalMCPSession ¶ added in v0.0.25
func (s *SessionService) ExternalMCPSession(externalConversationID string) (ExternalMCPSessionState, bool, error)
ExternalMCPSession returns a persisted external MCP session mapping.
func (*SessionService) ExternalMCPSessionByConversationID ¶ added in v0.0.33
func (s *SessionService) ExternalMCPSessionByConversationID(conversationID string) (externalConversationID string, session ExternalMCPSessionState, ok bool, err error)
ExternalMCPSessionByConversationID returns the public ID and binding for either session ID.
func (*SessionService) Goal ¶ added in v0.0.7
func (s *SessionService) Goal(conversationID string) (GoalState, bool, error)
Goal returns the persisted goal state for a conversation.
func (*SessionService) MarkRestartRequester ¶
func (s *SessionService) MarkRestartRequester(ctx context.Context, conversationID string) error
MarkRestartRequester records that conversationID should see the post-restart notice.
func (*SessionService) ObserveEntries ¶
func (s *SessionService) ObserveEntries(ctx context.Context, conversationID string, lastID int64) ([]ObservedSessionEntry, error)
ObserveEntries loads observed session entries through the runtime service.
func (*SessionService) PruneStateBefore ¶
func (s *SessionService) PruneStateBefore(ctx context.Context, cutoff time.Time) (PruneStateStats, error)
PruneStateBefore removes expired thread and external-session state.
func (*SessionService) PutScheduledMessage ¶ added in v0.0.25
func (s *SessionService) PutScheduledMessage(id string, message *ScheduledMessageState) error
PutScheduledMessage persists one scheduled message.
func (*SessionService) RecordActiveTurnCheckpoint ¶ added in v0.0.29
func (s *SessionService) RecordActiveTurnCheckpoint(ctx context.Context, checkpoint *harness.ActiveTurnCheckpoint) error
RecordActiveTurnCheckpoint upserts an in-progress active root-turn checkpoint.
func (*SessionService) RecoverableActiveTurns ¶ added in v0.0.29
func (s *SessionService) RecoverableActiveTurns(ctx context.Context) ([]ActiveTurnState, error)
RecoverableActiveTurns returns remaining active-turn handoff rows for startup recovery.
func (*SessionService) RegisterExternalMCPConversation ¶ added in v0.0.33
func (s *SessionService) RegisterExternalMCPConversation(externalConversationID, managedAgent string, session *ExternalMCPSessionState) error
RegisterExternalMCPConversation atomically persists a managed conversation and its public binding.
func (*SessionService) ReleaseExternalMCPRecovery ¶ added in v0.0.33
func (s *SessionService) ReleaseExternalMCPRecovery(conversationID string) error
ReleaseExternalMCPRecovery releases paired work after recovery is abandoned.
func (*SessionService) RemoveExternalMCPConversation ¶ added in v0.0.33
func (s *SessionService) RemoveExternalMCPConversation(externalConversationID string) error
RemoveExternalMCPConversation removes a failed newly-created conversation and all of its durable state.
func (*SessionService) ReserveExternalMCPRecovery ¶ added in v0.0.33
func (s *SessionService) ReserveExternalMCPRecovery(conversationID string) error
ReserveExternalMCPRecovery makes paired work wait for the recovering owner.
func (*SessionService) ResetCronSchedules ¶ added in v0.0.25
func (s *SessionService) ResetCronSchedules() error
ResetCronSchedules clears scheduled cron state at daemon observation start.
func (*SessionService) ResetScheduledMessages ¶ added in v0.0.25
func (s *SessionService) ResetScheduledMessages(conversationID string) error
ResetScheduledMessages deletes pending scheduled messages for one conversation.
func (*SessionService) ScheduledMessages ¶ added in v0.0.25
func (s *SessionService) ScheduledMessages() (map[string]ScheduledMessageState, error)
ScheduledMessages returns all persisted scheduled messages.
func (*SessionService) ScheduledMessagesForConversation ¶ added in v0.0.25
func (s *SessionService) ScheduledMessagesForConversation(conversationID string) (map[string]ScheduledMessageState, error)
ScheduledMessagesForConversation returns persisted scheduled messages for one conversation.
func (*SessionService) SetThreadAgentIfExists ¶ added in v0.0.25
func (s *SessionService) SetThreadAgentIfExists(conversationID, agent string) (bool, error)
SetThreadAgentIfExists updates a managed conversation agent without creating a thread.
func (*SessionService) StartActiveTurn ¶ added in v0.0.29
func (s *SessionService) StartActiveTurn(ctx context.Context, checkpoint *harness.ActiveTurnCheckpoint) error
StartActiveTurn upserts a durable active root-turn checkpoint.
func (*SessionService) Stop ¶
func (s *SessionService) Stop(context.Context) error
Stop closes the runtime service and its SQLite handle.
func (*SessionService) StopGoal ¶ added in v0.0.7
func (s *SessionService) StopGoal(conversationID string) error
StopGoal marks an active goal stopped.
func (*SessionService) SyncCronSchedules ¶ added in v0.0.25
func (s *SessionService) SyncCronSchedules(schedules []CronScheduleState, now time.Time) error
SyncCronSchedules replaces observed scheduled cron definitions.
func (*SessionService) Thread ¶ added in v0.0.25
func (s *SessionService) Thread(conversationID string) (ThreadState, bool, error)
Thread returns the persisted managed conversation state.
func (*SessionService) UpdateGoalStatus ¶ added in v0.0.7
func (s *SessionService) UpdateGoalStatus(conversationID, status, note string) (GoalState, error)
UpdateGoalStatus records a model-controlled goal status update.
func (*SessionService) UpsertActiveTurn ¶ added in v0.0.29
func (s *SessionService) UpsertActiveTurn(ctx context.Context, checkpoint *harness.ActiveTurnCheckpoint, sourceMetadata map[string]string) error
UpsertActiveTurn records a RocketCode active-turn restart handoff checkpoint with source metadata.
func (*SessionService) UpsertExternalMCPSession ¶
func (s *SessionService) UpsertExternalMCPSession(externalConversationID string, session *ExternalMCPSessionState) error
UpsertExternalMCPSession records an external MCP conversation ID mapping.
func (*SessionService) UpsertThread ¶
func (s *SessionService) UpsertThread(conversationID string, thread ThreadState) error
UpsertThread records or updates a text-thread bridge entry.
func (*SessionService) Vacuum ¶
func (s *SessionService) Vacuum(ctx context.Context) (VacuumStats, error)
Vacuum runs incremental SQLite vacuum through the runtime service handle.
type SessionSummary ¶
type SessionSummary struct {
ConversationID, LastUserMessage, LastAssistantMessage string
Turns int
LastUpdated time.Time
}
SessionSummary is the compact observable state of one rocketcode session.
func ListSessionsInOptions ¶ added in v0.0.7
func ListSessionsInOptions(ctx context.Context, workspace, runtimeDir string, options SessionListOptions) ([]SessionSummary, error)
ListSessionsInOptions returns summaries for stored rocketcode sessions in runtimeDir.
type State ¶
type State struct {
Threads map[string]ThreadState `json:"threads,omitempty"`
ExternalMCPSessions map[string]ExternalMCPSessionState `json:"external_mcp_sessions,omitempty"`
ScheduledMessages map[string]ScheduledMessageState `json:"scheduled_messages,omitempty"`
Goals map[string]GoalState `json:"goals,omitempty"`
PendingRestartNotifications map[string]bool `json:"pending_restart_notifications,omitempty"`
}
State is the persisted rocketclaw session state.
type StateStoreLock ¶
type StateStoreLock struct {
// contains filtered or unexported fields
}
StateStoreLock holds advisory ownership of the RocketClaw state store.
func AcquireStateStoreLock ¶
func AcquireStateStoreLock(workspace, runtimeDir string) (*StateStoreLock, error)
AcquireStateStoreLock acquires non-blocking advisory ownership of the state store.
func (*StateStoreLock) Close ¶
func (l *StateStoreLock) Close() error
Close releases the state-store lock.
type ThreadCreator ¶ added in v0.0.16
type ThreadCreator string
ThreadCreator records which subsystem created a managed text conversation.
const ThreadCreatedByCron ThreadCreator = "cron"
ThreadCreatedByCron marks managed conversations created for cron output.
type ThreadState ¶
type ThreadState struct {
Agent string `json:"agent,omitempty"`
CreatedBy ThreadCreator `json:"created_by,omitempty"`
}
ThreadState is the persisted state for one text-thread bridge.
type VacuumStats ¶
type VacuumStats struct {
DBExists bool
BeforePageCount, BeforeFreePages int64
AfterPageCount, AfterFreePages int64
}
VacuumStats reports SQLite page counts before and after vacuuming.
type WALCheckpointStats ¶
type WALCheckpointStats struct {
Busy, LogFrames, CheckpointedFrames int64
}
WALCheckpointStats reports the outcome of a SQLite WAL checkpoint.