Expand description
Pack compiler β the canonical entry point for compiling a CELLSTATE pack.
Call compose_pack() with a PackInput (TOML manifest + Markdown files) to
get a PackOutput containing both the intermediate CellstateAst and the final
CompiledConfig.
This module orchestrates the full pipeline:
- Parse the TOML manifest (
cstate.toml) viaschema::parse_manifest. - Parse Markdown prompt files, extracting fence blocks (
markdownsub-module). - Build the intermediate representation (
ir::PackIr), merging TOML and Markdown-derived definitions and validating cross-references. - Convert the IR into a
CellstateAst(ast::build_ast). - Compile the AST into a
CompiledConfigviaPipelineCompiler::compile. - Inject pack-specific metadata (tools, toolsets, agents, injections, routing, file hashes) into the compiled config.
The ast module provides the shared types that this module produces. The
config/ module provides the YAML fence-block parsers that this module calls
during step 2.
Re-exportsΒ§
pub use flow::*;
ModulesΒ§
- a2a
- A2A (Agent-to-Agent) Agent Card generation.
- a2ui_
compat - Google A2UI compatibility layer.
- agents_
md - AGENTS.md generation from Pack configuration.
- ast π
- Pack IR -> CellstateAst
- flow
- Flow definition and execution receipts
- ir π
- Pack IR and validation
- llms_
txt - llms.txt generation from Pack configuration.
- markdown π
- Markdown lint + extraction for pack prompts
- mcp π
- MCP (Model Context Protocol) schema generation.
- schema π
- Pack manifest schema (cstate.toml)
- skills
- Agent Skills interoperability (SKILL.md emit/parse).
StructsΒ§
- Adapter
Def - Composio
Gateway Def - Dynamic Composio MCP Gateway configuration. Enables runtime discovery of Composioβs 800+ tool integrations via a meta-tool.
- Defaults
Section - Extracted
Blocks - Extracted metadata from markdown fenced blocks.
- Fenced
Block - Format
Def - Injection
Def - Markdown
Doc - Markdown
Error - McpSchema
- MCP schema representation for tool serving.
- McpTool
- Individual tool in MCP schema.
- Meta
Section - Pack
Agent Binding - Pack agent binding - wires toolsets and prompts to an agent role. Not to be confused with ast::AgentDef which defines agent capabilities.
- Pack
Input - PackIr
- Pack
Manifest - Pack
Markdown File - Pack
Output - Policy
Action Def - Policy
Def - Profile
Binding - Profile
Def - Provider
Def - Routing
Section - Settings
Matrix - Settings
Section - Tool
Bash Def - Bash tool definition β sandboxed command execution via just-bash.
- Tool
Browser Def - Browser tool definition β accessibility-first browser automation.
- Tool
Composio Def - Composio tool definition β managed SaaS integrations via Composio REST API. Composio handles OAuth, authentication, and API mapping for 800+ tools. CELLSTATE records why the tool was called, what memory informed the decision, and what gates it passed.
- Tool
Exec Def - Tool
Prompt Def - Tools
Section - Toolset
Def - User
Section
EnumsΒ§
FunctionsΒ§
- ast_
from_ ir - Builds a CELLSTATE AST from a pack intermediate representation.
- build_
ast - compile_
composio_ πgateway - Compile Composio MCP Gateway configuration from manifest.
- compile_
flows π - Compile flow definitions into compiled flows with content hashes.
- compile_
pack_ agents - Compile pack agent bindings to toolsets with extracted markdown metadata.
- compile_
pack_ injections - Compile pack injection metadata for runtime wiring.
- compile_
pack_ routing - Compile pack provider routing hints.
- compile_
tools - Compile pack tool registry into runtime tool configs.
contractsmaps contract paths to their JSON content. - compile_
toolsets - Compile pack toolsets into runtime toolset configs.
- compose_
pack - compute_
file_ πhashes - Compute SHA-256 hashes for all pack source files. These hashes enable runtime drift detection without recompilation.
- generate_
mcp_ schema - Generate deterministic MCP schema from compiled configuration.
- inject_
pack_ πmetadata - Inject pack-level metadata from the manifest into CompiledConfig.
- parse_
manifest - parse_
markdown_ files - sha256_
hex π - Compute SHA-256 hash of content, returning hex-encoded string.
- to_
canonical_ json - Serialize MCP schema to canonical JSON.
Type AliasesΒ§
- Contract
Files - Contract files loaded from the pack for schema compilation.