picoclaw/pkg/constants/channels.go
mingzhi1 b29d13dcbb refactor: 3-phase runtime loop with CoT system and memory hierarchy
Architecture:
- Phase 1 (Analyse): lightweight pre-LLM for intent/tag extraction + CoT generation
- Phase 2 (Execute): LLM iteration loop with tool handling (from loop.go)
- Phase 3 (Reflect): post-LLM scoring, async processors, slash commands

Features:
- CoT template registry (8 built-in) with self-learning feedback loop
- SQLite-backed TurnStore for turn persistence
- Active Context: per-session file/error tracking
- Instant Memory: dynamic context window from TurnStore
- Memory Digest: batch background worker for long-term memory extraction
- Cross-platform shell commands for /shell
- Turn quality scoring for context prioritization

Design docs: runtime_loop_design.md, runtime_loop_task.md, runtime_builtin_cmd.md
2026-03-03 13:09:01 +08:00

27 lines
852 B
Go

// Package constants provides shared constants across the codebase.
package constants
import "strings"
// internalChannels defines channels that are used for internal communication
// and should not be exposed to external users or recorded as last active channel.
var internalChannels = map[string]struct{}{
"cli": {},
"system": {},
"subagent": {},
"launcher": {},
}
// IsInternalChannel returns true if the channel is an internal channel.
// Supports compound names like "launcher:chat" by checking the prefix before ":".
func IsInternalChannel(channel string) bool {
if _, found := internalChannels[channel]; found {
return true
}
// Check prefix for compound channel names (e.g. "launcher:chat")
if idx := strings.IndexByte(channel, ':'); idx > 0 {
_, found := internalChannels[channel[:idx]]
return found
}
return false
}