two swipes, one progress; home is zone 0; pocket is a belief
This commit is contained in:
parent
6c0730a790
commit
d7965a57fd
188 changed files with 9258 additions and 3970 deletions
|
|
@ -67,8 +67,12 @@ pub struct LlmConfig {
|
|||
pub checkpoint_interval: u32,
|
||||
}
|
||||
|
||||
fn default_supports_images() -> bool { true }
|
||||
fn default_checkpoint_interval() -> u32 { 10 }
|
||||
fn default_supports_images() -> bool {
|
||||
true
|
||||
}
|
||||
fn default_checkpoint_interval() -> u32 {
|
||||
10
|
||||
}
|
||||
|
||||
fn default_context_window() -> u32 {
|
||||
128000
|
||||
|
|
@ -200,7 +204,7 @@ pub struct Message {
|
|||
impl Message {
|
||||
/// Convert API Message to internal ConversationMessage
|
||||
pub fn to_conversation_message(&self) -> crate::core::session::ConversationMessage {
|
||||
use crate::core::session::{ConversationMessage, MessageRole, ContentBlock};
|
||||
use crate::core::session::{ContentBlock, ConversationMessage, MessageRole};
|
||||
|
||||
let role = match self.role.as_str() {
|
||||
"system" => MessageRole::System,
|
||||
|
|
@ -212,7 +216,9 @@ impl Message {
|
|||
|
||||
ConversationMessage {
|
||||
role,
|
||||
blocks: vec![ContentBlock::Text { text: self.content.clone() }],
|
||||
blocks: vec![ContentBlock::Text {
|
||||
text: self.content.clone(),
|
||||
}],
|
||||
usage: None,
|
||||
timestamp: Some(chrono::Utc::now()),
|
||||
}
|
||||
|
|
@ -271,7 +277,11 @@ pub enum StreamEvent {
|
|||
#[serde(rename = "tool_return_message")]
|
||||
ToolReturnMessage { tool_return: ToolReturn },
|
||||
#[serde(rename = "souveraine_surfacing")]
|
||||
Surfacing { source: String, content: String, priority: String },
|
||||
Surfacing {
|
||||
source: String,
|
||||
content: String,
|
||||
priority: String,
|
||||
},
|
||||
#[serde(rename = "souveraine_reflection")]
|
||||
Reflection { content: String },
|
||||
#[serde(rename = "souveraine_archivist")]
|
||||
|
|
@ -281,7 +291,11 @@ pub enum StreamEvent {
|
|||
#[serde(rename = "context_pressure")]
|
||||
ContextPressure { pressure: f32, tokens: usize },
|
||||
#[serde(rename = "inference_strain")]
|
||||
InferenceStrain { attempt: u32, status: u16, model: String },
|
||||
InferenceStrain {
|
||||
attempt: u32,
|
||||
status: u16,
|
||||
model: String,
|
||||
},
|
||||
#[serde(rename = "schedule_active")]
|
||||
ScheduleActive { name: String },
|
||||
#[serde(rename = "schedule_complete")]
|
||||
|
|
@ -291,7 +305,11 @@ pub enum StreamEvent {
|
|||
#[serde(rename = "subconscious_tool_call")]
|
||||
SubconsciousToolCall { name: String, arguments: String },
|
||||
#[serde(rename = "subconscious_tool_result")]
|
||||
SubconsciousToolResult { name: String, output: String, is_error: bool },
|
||||
SubconsciousToolResult {
|
||||
name: String,
|
||||
output: String,
|
||||
is_error: bool,
|
||||
},
|
||||
#[serde(rename = "subconscious_halt")]
|
||||
SubconsciousHalt { reason: String, severity: String },
|
||||
#[serde(rename = "subconscious_pass")]
|
||||
|
|
@ -303,7 +321,10 @@ pub enum StreamEvent {
|
|||
#[serde(rename = "outfit")]
|
||||
Outfit { name: String },
|
||||
#[serde(rename = "interstitial")]
|
||||
Interstitial { text: String, register: crate::backend::Register },
|
||||
Interstitial {
|
||||
text: String,
|
||||
register: crate::backend::Register,
|
||||
},
|
||||
#[serde(rename = "primary_complete")]
|
||||
PrimaryComplete,
|
||||
/// The turn failed in the substrate. Mirrors BackendEvent::Error so a
|
||||
|
|
@ -354,32 +375,81 @@ impl From<crate::backend::BackendEvent> for StreamEvent {
|
|||
match be {
|
||||
BE::Token(content) => Self::AssistantMessage { content },
|
||||
BE::Reasoning(content) => Self::ReasoningMessage { content },
|
||||
BE::Surfacing { source, content, priority } => Self::Surfacing { source, content, priority },
|
||||
BE::Surfacing {
|
||||
source,
|
||||
content,
|
||||
priority,
|
||||
} => Self::Surfacing {
|
||||
source,
|
||||
content,
|
||||
priority,
|
||||
},
|
||||
BE::Reflection(content) => Self::Reflection { content },
|
||||
BE::Archivist { synthesis, pressure } => Self::Archivist { synthesis, pressure },
|
||||
BE::Archivist {
|
||||
synthesis,
|
||||
pressure,
|
||||
} => Self::Archivist {
|
||||
synthesis,
|
||||
pressure,
|
||||
},
|
||||
BE::CompactionWarning { pressure, tier } => Self::CompactionWarning { pressure, tier },
|
||||
BE::ContextPressure(pressure, tokens) => Self::ContextPressure { pressure, tokens },
|
||||
BE::InferenceStrain { attempt, status, model } => Self::InferenceStrain { attempt, status, model },
|
||||
BE::InferenceStrain {
|
||||
attempt,
|
||||
status,
|
||||
model,
|
||||
} => Self::InferenceStrain {
|
||||
attempt,
|
||||
status,
|
||||
model,
|
||||
},
|
||||
BE::ScheduleActive { name } => Self::ScheduleActive { name },
|
||||
BE::ScheduleComplete { name, silent } => Self::ScheduleComplete { name, silent },
|
||||
BE::ToolCall { id, name, arguments, round } => Self::ToolCallMessage {
|
||||
tool_call: ToolCall { id, function: ToolFunction { name, arguments } },
|
||||
BE::ToolCall {
|
||||
id,
|
||||
name,
|
||||
arguments,
|
||||
round,
|
||||
} => Self::ToolCallMessage {
|
||||
tool_call: ToolCall {
|
||||
id,
|
||||
function: ToolFunction { name, arguments },
|
||||
},
|
||||
round,
|
||||
},
|
||||
BE::ToolResult { id, name, output, is_error } => Self::ToolReturnMessage {
|
||||
BE::ToolResult {
|
||||
id,
|
||||
name,
|
||||
output,
|
||||
is_error,
|
||||
} => Self::ToolReturnMessage {
|
||||
tool_return: ToolReturn {
|
||||
status: if is_error { "error".into() } else { "success".into() },
|
||||
status: if is_error {
|
||||
"error".into()
|
||||
} else {
|
||||
"success".into()
|
||||
},
|
||||
output,
|
||||
id,
|
||||
name,
|
||||
},
|
||||
},
|
||||
BE::SubconsciousToken(content) => Self::SubconsciousToken { content },
|
||||
BE::SubconsciousToolCall { name, arguments } => Self::SubconsciousToolCall { name, arguments },
|
||||
BE::SubconsciousToolResult { name, output, is_error } => {
|
||||
Self::SubconsciousToolResult { name, output, is_error }
|
||||
BE::SubconsciousToolCall { name, arguments } => {
|
||||
Self::SubconsciousToolCall { name, arguments }
|
||||
}
|
||||
BE::SubconsciousToolResult {
|
||||
name,
|
||||
output,
|
||||
is_error,
|
||||
} => Self::SubconsciousToolResult {
|
||||
name,
|
||||
output,
|
||||
is_error,
|
||||
},
|
||||
BE::SubconsciousHalt { reason, severity } => {
|
||||
Self::SubconsciousHalt { reason, severity }
|
||||
}
|
||||
BE::SubconsciousHalt { reason, severity } => Self::SubconsciousHalt { reason, severity },
|
||||
BE::SubconsciousPass(active) => Self::SubconsciousPass { active },
|
||||
BE::Atmosphere(preset) => Self::Atmosphere { preset },
|
||||
BE::Itinerary(route) => Self::Itinerary { route },
|
||||
|
|
@ -399,12 +469,38 @@ impl From<StreamEvent> for crate::backend::BackendEvent {
|
|||
match se {
|
||||
StreamEvent::AssistantMessage { content } => BE::Token(content),
|
||||
StreamEvent::ReasoningMessage { content } => BE::Reasoning(content),
|
||||
StreamEvent::Surfacing { source, content, priority } => BE::Surfacing { source, content, priority },
|
||||
StreamEvent::Surfacing {
|
||||
source,
|
||||
content,
|
||||
priority,
|
||||
} => BE::Surfacing {
|
||||
source,
|
||||
content,
|
||||
priority,
|
||||
},
|
||||
StreamEvent::Reflection { content } => BE::Reflection(content),
|
||||
StreamEvent::Archivist { synthesis, pressure } => BE::Archivist { synthesis, pressure },
|
||||
StreamEvent::CompactionWarning { pressure, tier } => BE::CompactionWarning { pressure, tier },
|
||||
StreamEvent::ContextPressure { pressure, tokens } => BE::ContextPressure(pressure, tokens),
|
||||
StreamEvent::InferenceStrain { attempt, status, model } => BE::InferenceStrain { attempt, status, model },
|
||||
StreamEvent::Archivist {
|
||||
synthesis,
|
||||
pressure,
|
||||
} => BE::Archivist {
|
||||
synthesis,
|
||||
pressure,
|
||||
},
|
||||
StreamEvent::CompactionWarning { pressure, tier } => {
|
||||
BE::CompactionWarning { pressure, tier }
|
||||
}
|
||||
StreamEvent::ContextPressure { pressure, tokens } => {
|
||||
BE::ContextPressure(pressure, tokens)
|
||||
}
|
||||
StreamEvent::InferenceStrain {
|
||||
attempt,
|
||||
status,
|
||||
model,
|
||||
} => BE::InferenceStrain {
|
||||
attempt,
|
||||
status,
|
||||
model,
|
||||
},
|
||||
StreamEvent::ScheduleActive { name } => BE::ScheduleActive { name },
|
||||
StreamEvent::ScheduleComplete { name, silent } => BE::ScheduleComplete { name, silent },
|
||||
StreamEvent::ToolCallMessage { tool_call, round } => BE::ToolCall {
|
||||
|
|
@ -420,11 +516,21 @@ impl From<StreamEvent> for crate::backend::BackendEvent {
|
|||
output: tool_return.output,
|
||||
},
|
||||
StreamEvent::SubconsciousToken { content } => BE::SubconsciousToken(content),
|
||||
StreamEvent::SubconsciousToolCall { name, arguments } => BE::SubconsciousToolCall { name, arguments },
|
||||
StreamEvent::SubconsciousToolResult { name, output, is_error } => {
|
||||
BE::SubconsciousToolResult { name, output, is_error }
|
||||
StreamEvent::SubconsciousToolCall { name, arguments } => {
|
||||
BE::SubconsciousToolCall { name, arguments }
|
||||
}
|
||||
StreamEvent::SubconsciousToolResult {
|
||||
name,
|
||||
output,
|
||||
is_error,
|
||||
} => BE::SubconsciousToolResult {
|
||||
name,
|
||||
output,
|
||||
is_error,
|
||||
},
|
||||
StreamEvent::SubconsciousHalt { reason, severity } => {
|
||||
BE::SubconsciousHalt { reason, severity }
|
||||
}
|
||||
StreamEvent::SubconsciousHalt { reason, severity } => BE::SubconsciousHalt { reason, severity },
|
||||
StreamEvent::SubconsciousPass { active } => BE::SubconsciousPass(active),
|
||||
StreamEvent::Atmosphere { preset } => BE::Atmosphere(preset),
|
||||
StreamEvent::Itinerary { route } => BE::Itinerary(route),
|
||||
|
|
|
|||
Loading…
Reference in a new issue