pub fn parse_config_ref(s: &str) -> ConfigRefExpand description
Parse a string that may contain a {{...}} reference pattern.
ยงExamples
use phi_core::config::reference::{parse_config_ref, ConfigRef};
// Qualified, recreate
assert_eq!(
parse_config_ref("{{agent_profile.coder}}"),
ConfigRef::Qualified { ref_type: "agent_profile".into(), name: "coder".into(), recreate: true }
);
// Qualified, no recreation
assert_eq!(
parse_config_ref("{{%provider.openai%}}"),
ConfigRef::Qualified { ref_type: "provider".into(), name: "openai".into(), recreate: false }
);
// Unqualified, recreate
assert_eq!(
parse_config_ref("{{coder}}"),
ConfigRef::Unqualified { name: "coder".into(), recreate: true }
);
// System ID
assert_eq!(
parse_config_ref("{{#fctsidd-abc-123#}}"),
ConfigRef::SystemId { id: "fctsidd-abc-123".into() }
);
// Plain string
assert_eq!(
parse_config_ref("just-a-string"),
ConfigRef::Literal("just-a-string".into())
);