Documentation
¶
Index ¶
- Constants
- Variables
- type App
- func (a *App) FlushRuntimeState() error
- func (a *App) FlushRuntimeStateIfDirty() error
- func (a *App) GetSessionThreadID(sessionKey string) string
- func (a *App) IsSessionActive(sessionKey string) bool
- func (a *App) LoadRuntimeState(path string) error
- func (a *App) ReleaseSession(sessionKey string)
- func (a *App) Run(ctx context.Context) error
- func (a *App) RunWithoutConnector(ctx context.Context) error
- func (a *App) SetAutomationRunner(runner AutomationRunner)
- func (a *App) SetBotOpenID(openID string)
- func (a *App) SetCardActionHandler(handler CardActionHandler)
- func (a *App) SetPromptLoader(loader *prompting.Loader)
- func (a *App) TryAcquireSession(sessionKey string, cancel context.CancelCauseFunc) bool
- func (a *App) UpdateRuntimeConfig(cfg config.Config)
- type Attachment
- type AttachmentDownloader
- type AutomationRunner
- type CardActionHandler
- type CardActionRequest
- type CardActionResult
- type ChatMemberNameResolver
- type Job
- type JobProcessState
- type MentionedUser
- type Processor
- func (p *Processor) FlushSessionState() error
- func (p *Processor) FlushSessionStateIfDirty() error
- func (p *Processor) LoadSessionState(path string) error
- func (p *Processor) ProcessJob(ctx context.Context, job Job) bool
- func (p *Processor) ProcessJobState(ctx context.Context, job Job) JobProcessState
- func (p *Processor) SetBuiltinHelpConfig(cfg config.Config)
- func (p *Processor) SetHeartbeatShowShellCommands(show bool)
- func (p *Processor) SetImmediateFeedback(mode, emojiType string)
- func (p *Processor) SetLLMBackend(backend llm.Backend)
- func (p *Processor) SetPromptLoader(loader *prompting.Loader)
- func (p *Processor) SetReplyMessages(failureMessage, thinkingMessage string)
- func (p *Processor) SetRuntimeAPI(baseURL, token, runtimeBin string)
- func (p *Processor) SetSceneIdentityHints(chatDisable, workDisable bool)
- func (p *Processor) SetStatusIdentity(botID, botName string)
- func (p *Processor) SetStatusStores(automationStore *automation.Store)
- func (p *Processor) SetStatusUsageSources(sources []StatusUsageSource)
- func (p *Processor) SetWorkspaceDir(workspaceDir string)
- func (p *Processor) TrySteerJob(ctx context.Context, job Job) (bool, error)
- func (p *Processor) UpdateRuntimeConfig(update ProcessorRuntimeUpdate) error
- type ProcessorRuntimeUpdate
- type ReplyContextProvider
- type Sender
- type StatusUsageSource
- type UserNameResolver
Constants ¶
const ( CardActionDecisionApprove = "approve" CardActionDecisionReject = "reject" )
Variables ¶
var ErrIgnoreMessage = errors.New("ignore message")
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) FlushRuntimeState ¶
func (*App) FlushRuntimeStateIfDirty ¶
func (*App) GetSessionThreadID ¶ added in v0.6.110
GetSessionThreadID returns the current backend LLM thread ID for the given session key. Returns an empty string if the session has no thread yet.
func (*App) IsSessionActive ¶ added in v0.6.62
IsSessionActive reports whether any session matching the given sessionKey's visibility prefix is currently processing a user message. The automation engine calls this before executing a scheduled task to skip execution when the user is actively conversing, avoiding interruption.
Thread isolation: if either the query key or an active key carries a thread-specific token (seed or thread), only sessions in the *same* thread are considered a match. This prevents a conversation in one Feishu work-thread from blocking automation tasks that target a different thread in the same group.
func (*App) LoadRuntimeState ¶
func (*App) ReleaseSession ¶ added in v0.6.80
ReleaseSession removes a previously acquired automation session entry. It is a no-op if the session entry was already replaced by a newer user-message run (version != 0).
func (*App) RunWithoutConnector ¶ added in v0.6.9
func (*App) SetAutomationRunner ¶
func (a *App) SetAutomationRunner(runner AutomationRunner)
func (*App) SetBotOpenID ¶ added in v0.6.53
func (*App) SetCardActionHandler ¶ added in v0.6.13
func (a *App) SetCardActionHandler(handler CardActionHandler)
func (*App) SetPromptLoader ¶
func (*App) TryAcquireSession ¶ added in v0.6.80
func (a *App) TryAcquireSession(sessionKey string, cancel context.CancelCauseFunc) bool
TryAcquireSession atomically checks whether the session is inactive and, if so, registers it as active with version=0. Version 0 ensures that any real user message (version >= 1) will interrupt the task via the cancel function passed to this method (see enqueueJob).
func (*App) UpdateRuntimeConfig ¶
type Attachment ¶
type AttachmentDownloader ¶
type AttachmentDownloader interface {
DownloadAttachment(ctx context.Context, resourceScopeKey, sourceMessageID string, attachment *Attachment) error
}
type AutomationRunner ¶
type CardActionHandler ¶ added in v0.6.13
type CardActionHandler interface {
HandleCardAction(ctx context.Context, req CardActionRequest) (CardActionResult, error)
}
type CardActionRequest ¶ added in v0.6.13
type CardActionResult ¶ added in v0.6.13
type ChatMemberNameResolver ¶
type Job ¶
type Job struct {
ReceiveID string
ReceiveIDType string
ChatType string
BotID string
BotName string
BotOpenID string
BotUserID string
SoulPath string
SenderName string
SenderOpenID string
SenderUserID string
SenderUnionID string
MentionedUsers []MentionedUser
SourceMessageID string
ReplyParentMessageID string
ThreadID string
RootID string
MessageType string
Text string
Attachments []Attachment
RawContent string
EventID string
ReceivedAt time.Time
ResourceScopeKey string
SessionKey string
SessionVersion uint64
Scene string
ResponseMode string
CreateFeishuThread bool
LLMProvider string
LLMModel string
LLMProfile string
LLMReasoningEffort string
LLMVariant string
LLMPersonality string
LLMPromptPrefix string
NoReplyToken string
SoulDoc soulDocument
DisableAck bool
WorkflowPhase string
}
type JobProcessState ¶
type JobProcessState string
const ( JobProcessCompleted JobProcessState = "completed" JobProcessRetryAfterRestart JobProcessState = "retry_after_restart" )
type MentionedUser ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func (*Processor) FlushSessionState ¶
func (*Processor) FlushSessionStateIfDirty ¶
func (*Processor) LoadSessionState ¶
func (*Processor) ProcessJobState ¶
func (p *Processor) ProcessJobState(ctx context.Context, job Job) JobProcessState
func (*Processor) SetBuiltinHelpConfig ¶ added in v0.3.12
func (*Processor) SetHeartbeatShowShellCommands ¶ added in v0.6.92
func (*Processor) SetImmediateFeedback ¶
func (*Processor) SetLLMBackend ¶
func (*Processor) SetPromptLoader ¶
func (*Processor) SetReplyMessages ¶
func (*Processor) SetRuntimeAPI ¶
func (*Processor) SetSceneIdentityHints ¶ added in v0.6.110
func (*Processor) SetStatusIdentity ¶ added in v0.5.27
func (*Processor) SetStatusStores ¶ added in v0.5.25
func (p *Processor) SetStatusStores(automationStore *automation.Store)
func (*Processor) SetStatusUsageSources ¶ added in v0.5.27
func (p *Processor) SetStatusUsageSources(sources []StatusUsageSource)
func (*Processor) SetWorkspaceDir ¶ added in v0.6.68
func (*Processor) TrySteerJob ¶ added in v0.6.83
func (*Processor) UpdateRuntimeConfig ¶ added in v0.5.27
func (p *Processor) UpdateRuntimeConfig(update ProcessorRuntimeUpdate) error
type ProcessorRuntimeUpdate ¶ added in v0.5.27
type ReplyContextProvider ¶
type Sender ¶
type Sender = messaging.ConversationSender
type StatusUsageSource ¶ added in v0.5.27
Source Files
¶
- app.go
- app_automation.go
- app_queue.go
- app_state.go
- card.go
- card_action.go
- group_scenes.go
- llm_heartbeat.go
- message.go
- message_identity.go
- message_mentions.go
- message_post.go
- message_session.go
- message_text.go
- message_trigger.go
- outgoing_hidden.go
- outgoing_mentions.go
- outgoing_plaintext.go
- processor.go
- processor_builtin_command.go
- processor_context.go
- processor_flow.go
- processor_runtime_update.go
- processor_status_service.go
- processor_status_usage.go
- processor_user_names.go
- prompt_templates.go
- reply_dispatcher.go
- runtime_store.go
- session_state.go
- session_state_persist.go
- soul_document.go
- types.go