Split hook.rs: core orchestration -> subconscious.rs
subconscious::subconscious — AgentCycleState, AgentInfo, AgentSnapshot, SavedAgentState, format_agent_output, cycle methods. Core agent lifecycle independent of Claude Code. subconscious::hook — Claude Code hook: context loading, chunking, seen-set management, run_agent_cycles (serialized state entry point). Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
fbc8572840
commit
c814ed1345
6 changed files with 416 additions and 411 deletions
|
|
@ -75,7 +75,7 @@ pub struct Agent {
|
|||
/// Stable session ID for memory-search dedup across turns.
|
||||
session_id: String,
|
||||
/// Agent orchestration state (surface-observe, journal, reflect).
|
||||
pub agent_cycles: crate::subconscious::hook::AgentCycleState,
|
||||
pub agent_cycles: crate::subconscious::subconscious::AgentCycleState,
|
||||
}
|
||||
|
||||
impl Agent {
|
||||
|
|
@ -98,7 +98,7 @@ impl Agent {
|
|||
loaded_nodes: Vec::new(),
|
||||
};
|
||||
let session_id = format!("poc-agent-{}", chrono::Utc::now().format("%Y%m%d-%H%M%S"));
|
||||
let agent_cycles = crate::subconscious::hook::AgentCycleState::new(&session_id);
|
||||
let agent_cycles = crate::subconscious::subconscious::AgentCycleState::new(&session_id);
|
||||
let mut agent = Self {
|
||||
client,
|
||||
messages: Vec::new(),
|
||||
|
|
@ -145,7 +145,7 @@ impl Agent {
|
|||
);
|
||||
|
||||
self.agent_cycles.trigger(&session);
|
||||
let text = crate::subconscious::hook::format_agent_output(&self.agent_cycles.last_output);
|
||||
let text = crate::subconscious::subconscious::format_agent_output(&self.agent_cycles.last_output);
|
||||
if text.trim().is_empty() {
|
||||
None
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ pub struct App {
|
|||
/// Agent screen: viewing log for selected agent.
|
||||
agent_log_view: bool,
|
||||
/// Agent state from last cycle update.
|
||||
agent_state: Vec<crate::subconscious::hook::AgentSnapshot>,
|
||||
agent_state: Vec<crate::subconscious::subconscious::AgentSnapshot>,
|
||||
}
|
||||
|
||||
/// Overlay screens toggled by F-keys.
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ pub enum UiMessage {
|
|||
ContextInfoUpdate(ContextInfo),
|
||||
|
||||
/// Agent cycle state update — refreshes the F2 agents screen.
|
||||
AgentUpdate(Vec<crate::subconscious::hook::AgentSnapshot>),
|
||||
AgentUpdate(Vec<crate::subconscious::subconscious::AgentSnapshot>),
|
||||
}
|
||||
|
||||
/// Sender that fans out to both the TUI (mpsc) and observers (broadcast).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue