Files
picoclaw/pkg/agent/event_kind_runtime.go
T
Hoshina eedebabbea feat(events): add runtime event bus
Introduce pkg/events with filtered channels, subscription policies, backpressure, and stats. Wire AgentLoop to dual-publish legacy agent events into runtime events while preserving old event APIs.

Validation: go test ./pkg/events/... ./pkg/agent; go test -race ./pkg/events/...; make lint
2026-04-26 15:36:03 +08:00

49 lines
1.6 KiB
Go

package agent
import runtimeevents "github.com/sipeed/picoclaw/pkg/events"
func runtimeKindForAgentEvent(kind EventKind) runtimeevents.Kind {
switch kind {
case EventKindTurnStart:
return runtimeevents.KindAgentTurnStart
case EventKindTurnEnd:
return runtimeevents.KindAgentTurnEnd
case EventKindLLMRequest:
return runtimeevents.KindAgentLLMRequest
case EventKindLLMDelta:
return runtimeevents.KindAgentLLMDelta
case EventKindLLMResponse:
return runtimeevents.KindAgentLLMResponse
case EventKindLLMRetry:
return runtimeevents.KindAgentLLMRetry
case EventKindContextCompress:
return runtimeevents.KindAgentContextCompress
case EventKindSessionSummarize:
return runtimeevents.KindAgentSessionSummarize
case EventKindToolExecStart:
return runtimeevents.KindAgentToolExecStart
case EventKindToolExecEnd:
return runtimeevents.KindAgentToolExecEnd
case EventKindToolExecSkipped:
return runtimeevents.KindAgentToolExecSkipped
case EventKindSteeringInjected:
return runtimeevents.KindAgentSteeringInjected
case EventKindFollowUpQueued:
return runtimeevents.KindAgentFollowUpQueued
case EventKindInterruptReceived:
return runtimeevents.KindAgentInterruptReceived
case EventKindSubTurnSpawn:
return runtimeevents.KindAgentSubTurnSpawn
case EventKindSubTurnEnd:
return runtimeevents.KindAgentSubTurnEnd
case EventKindSubTurnResultDelivered:
return runtimeevents.KindAgentSubTurnResultDelivered
case EventKindSubTurnOrphan:
return runtimeevents.KindAgentSubTurnOrphan
case EventKindError:
return runtimeevents.KindAgentError
default:
return runtimeevents.Kind("agent." + kind.String())
}
}