Skip to main content

gate4agent_types/
lib.rs

1//! Pure data contracts shared by gate4agent engines and shells.
2
3mod adapter;
4mod capability;
5mod control;
6mod executable;
7mod history;
8mod id;
9mod input;
10mod readiness;
11mod resume;
12mod session_options;
13mod spec;
14
15pub use adapter::{
16    AdapterBinding, AdapterBindingError, AdapterFamily, AdapterId, AdapterIdError,
17    AdapterVerification, MAX_ADAPTER_REVISION_LEN,
18};
19pub use capability::{
20    validate_capability_models, CapabilityModelSummary, CapabilityProbeFailure,
21    CapabilityProbeRequest, CapabilitySnapshot, CapabilityValidationError, PendingCapabilityProbe,
22    CAPABILITY_MODELS_MAX, CAPABILITY_MODEL_ID_MAX_BYTES, CAPABILITY_MODEL_LABEL_MAX_BYTES,
23};
24pub use control::{
25    ActiveProviderTool, AgentInstanceId, CommandEnvelope, CommandId, ContextWindowUsage,
26    ControlCommand, ControlEffect,
27    ControlError, ControlEvent, ControlEventKind, ControlHealth, ControlObservation,
28    ControlSnapshot, EffectEnvelope, ForegroundAuthority, ForegroundProcess, ForegroundProcessKind,
29    ForegroundRequirement, ForegroundSnapshot, ObservationEnvelope, ObservationIgnoredReason,
30    OperationId, ProviderActivity, ProviderEvent, ProviderEventValidationError,
31    ProviderInteraction, ProviderInteractionId, ProviderInteractionKind,
32    ProviderInteractionOutcome, ProviderInteractionResponse, ProviderInteractionResponseError,
33    ProviderInteractionResponseKind, ProviderInteractionStatus, ProviderInteractionTarget,
34    ProviderRuntimeCapability, ProviderRuntimePolicy, ProviderRuntimePolicyError,
35    ProviderSessionIdentity, ProviderSessionKey, ProviderSnapshot, ProviderSource,
36    ProviderSourceCursor, ProviderSubagent, SessionGeneration, SessionSnapshot, SessionStatus,
37    StartRequest, TerminalFrame, TerminalMouseProtocolEncoding, TerminalSize, TokenUsage,
38    TransportKind,
39    CONTROL_INSTANCE_IDENTITIES_CAPACITY, CONTROL_INSTANCE_IDENTITIES_MAX,
40    CONTROL_PROTOCOL_VERSION, CONTROL_SESSIONS_MAX, FOREGROUND_PROCESS_NAME_MAX_BYTES,
41    PROVIDER_EVENT_ID_MAX_BYTES, PROVIDER_EVENT_TEXT_MAX_BYTES, PROVIDER_EVENT_TOOLS_MAX,
42    PROVIDER_INGRESS_EVENTS_MAX, PROVIDER_INTERACTIONS_MAX, PROVIDER_INTERACTION_FAILURE_MAX_BYTES,
43    PROVIDER_INTERACTION_RESPONSE_MAX_BYTES, PROVIDER_SESSION_LOCATOR_MAX_BYTES,
44    PROVIDER_SUBAGENTS_MAX, TERMINAL_COLUMNS_MAX, TERMINAL_ROWS_MAX, WORKING_DIRECTORY_MAX_BYTES,
45};
46pub use executable::normalize_executable_name;
47pub use history::{
48    validate_candidate_id, validate_history_error, validate_native_session_id,
49    HistoryCandidateSummary, HistoryMessageRecord,
50    HistoryMessageRole, HistoryOperation, HistoryQuery, HistorySessionRecord, HistorySnapshot,
51    NativeSessionCatalogEntry, NativeSessionCatalogPage, NativeSessionCatalogSummary,
52    NativeSessionCatalogScope, NativeSessionCatalogWindow, NativeSessionExternalGroup,
53    NativeSessionExternalGroupKind,
54    NativeSessionPreview, NativeSessionPreviewMessage,
55    SessionRecordPreview,
56    HistoryValidationError, PendingHistoryOperation, HISTORY_CANDIDATE_ID_MAX_BYTES,
57    HISTORY_DISCOVERY_LIMIT_MAX, HISTORY_ERROR_MAX_BYTES, HISTORY_MESSAGES_MAX,
58    HISTORY_MESSAGE_MAX_BYTES, HISTORY_MODEL_MAX_BYTES, HISTORY_SESSION_ID_MAX_BYTES,
59    HISTORY_TITLE_MAX_BYTES, NATIVE_SESSION_CATALOG_LIMIT_MAX,
60    NATIVE_SESSION_EXTERNAL_GROUP_ID_MAX_BYTES, NATIVE_SESSION_EXTERNAL_GROUP_LABEL_MAX_BYTES,
61    NATIVE_SESSION_PREVIEW_MESSAGE_LIMIT_MAX, NATIVE_SESSION_PREVIEW_TEXT_MAX_BYTES,
62};
63pub use id::{AgentId, AgentIdError};
64pub use input::{
65    normalize_semantic_prompt, prepare_agent_command, prepare_input, prepare_input_with_limits,
66    prepare_shell_command, sanitize_prompt_text, AgentCommand, InputAction, InputPrepareError,
67    PreparedInput, PreparedInputKind, PreparedWrite, PreparedWriteKind, PromptFraming,
68    PromptPayload, ShellCommand, TerminalControl, TerminalText, BRACKETED_PASTE_END,
69    BRACKETED_PASTE_START, SEMANTIC_PROMPT_MAX_BYTES, TERMINAL_INPUT_CHUNK_MAX_BYTES,
70    TERMINAL_INPUT_MAX_BYTES, TERMINAL_SUBMIT_DELAY_MS, TERMINAL_WRITE_DELAY_MAX_MS,
71};
72pub use readiness::{AgentReadinessSpec, DraftReadySignal};
73pub use resume::{
74    validate_resume_error, PendingResumeOperation, ResumeAuthorityTarget, ResumeLaunchRequest,
75    ResumePhase, ResumeSessionSummary, ResumeSnapshot, ResumeTarget, ResumeValidationError,
76    RESUME_ERROR_MAX_BYTES,
77};
78pub use session_options::{
79    SessionOptionSelection, SessionOptionValidationError, SessionOptionValue,
80    SESSION_OPTION_ID_MAX_BYTES, SESSION_OPTION_VALUES_MAX, SESSION_OPTION_VALUE_MAX_BYTES,
81};
82pub use spec::{
83    AcpTransportSpec, AgentAdapterCapabilities, AgentCapabilities, AgentCommandMode, AgentSpec,
84    AgentTransportCapabilities, DetectionSpec, InitialPromptMode, LaunchSpec, NativeDraftMode,
85    PipePromptDelivery, PipeProtocol, PipeTransportSpec, ProcessMatcher, PromptSpec,
86    RuntimePlatform, SpecVerification,
87};