Versions in this module Expand all Collapse all v0 v0.0.3 Mar 26, 2026 v0.0.1 Mar 24, 2026 Changes in this version + func MatchesAnyName(actual string, expected ...string) bool + func MatchesName(actual, expected string) bool + func ModuleOrNil[T ModuleHooks](host Host, newFn func(Host) T) T + func ZerologFromHost(host Host) zerolog.Logger + type AssistantMessageInfo struct + Body string + CompletionTokens int64 + Model string + PromptTokens int64 + type CommandCall struct + Args []string + Name string + RawArgs string + Reply func(format string, args ...any) + Scope CommandScope + type CommandDefinition struct + AdminOnly bool + Aliases []string + Args string + Description string + Name string + RequiresLogin bool + RequiresPortal bool + type CommandIntegration interface + CommandDefinitions func(ctx context.Context, scope CommandScope) []CommandDefinition + ExecuteCommand func(ctx context.Context, call CommandCall) (handled bool, err error) + Name func() string + type CommandScope struct + Client any + Event any + Meta any + Portal any + type CompactionLifecycleEvent struct + Attempt int + Client any + ContextWindowTokens int + DroppedCount int + Error string + MessagesAfter int + MessagesBefore int + Meta any + Phase CompactionLifecyclePhase + Portal any + PromptTokens int + Reason string + RequestedTokens int + TokensAfter int + TokensBefore int + WillRetry bool + type CompactionLifecycleIntegration interface + Name func() string + OnCompactionLifecycle func(ctx context.Context, evt CompactionLifecycleEvent) + type CompactionLifecyclePhase string + const CompactionLifecycleEnd + const CompactionLifecycleFail + const CompactionLifecyclePreFlush + const CompactionLifecycleRefresh + const CompactionLifecycleStart + type CompletionResult struct + AssistantMessage openai.ChatCompletionMessageParamUnion + Done bool + ToolCalls []CompletionToolCall + type CompletionToolCall struct + ArgsJSON string + ID string + Name string + type ContextOverflowCall struct + Attempt int + Client any + Meta any + ModelMaxTokens int + Portal any + Prompt []openai.ChatCompletionMessageParamUnion + RequestedTokens int + type EventIntegration interface + Name func() string + OnFileChanged func(ctx context.Context, evt FileChangedEvent) + OnSessionMutation func(ctx context.Context, evt SessionMutationEvent) + type FileChangedEvent struct + Client any + Meta any + Path string + Portal any + type Host interface + AgentExists func(normalizedID string) bool + AgentIDFromMeta func(meta any) string + AgentModuleConfig func(agentID string, module string) map[string]any + AgentTimeoutSeconds func() int + AllToolDefinitions func() []ToolDefinition + BackgroundContext func(ctx context.Context) context.Context + BridgeDB func() any + BridgeID func() string + CloneMeta func(portal any) any + CompactionCount func(meta any) int + CompactorReserveTokens func() int + ContextWindow func(meta any) int + DefaultAgentID func() string + DispatchInternalMessage func(ctx context.Context, portal any, meta any, message string, source string) error + EffectiveModel func(meta any) string + EnqueueSystemEvent func(sessionKey string, text string, agentID string) + EstimateTokens func(prompt []openai.ChatCompletionMessageParamUnion, model string) int + ExecuteBuiltinTool func(ctx context.Context, scope ToolScope, name string, rawArgsJSON string) (string, error) + ExecuteToolInContext func(ctx context.Context, portal any, meta any, name string, argsJSON string) (string, error) + GetModuleMeta func(meta any, key string) any + GetOrCreatePortal func(ctx context.Context, portalID string, receiver string, displayName string, ...) (portal any, roomID string, err error) + HeartbeatAckMaxChars func(agentID string) int + IsGroupChat func(ctx context.Context, portal any) bool + IsInternalRoom func(meta any) bool + IsLoggedIn func() bool + IsSimpleMode func(meta any) bool + IsToolEnabled func(meta any, toolName string) bool + LastAssistantMessage func(ctx context.Context, portal any) (id string, timestamp int64) + Logger func() Logger + LoginDB func() any + LoginID func() string + MergeDisconnectContext func(ctx context.Context) (context.Context, context.CancelFunc) + ModuleConfig func(name string) map[string]any + ModuleEnabled func(name string) bool + NewCompletion func(ctx context.Context, model string, ...) (*CompletionResult, error) + NormalizeAgentID func(raw string) string + NormalizeThinkingLevel func(raw string) (string, bool) + Now func() time.Time + OverflowFlushConfig func() (enabled *bool, softThresholdTokens int, prompt string, systemPrompt string) + PersistSystemEvents func() + PortalKeyString func(portal any) string + PortalMeta func(portal any) any + PortalRoomID func(portal any) string + RawLogger func() any + ReadTextFile func(ctx context.Context, agentID string, path string) (content string, filePath string, found bool, err error) + RecentMessages func(ctx context.Context, portal any, count int) []MessageSummary + RequestNow func(ctx context.Context, reason string) + ResolveAgentID func(raw string, fallbackDefault string) string + ResolveDefaultPortal func(ctx context.Context) any + ResolveHeartbeatSessionKey func(agentID string) string + ResolveHeartbeatSessionPortal func(agentID string) (portal any, sessionKey string, err error) + ResolveLastActivePortal func(ctx context.Context, agentID string) any + ResolveLastTarget func(agentID string) (channel string, target string, ok bool) + ResolvePortalByRoomID func(ctx context.Context, roomID string) any + ResolveWorkspaceDir func() string + RunHeartbeatOnce func(ctx context.Context, reason string) (status string, reasonMsg string) + SavePortal func(ctx context.Context, portal any, reason string) error + SendAssistantMessage func(ctx context.Context, portal any, body string) error + SessionPortals func(ctx context.Context, loginID string, agentID string) ([]SessionPortalInfo, error) + SetMetaField func(meta any, key string, value any) + SetModuleMeta func(meta any, key string, value any) + SilentReplyToken func() string + SmartTruncatePrompt func(prompt []openai.ChatCompletionMessageParamUnion, ratio float64) []openai.ChatCompletionMessageParamUnion + ToolDefinitionByName func(name string) (ToolDefinition, bool) + ToolsToOpenAIParams func(tools []ToolDefinition) any + UserTimezone func() (tz string, loc *time.Location) + WaitForAssistantMessage func(ctx context.Context, portal any, afterID string, afterTS int64) (*AssistantMessageInfo, bool) + WriteTextFile func(ctx context.Context, portal any, meta any, agentID string, mode string, ...) (finalPath string, err error) + type LifecycleIntegration interface + Start func(ctx context.Context) error + Stop func() + type Logger interface + Debug func(msg string, fields map[string]any) + Error func(msg string, fields map[string]any) + Info func(msg string, fields map[string]any) + Warn func(msg string, fields map[string]any) + type LoginLifecycleIntegration interface + StopForLogin func(bridgeID, loginID string) + type LoginPurgeIntegration interface + Name func() string + PurgeForLogin func(ctx context.Context, scope LoginScope) error + type LoginScope struct + BridgeID string + Client any + Login any + LoginID string + type MessageSummary struct + Body string + Role string + type ModuleFactory func(host Host) ModuleHooks + type ModuleHooks interface + Name func() string + type PromptIntegration interface + AdditionalSystemMessages func(ctx context.Context, scope PromptScope) []openai.ChatCompletionMessageParamUnion + AugmentPrompt func(ctx context.Context, scope PromptScope, ...) []openai.ChatCompletionMessageParamUnion + Name func() string + type PromptScope struct + Client any + Meta any + Portal any + type SessionMutationEvent struct + Client any + Force bool + Kind SessionMutationKind + Meta any + Portal any + SessionKey string + type SessionMutationKind string + const SessionMutationDelete + const SessionMutationEdit + const SessionMutationMessage + const SessionMutationReplay + const SessionMutationUnknown + type SessionPortalInfo struct + Key string + PortalKey any + type SettingSource string + const SourceAgentPolicy + const SourceGlobalDefault + const SourceModelLimit + const SourceProviderConfig + const SourceProviderLimit + const SourceRoomOverride + const SourceUserDefault + type ToolApprovalIntegration interface + Name func() string + ToolApprovalRequirement func(toolName string, args map[string]any) (handled bool, required bool, action string) + type ToolCall struct + Args map[string]any + Name string + RawArgsJSON string + Scope ToolScope + type ToolDefinition struct + Description string + Execute func(ctx context.Context, args map[string]any) (string, error) + Name string + Parameters map[string]any + type ToolIntegration interface + ExecuteTool func(ctx context.Context, call ToolCall) (handled bool, result string, err error) + Name func() string + ToolAvailability func(ctx context.Context, scope ToolScope, toolName string) (known bool, available bool, source SettingSource, reason string) + ToolDefinitions func(ctx context.Context, scope ToolScope) []ToolDefinition + type ToolScope struct + Client any + Meta any + Portal any