Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ syn = { version = "2", features = ["full"] }
schemars = { version = "1.0", features = ["derive"] }
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
serde_norway = "0.9"
sha2 = "0.10"
syntect = "5"
thiserror = "2.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/merry-cli/src/coding/tests/skills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async fn projects_skill_metadata_without_body() {
std::fs::create_dir_all(skill_root.join("demo")).expect("mkdir skill");
std::fs::write(
skill_root.join("demo/SKILL.md"),
"---\nname: demo-skill\ndescription: Use for demo tasks.\n---\n# Demo\nbody sentinel\n",
"---\nname: demo-skill\ndescription: Use for demo tasks.\nmetadata:\n cli_version: \">=1.2.3\"\n requires:\n bins:\n - demo-cli\n---\n# Demo\nbody sentinel\n",
)
.expect("write skill");

Expand Down
1 change: 1 addition & 0 deletions crates/merry-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ merry-tools-macros = { path = "../merry-tools-macros", version = "0.1.0" }
schemars.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_norway.workspace = true
sha2.workspace = true
thiserror.workspace = true
tokio.workspace = true
Expand Down
7 changes: 2 additions & 5 deletions crates/merry-runtime/src/context/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::{
ActivatedMemory, MemoryActivationProvenance, MemoryActivationReason, MemoryActivationScore,
MemoryEvidence, MemoryId, MemoryScope,
},
text,
token_estimate::estimate_text_tokens,
};
use merry_core::EvidenceRef;
Expand All @@ -33,11 +34,7 @@ fn format_memory_scopes(scopes: &[MemoryScope]) -> String {
}

fn canonicalize_memory_reason_text(value: &str) -> String {
value
.split_whitespace()
.collect::<Vec<_>>()
.join(" ")
.to_lowercase()
text::collapse_whitespace(value).to_lowercase()
}

/// Compiles allowlisted structured runtime state into a deterministic context snapshot.
Expand Down
6 changes: 5 additions & 1 deletion crates/merry-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ mod session_store;
mod skill;
mod step;
mod subagent;
mod text;
mod token_estimate;
mod tool;
mod tool_admission;
Expand Down Expand Up @@ -155,7 +156,10 @@ pub use session_projection::SessionTranscriptItem;
pub use session_store::{
FileSessionStore, PlanPersistenceLocation, SessionReservation, SessionStoreError,
};
pub use skill::{SkillCatalog, SkillError, SkillLoadWarning, SkillMetadata};
pub use skill::{
FrontmatterError, SkillCatalog, SkillError, SkillLoadWarning, SkillLoadWarningReason,
SkillMetadata,
};
pub use step::StepContext;
pub use subagent::{
CancelSubagentsInput, ChildRuntimeFactory, ChildRuntimeInput, ChildWorkspaceScope,
Expand Down
9 changes: 3 additions & 6 deletions crates/merry-runtime/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Staged internal activation types are compiled before every call path is wired.
#![cfg_attr(not(test), allow(dead_code))]

use crate::text;
use merry_core::EvidenceRef;
use std::{cmp::Ordering, fmt};
use thiserror::Error;
Expand Down Expand Up @@ -608,15 +609,11 @@ fn validate_non_blank(field: &'static str, value: &str) -> Result<(), MemoryErro
}

fn canonicalize_match_text(value: &str) -> String {
value
.split_whitespace()
.collect::<Vec<_>>()
.join(" ")
.to_lowercase()
text::collapse_whitespace(value).to_lowercase()
}

fn canonicalize_label_text(value: &str) -> String {
value.split_whitespace().collect::<Vec<_>>().join(" ")
text::collapse_whitespace(value)
}

fn validate_reason(reason: &MemoryActivationReason) -> Result<(), MemoryError> {
Expand Down
Loading
Loading