Skip to main content

Crate supercode_interchange

Crate supercode_interchange 

Source
Expand description

Provider-neutral canonical data for coding-agent session interchange.

This crate is the dependency base for Supercode’s translators, optional reversible reducer, and optional native runtime. During the compatibility migration it first owns canonical messages and their deterministic token estimates; session containers and native codecs move here next without changing their public shapes.

Re-exports§

pub use catalog::DiscoveryPage;
pub use catalog::DiscoveryQuery;
pub use catalog::HarnessCatalog;
pub use catalog::HarnessHomes;
pub use catalog::HarnessId;
pub use catalog::SessionDescriptor;
pub use catalog::SessionLocator;
pub use catalog::SessionPreviewCandidate;
pub use catalog::StorageLocator;
pub use session::Session;
pub use session::SessionFormat;
pub use session::SessionMeta;
pub use session::SessionSource;
pub use watch::SessionFollower;
pub use watch::SessionSnapshotReason;
pub use watch::SessionWatchEvent;

Modules§

catalog
Discovery and durable addressing for sessions written by external harnesses.
session
Natively load — and continue — real Claude Code and Codex sessions.
session_tree
P5-5 (design §2 module 21 session.tree: “D5 in-place tree, rewind-anywhere, branch summaries, entry labels”; §2.1 D-6 session.tree → core.session(tree-addressable transcript); §2.2 C7; §5.2 P5 row 5: “loaders are already tree-aware (C7 resolution); adds in-place rewind/branch/label on the native store”).
sidecar
The supercode-native v2 wire record for a conversation turn appended after import.
watch
Passive, change-triggered following of local coding-harness sessions.

Structs§

ChatMessage
A single message in a conversation.
FidelityMetric
Result of measuring one actual translation cell.
FidelityResidue
Measured residue of one actual export/reload cell.
FunctionCall
The function payload of a ToolCall.
ToolCall
A request from the model to invoke a tool.

Enums§

Error
An error at a native session-format boundary.
Fidelity
How faithfully a reconstruction reproduces its source.
InterchangeError
An error at a native session-format boundary.
Role
Who authored a ChatMessage.
ToolOutcome
The structural outcome known for a tool-result message.

Constants§

TOOL_ERROR_METADATA_KEY
Canonical metadata key marking a tool result as a structured error.
TOOL_OUTCOME_UNKNOWN_METADATA_KEY
Canonical metadata key marking a tool result whose outcome is unknown.

Functions§

core_messages
Canonical messages participating in cross-format fidelity scoring.
estimate_tokens
Deterministic token estimate: ceil(utf8_bytes / 4).
estimate_view_tokens
Estimate the serialized wire size of canonical messages.
format_commas
Render n with comma thousands separators.
is_tool_error
Whether a message carries the canonical structured-error marker.
mark_tool_error
Stamp a tool-result message as a structured error.
mark_tool_outcome_unknown
Stamp a tool-result message as having no structurally known outcome.
measure_fidelity
Measure an export/reload cell without applying a regression floor.
messages_equal
Compare semantic message fields shared by the supported harnesses.
messages_equal_multimodal
Compare semantics plus multimodal parts and tool names.
replay_eligible
The replayable subsequence of a canonical transcript.
replay_excluded
Whether a source message was intentionally outside the replayable slice.
tool_outcome
Return the canonical structural outcome for a tool-result message.

Type Aliases§

Result
Result type for interchange operations.