Base: codex-main originale (prima del fork aKode)

This commit is contained in:
Andrea
2026-11-09 10:37:42 +01:00
commit 7874033c81
10166 changed files with 2728937 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
use std::io;
use std::sync::Arc;
use crate::SkillLoadOutcome;
use codex_exec_server::EnvironmentAccess;
use codex_extension_api::ExtensionData;
use codex_skills::SkillMetadata;
/// Immutable snapshot of host-owned skills and their source filesystems.
#[derive(Debug, Clone)]
pub struct HostSkillsSnapshot {
outcome: Arc<SkillLoadOutcome>,
}
impl HostSkillsSnapshot {
pub fn new(outcome: Arc<SkillLoadOutcome>) -> Self {
Self { outcome }
}
/// Prefer the snapshot prepared with this step's permissions when the host supplies one.
pub fn for_step(step_store: &ExtensionData, turn_store: &ExtensionData) -> Option<Arc<Self>> {
step_store
.get::<Self>()
.or_else(|| turn_store.get::<Self>())
}
pub fn outcome(&self) -> &SkillLoadOutcome {
self.outcome.as_ref()
}
pub async fn read_skill_text(
&self,
skill: &SkillMetadata,
accessors: &[&dyn EnvironmentAccess],
) -> io::Result<String> {
self.outcome.read_skill_text(skill, accessors).await
}
}