Expand description
Deterministic prompt modules, context providers, compilation, and
inspection for tea-rs.
This pure context layer performs no filesystem, process, network, provider, executor, clock, or async-runtime work. Trust labels preserve provenance for inspection; they do not claim to prevent prompt injection.
Structs§
- Compiled
Prompt - Byte-identical compiled system prompt and explainability data.
- Conflict
Claim - Typed conflict claim attached to one segment.
- Conflict
Key - Canonical key for mutually exclusive prompt claims.
- Context
Error - Bounded safe context/compiler failure.
- Context
Identity Error - Invalid canonical context selector.
- Context
Provider Id - Canonical context-provider identity.
- Context
Request - Immutable inputs visible to context providers for one turn snapshot.
- Prompt
Budget - Exact byte and conservative token limits for one compiled prompt.
- Prompt
Compiler - Pure deterministic prompt compiler.
- Prompt
Diagnostic - Bounded deterministic compiler diagnostic without prompt content.
- Prompt
Inspection Entry - Explainable inspection row for one input prompt segment.
- Prompt
Module - Ordered prompt fragments contributed at one authority and priority.
- Prompt
Module Id - Canonical prompt-module identity.
- Prompt
Priority - Bounded priority used only within one authority class.
- Prompt
Provenance - Bounded source attribution retained through compilation.
- Prompt
Segment - One bounded sourced prompt fragment.
- Prompt
Segment Id - Canonical prompt-segment identity.
- Provenance
Error - Invalid prompt provenance.
- Segment
Error - Invalid prompt segment content.
- Session
Summary Provider - Explicit optional session-summary insertion point.
- SkillId
- Canonical skill metadata identity.
- Skill
Invocation - Parsed explicit
@skill <skill-id>invocation. - Skill
Metadata - Bounded declarative skill metadata; it does not execute the skill.
- Skill
Metadata Provider - Deterministic model-visible active skill metadata provider.
- Static
Context Provider - Deterministic provider returning an immutable module snapshot.
- Tool
Hint Provider - Generates guidance from prompt hints on the active tool snapshot.
- Workspace
Instruction - One caller-loaded workspace instruction document.
- Workspace
Instruction Provider - Provider over caller-supplied workspace instruction snapshots.
Enums§
- Budget
Behavior - Behavior when a selected segment cannot fit the remaining prompt budget.
- Cache
Scope - Intended reuse scope for prompt caching adapters.
- Conflict
Mode - Whether a selected conflict claim may be replaced by higher precedence.
- Context
Error Code - Stable machine-readable context failure classification.
- Module
Error - Prompt module invariant failure.
- Prompt
Authority - Fixed high-to-low prompt authority.
- Prompt
Diagnostic Code - Stable prompt-compiler diagnostic classification.
- Segment
Disposition - Final compiler disposition of one input segment.
- Skill
Error - Invalid skill metadata or invocation.
- Trust
Level - Declared origin trust for inspection and downstream policy.
Constants§
- MAX_
COMPILE_ MODULES - Maximum modules accepted by one compilation.
- MAX_
CONTEXT_ TOOLS - Maximum active tools visible to a context snapshot.
- MAX_
MODULE_ SEGMENTS - Maximum segments contributed by one module.
- MAX_
SEGMENT_ BYTES - Maximum UTF-8 bytes in one prompt segment.
- MAX_
SKILL_ DESCRIPTION_ BYTES - Maximum UTF-8 bytes in one skill description.
- PROMPT_
SEPARATOR - Fixed separator between accepted prompt segments.
- TRUNCATION_
MARKER - Fixed marker appended to deterministically shortened segments.
Traits§
- Context
Provider - Object-safe context source evaluated before prompt compilation.
Functions§
- estimate_
tokens - Deterministic conservative token estimate
ceil(utf8_bytes / 3).
Type Aliases§
- Context
Provider Future - Runtime-neutral boxed context-provider future.