mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-06-12 16:10:58 +00:00
08a2d95c0c
Phase 1 (Core):
- Migration 000022: agent_heartbeats, heartbeat_run_logs, agent_config_permissions tables
- HeartbeatStore + ConfigPermissionStore interfaces with PG implementations
- HeartbeatTicker: background poll → active hours filter → queue-aware skip → run → smart suppression → deliver/log
- Heartbeat tool: status/get/set/toggle/set_checklist/get_checklist/test/logs actions
- Permission check with wildcard scope matching + TTL cache (60s)
- RPC methods: heartbeat.get/set/toggle/test/logs/checklist.get/checklist.set
- HEARTBEAT.md routed via context file interceptor (read/write for both open + predefined agents)
- Session keys: agent:{id}:heartbeat or agent:{id}💓{ts} (isolated)
- PromptMinimal for heartbeat sessions (like cron/subagent)
- Event broadcasting + cache invalidation via bus (heartbeat + config_perms)
- Gateway wiring: ticker init, event wiring, graceful shutdown
Phase 2 (Integration):
- wakeMode: CronPayload.WakeHeartbeat triggers heartbeat after cron job completes
- Queue-aware: Scheduler.HasActiveSessionsForAgent() skips busy agents
- Stagger: deterministic FNV offset spreads heartbeats across interval
- lightContext: RunRequest.LightContext skips context files, only injects checklist
- System prompt distinguishes cron (user-scheduled tasks) vs heartbeat (autonomous monitoring)
33 lines
902 B
Go
33 lines
902 B
Go
package store
|
|
|
|
import "database/sql"
|
|
|
|
// Stores is the top-level container for all storage backends.
|
|
type Stores struct {
|
|
DB *sql.DB // underlying connection
|
|
Sessions SessionStore
|
|
Memory MemoryStore
|
|
Cron CronStore
|
|
Pairing PairingStore
|
|
Skills SkillStore
|
|
Agents AgentStore
|
|
Providers ProviderStore
|
|
Tracing TracingStore
|
|
MCP MCPServerStore
|
|
CustomTools CustomToolStore
|
|
ChannelInstances ChannelInstanceStore
|
|
ConfigSecrets ConfigSecretsStore
|
|
AgentLinks AgentLinkStore
|
|
Teams TeamStore
|
|
BuiltinTools BuiltinToolStore
|
|
PendingMessages PendingMessageStore
|
|
KnowledgeGraph KnowledgeGraphStore
|
|
Contacts ContactStore
|
|
Activity ActivityStore
|
|
Snapshots SnapshotStore
|
|
SecureCLI SecureCLIStore
|
|
APIKeys APIKeyStore
|
|
Heartbeats HeartbeatStore
|
|
ConfigPermissions ConfigPermissionStore
|
|
}
|