Rename Session -> HookSession
The hook's Session is not the same as poc-agent's session concept. Rename to avoid confusion now that poc-agent will create HookSessions to call into the agent cycle. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
a0245c1279
commit
55a037f4c7
5 changed files with 19 additions and 19 deletions
|
|
@ -10,14 +10,14 @@ use std::collections::HashSet;
|
|||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub struct Session {
|
||||
pub struct HookSession {
|
||||
pub session_id: String,
|
||||
pub transcript_path: String,
|
||||
pub hook_event: String,
|
||||
pub state_dir: PathBuf,
|
||||
}
|
||||
|
||||
impl Session {
|
||||
impl HookSession {
|
||||
fn sessions_dir() -> PathBuf {
|
||||
let dir = dirs::home_dir().unwrap_or_default().join(".consciousness/sessions");
|
||||
fs::create_dir_all(&dir).ok();
|
||||
|
|
@ -33,7 +33,7 @@ impl Session {
|
|||
let transcript_path = json["transcript_path"].as_str().unwrap_or("").to_string();
|
||||
let hook_event = json["hook_event_name"].as_str().unwrap_or("").to_string();
|
||||
|
||||
Some(Session { session_id, transcript_path, hook_event, state_dir })
|
||||
Some(HookSession { session_id, transcript_path, hook_event, state_dir })
|
||||
}
|
||||
|
||||
pub fn path(&self, prefix: &str) -> PathBuf {
|
||||
|
|
@ -44,7 +44,7 @@ impl Session {
|
|||
pub fn from_id(session_id: String) -> Option<Self> {
|
||||
if session_id.is_empty() { return None; }
|
||||
let state_dir = Self::sessions_dir();
|
||||
Some(Session {
|
||||
Some(HookSession {
|
||||
session_id,
|
||||
transcript_path: String::new(),
|
||||
hook_event: String::new(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue