Skip to main content

Crate sim_lib_surface_card

Crate sim_lib_surface_card 

Source
Expand description

Shared, plain-data surface-card spine.

This crate holds the codec-neutral pieces of a “surface card”: the external-name policy used when projecting a kernel Symbol onto a foreign tool surface (MCP, OpenAI, file system, human-facing text) and a plain-data SurfaceDescriptor spine that depends only on kernel types.

Concrete surfaces (for example sim-lib-skill’s OpenAI tool descriptor) derive their external names through external_name, keeping a single source of truth for the mangling rules.

§Example

use sim_kernel::Symbol;
use sim_lib_surface_card::{ExternalNamePolicy, external_name};

let symbol = Symbol::qualified("skill", "do.thing");
assert_eq!(external_name(&symbol, ExternalNamePolicy::OpenAiTool), "skill_do_thing");
assert_eq!(external_name(&symbol, ExternalNamePolicy::HumanReadable), "skill/do.thing");

Structs§

SurfaceDescriptor
Plain-data spine describing a surface (a callable projected onto a foreign tool surface). Depends only on kernel types; concrete codecs render it.

Enums§

ExternalNamePolicy
Policy selecting how a kernel Symbol is mangled into a surface-specific external name.

Functions§

external_name
Project symbol onto an external name according to policy.