Skip to main content

Module wire

Module wire 

Source
Expand description

A subject’s wire form, and the one place it is decided.

The server hands a view the surface’s own values, and a client reads a shape built for it here rather than the core’s structs. A twin per subject keeps a wire change in one file instead of in a handler and a test, and the fixtures beside this module are what make a changed shape fail a test rather than a client.

The twins are complete. A field is carried unless it is a Rust mechanism rather than data - a oneshot, an Arc<Workspace> - because the client is not today’s pages: it is built against this wire, and a field missing here cannot be added later without a server change.

Re-exports§

use std::collections::BTreeMap; 🔒
use std::collections::HashMap; 🔒
use std::path::Path; 🔒
use std::sync::Arc; 🔒
use anyhow::Result; 🔒
use forge_primitives::git_diff::LayerState; 🔒
use forge_primitives::plugins::PluginUpdateRun; 🔒
use forge_primitives::plugins::PluginsInventorySnapshot; 🔒
use forge_primitives::review::ReviewAnchor; 🔒
use forge_primitives::review::ReviewSet; 🔒
use forge_primitives::review::ReviewSide; 🔒
use forge_primitives::review::ReviewThread; 🔒
use forge_primitives::runtime::AvailableAgent; 🔒
use forge_primitives::runtime::AvailableCommand; 🔒
use forge_primitives::runtime::MonitorRecord; 🔒
use forge_primitives::slack::SlackSubscription; 🔒
use forge_primitives::ContentBlock; 🔒
use forge_primitives::GotifySubscription; 🔒
use forge_primitives::Message; 🔒
use forge_primitives::SessionSlot; 🔒
use forge_primitives::UserEnvelope; 🔒
use forge_workspace::env::git_diff::content::DiffContent; 🔒
use forge_workspace::env::git_diff::content::FileContent; 🔒
use forge_workspace::env::git_diff::content::scan as scan_content; 🔒
use forge_workspace::env::git_diff::file::merge_base; 🔒
use forge_workspace::env::git_diff::file::read_file_lines; 🔒
use forge_workspace::env::git_diff::resolver::AnchorPlacement; 🔒
use forge_workspace::env::git_diff::resolver::OutdatedReason; 🔒
use forge_workspace::env::git_diff::resolver::place_anchor_in_content; 🔒
use forge_workspace::env::git_diff::resolver::place_anchor_in_lines_with; 🔒
use forge_workspace::env::processes::ProcessSnapshot; 🔒
use forge_workspace::McpServers; 🔒
use forge_workspace::ProjectView; 🔒
use serde::Deserialize; 🔒
use serde::Deserialize; 🔒
use serde::Serialize; 🔒
use serde::Serialize; 🔒
use serde_json::Value; 🔒
use crate::file_index::FileIndex; 🔒
use crate::surface::AgentRow; 🔒
use crate::surface::PendingAsk; 🔒
use crate::surface::ViewSurface; 🔒
use crate::transcript::Rendered; 🔒
use crate::transcript::TaskEnding; 🔒
use crate::transcript::TurnSpan; 🔒
use crate::transport::TransportState; 🔒
use crate::transport::conversation::Conversation; 🔒
use crate::transport::conversation::Held; 🔒
use crate::transport::envelope::Subject; 🔒
use crate::work::WorkState; 🔒
use crate::work::git_work_view; 🔒
use crate::work::work_from_scan; 🔒

Structs§

AgentWire
One seat’s row: the surface’s own AgentRow, plus the read that is per SEAT rather than per project.
BoardWire
The board’s own read: every project’s live detail, for the page and the rail that draw it (#2517).
ComposerWire
What one seat’s composer is doing.
ConnectorsWire
What the inbound connectors are watching, server-wide.
ConversationWire
The conversation a session’s transcript replayed, and how many times it has compacted.
DictateWire
Dictation’s preflight state.
ExtensionsWire
The Extensions page’s read: the plugin inventory, the PATH checks the scan cannot carry, and the last update run.
GotifyWire
HomeWire
The home, as a client sees it: every read a home-scoped view makes.
LspCheckWire
One declared LSP server and whether its binary resolves on PATH.
OpenTimings
The slices of one session open, in milliseconds, gathered as its read runs (#2374).
Page
One page of history: the newest turns, in conversation order, and the handle that asks for the ones above them.
ProjectBoardIdentity
One project’s identity, which is all a board row needs to place it.
ProjectBoardWire
One project’s board detail.
ProjectConnectorsWire
One project’s connector subscriptions, as the row’s section draws them.
ProjectWire
One project row: the project, and the per-row reads the home draws it from.
RecordCap 🔒
What the cap did to one served record, for the log line beside it.
ResumableSessionWire
One session a seat can resume, as /resume’s list draws it: the id a pick writes into the draft, and the transcript’s own title beside it.
ReviewedThreadWire
One review thread as a record carries it: the stored thread, and where its anchor sits in the content the record ships beside it.
ReviewsWire
The review reads for one branch, each carrying its own answer.
SessionHeaderWire
The session’s header facts, including the two a client cannot otherwise reach: the catalogue a picker draws its rows from, and whether a turn is in flight.
SessionStateWire
Where a session’s reads find their own working tree.
SessionWire
One session, as a client sees it: every read a session-scoped view makes.
SlackWire
TurnWire
One turn, as a page carries it: the key the server named it by, and the messages it ran as.
VaultWire
The shared vault session as the settings card draws it.
VoiceWire
The voice switch and where its model lands, as the home carries them.
WholeFile 🔒
One whole file an anchor needed, and whether the read carried all of it.

Enums§

FileContentWire
One file’s content at a revision, as the file_content answer carries it: the lines a review page’s between-hunk expansion draws.
NotReady 🔒
Why a read could not bring its copy current, which the refusal’s text says apart: they are different losses and only one is about a number.
OutdatedReasonWire
The resolver’s own reason, crossing as data rather than as prose.
PendingAskWire
What a seat is held on: every kind of parked interaction, not the two the dock happened to draw first. Each request crosses as the core’s own shape, because a client draws it rather than re-deriving it.
ReadWire
One of the surface’s two independent review reads: the records, or why they could not be read. They fail apart, so neither is collapsed into the other, and a client can tell an empty branch from an unreadable one.
ThreadResolutionWire
Where an anchor sits, as a view draws it: the line in the anchor’s own side’s numbering, or why it could not be placed.

Constants§

CATCH_UP_WAIT 🔒
How long an encode waits for the fold loop to catch up before filling the gap from the seat’s own window.
DRAWN_RECORD_KEYS 🔒
The keys a client actually draws out of a structured record: a mutation’s patch and its outside-edit mark, a question’s answers and the notes typed beside them.
SEAL_WAIT 🔒
How long a read whose copy needs an unapplied seal waits for the fold before refusing.
SEED_WAIT 🔒
How long a request waits for a live seat’s first Connected before answering without a conversation.
SUBSCRIBE_TURNS
How many of a conversation’s newest turns a subscribe carries.
WHOLE_FILE_READS_PER_RECORD 🔒
At most this many whole-file reads per record encode. An ordinary record reads none - every anchor sits in its hunks - and a review with more comments outside its hunks than this answers the rest from the bounded content rather than running an unbounded pile of git subprocesses on every seat encode.

Functions§

all_turns
messages as the whole turns rendered names, in conversation order.
await_current 🔒
Wait, up to within, for slot’s held copy to satisfy current, and answer it when it does.
awaits_seal_history 🔒
Whether slot’s copy is missing rows its epoch opened on.
board 🔒
The board’s record, from the reads a board-scoped view makes.
boot_id 🔒
The server run’s own identity, minted once.
cap_message_record 🔒
The same bound on a live frame’s record, before it goes to a client (#2374): a reload and a live frame draw the same record or the marker.
cap_tool_record 🔒
Bound one served tool_use_result to cap bytes (#2374).
cap_tool_records 🔒
Bound every frame’s tool_use_result in a page about to be SERVED (#2374).
cap_turn 🔒
cap_tool_records for one turn, answering what it bounded and the call each belongs to rather than logging it here.
catch_up 🔒
Bring slot’s held conversation up to want, or report that it cannot.
checked_refresh 🔒
The refresh a record may state as its own check: none when the run answered nothing (its leader panicked or was cancelled, or a bound cut it), because the words beside that state are forge’s own rather than git’s.
compact_counters 🔒
Fold each run of consecutive thinking-token counters in a turn into the one frame it draws as.
conversation_for
The seat’s conversation, answering from its own transcript when the stream holds none.
counted 🔒
How many frames a counter stands for, itself included.
counter_dispatch 🔒
The dispatch a counter ran under, empty when it is the turn’s own.
counter_stamp 🔒
The stamp a counter frame carries, when it carries one.
cron_names_of
The schedules the fired prompts in turns came from, keyed by the prompt’s own id.
diff_base_error 🔒
Why a record’s diff could not check its base: the refresh’s words when it ran, the store’s when the refresh answered nothing, and none when no refresh ran - the field names git’s words, never forge’s own.
encode_subject
A subject’s wire form. The ONE place it is produced.
encode_subject_timed 🔒
encode_subject, carrying the session’s own open timings.
extensions 🔒
The Extensions page’s read, as the wire carries it.
fits 🔒
Whether a value serialises into the cap.
fixture_seat
The seat the fixture surface is populated for.
floor_cursor 🔒
Hand the window’s floor back as a page’s cursor when the page opens on the window’s front (#2420).
forged_ending 🔒
The notice as a frame of its own, for the turn that holds the call it ends.
frame_of 🔒
One message as the page carries it, or the notice that says it will not.
grown 🔒
The growth one counter frame stands for: one frame’s delta, or a run’s sum.
home 🔒
The home’s record, from the reads a home-scoped view makes.
is_counter 🔒
Whether the frame is a thinking-token counter.
line_carried 🔒
Whether any hunk of files carries anchor.line on the anchor’s side.
log_record_cap 🔒
Say what the cap did to an executed call’s record (#2374).
opens_of 🔒
Where each turn opens, one entry per turn, and what names it.
owed_endings 🔒
The endings that name a call this turn holds and that the turn does not already carry.
page
Slice a conversation into whole turns, newest first.
page_within
page, with the whole turns it carries held to budget bytes.
placement_wire 🔒
resolution_wire’s twin for the seat tree: the placement the surface already resolved against the seat’s own working file crosses as-is - the numbering is the anchor’s home, so moved_from is always named when there is one.
reduced_to 🔒
The record reduced to keys, or None when it holds none of them.
request_context_usage_if_unreported 🔒
Ask the core for a context reading on slot when the seat reports none.
request_mcp_snapshot_if_unreported 🔒
Ask the core for an MCP snapshot on slot when the seat reports none.
resolution_wire 🔒
One anchor placed against the bounded content the record carries. With trusted the line number is evidence too, because the branch-ahead layer is the numbering the anchor was written in - the same trust a view’s overlay extends to its own home scope. Untrusted, the placement is earned by content and neighbours alone.
reviewed_threads 🔒
Every thread with its landing against content - the same content the record ships, so a page draws a thread where this answer says.
same_run 🔒
Whether next continues the counter run last is part of.
seed_from_transcript 🔒
The conversation the seat’s transcript holds, for a seat this transport holds nothing for.
session 🔒
One session’s record, from the reads a session-scoped view makes.
slice_ms 🔒
One read’s share of the open, in milliseconds.
stated_base 🔒
The base a record’s git row states. When the read refreshed, the row states the check its diff was read against, never the store’s newer measurement (a bypass answered while a fetch landed); a read that did not refresh, or one whose refresh answered nothing, states what the store holds.
turn_holds_call 🔒
Whether these frames make the call id.
turn_ranges 🔒
The message range of every turn spans names, in conversation order, each with what names it.
turn_wire 🔒
The messages from..to as one turn, which is the shape both the session record and a page carry.
whole_files_for 🔒
The whole files for the anchors no hunk carries a line for.

Type Aliases§

WholeFiles 🔒
The whole files an anchor needed, one per (path, side).