1#![warn(missing_docs)]
46
47#[cfg(feature = "adapter-acp")]
48pub use supercode_interchange::ontology;
51pub use supercode_interchange::orchestration;
53
54#[cfg(feature = "adapter-acp")]
55pub mod acp_frontend;
56#[cfg(feature = "adapter-acp")]
57pub mod acp_server;
58mod agent;
59pub mod agent_package;
60pub mod approvals;
61pub mod audit;
62pub mod background;
63pub mod browser;
64pub mod catalog;
65pub mod channels;
66pub mod checkpoint;
67pub mod claude_compat;
68pub mod claude_peer;
69pub mod claude_runtime_state;
70pub mod codex_peer;
71mod config;
72pub mod config_schema;
73pub mod configfile;
74pub mod context_injection;
75mod error;
76mod event;
77pub mod fidelity;
78pub mod formatters;
79#[cfg(feature = "adapter-api")]
80pub mod frontend;
81#[cfg(not(feature = "adapter-api"))]
82#[allow(dead_code)]
83mod frontend;
84#[allow(missing_docs)]
85mod frontend_contract_generated;
86pub mod git_metadata;
87pub mod goals;
88pub mod harness_auth;
89pub mod harness_command;
90#[cfg(feature = "adapter-api")]
91pub mod harness_service;
92#[cfg(not(feature = "adapter-api"))]
93#[allow(dead_code)]
94mod harness_service;
95pub mod hermes_import;
96pub mod human_export;
97pub mod interop_settings;
98pub mod jobs;
99pub mod jobs_control;
100pub mod live_runtime;
101pub mod lsp;
102pub mod mcp;
103pub mod mcp_oauth;
104pub mod memory;
105mod message;
106pub mod model_catalog;
107pub mod model_change;
108pub mod modules;
109pub mod orchestration_doors;
110pub mod orchestrator;
111pub mod orchestrator_door;
112pub mod output_style;
113pub mod parity;
114pub mod path_rules;
115pub mod permissions;
116pub mod plugins;
117pub mod presets;
118pub mod pricing;
119pub mod pricing_ref;
120pub mod profiles;
121pub mod profiles_control;
122mod provider;
123pub mod reduce;
124pub mod routes;
125pub mod runs;
126pub mod runtime;
127pub mod runtime_lease;
128#[cfg(feature = "adapter-api")]
129pub mod runtime_registry;
130mod safe_path;
131pub mod sandbox;
132pub mod schema;
133pub mod sdk;
134#[cfg(feature = "adapter-api")]
135pub mod server;
136#[cfg(not(feature = "adapter-api"))]
137#[allow(dead_code, unused_imports)]
138mod server;
139pub mod session;
140pub mod session_activity;
141pub mod session_index;
142pub mod session_journal;
143pub mod session_title;
144pub mod session_tree;
145pub mod sessions_control;
146pub mod sidecar;
147pub mod skills;
148pub mod skills_control;
149pub mod store;
150pub mod subagents;
151pub mod support;
152pub mod teams;
153pub mod tokens;
154pub mod tools;
155pub mod triggers;
156pub mod trust;
157pub mod tui;
158pub mod turn_record;
159pub mod usage_log;
160pub mod watch;
161pub mod workflow_doors;
162
163#[cfg(feature = "adapter-acp")]
164pub use acp_frontend::{AcpFrontendCheckpoint, AcpFrontendConnectOptions, AcpFrontendRuntime};
165pub use agent::{Agent, ContextUsage};
166pub use approvals::{
167 approval_harnesses, lists_approvals, plan_reply, ApprovalChoice, ApprovalDecision,
168 ApprovalDoor, ApprovalKind, ApprovalOption, ApprovalRegistry, ApprovalResolution,
169 ApprovalResolveError, ApprovalRow, ApprovalStatus, ApprovalsQuery, ApprovalsResolveParams,
170};
171pub use catalog::{
172 orchestrator_profile_dirs, DiscoveryPage, DiscoveryQuery, HarnessCatalog, HarnessHomes,
173 HarnessId, SessionDescriptor, SessionLocator, StorageLocator,
174};
175pub use channels::{
176 channel_status, list_channels, ChannelError, ChannelRow, ChannelStatus, CHANNELS_SCHEMA,
177 CHANNEL_HARNESSES,
178};
179pub use claude_peer::{
180 message_claude_peer, read_claude_peer_settings, read_registry as read_claude_peer_registry,
181 update_claude_peer_settings, user_settings_path as claude_user_settings_path,
182 write_claude_peer_settings, ClaudeCrossSessionInbound, ClaudePeerDelivery, ClaudePeerEndpoint,
183 ClaudePeerRefusal, ClaudePeerRefusalError, ClaudePeerSession, ClaudePeerSettings,
184 ClaudePeerSettingsError, ClaudePeerStatus, CourierRunner, ProcessCourierRunner,
185};
186pub use claude_runtime_state::{
187 ClaudeBackgroundChild, ClaudeBackgroundState, ClaudeCronJob, ClaudeQueueState,
188 ClaudeRuntimeManifest, ClaudeRuntimePosture, ClaudeRuntimeResidue, ClaudeWakeup,
189 CLAUDE_RUNTIME_MANIFEST_VERSION,
190};
191pub use config::{
192 project_root_for, ApprovalPolicy, CachePlan, Config, ConfigBuilder, ConfigFile, ConfigProfile,
193 ContextInjectionBlock, HookDecision, LifecycleEvent, LifecycleHook, PreToolOutcome,
194 SteeringMode, StopGateHook, ToolAdvertising, ToolOverride, ToolOverrideProfile,
195 DEFAULT_SYSTEM_PROMPT,
196};
197pub use configfile::HarnessConfig;
198pub use interop_settings::{
199 configure_harness_interop_settings, inspect_harness_interop_settings, HarnessAdvisorySeverity,
200 HarnessInteropAdvisory, HarnessInteropControl, HarnessInteropSettingsError,
201 HarnessInteropSettingsReport, HarnessSettingChange, HarnessSettingChoice,
202 HarnessSettingRecommendation, HarnessSettingScope, CLAUDE_CROSS_SESSION_INBOUND_KEY,
203 HARNESS_INTEROP_SETTINGS_SCHEMA,
204};
205pub use jobs::{
206 get_job, list_jobs, supports_jobs, JobDeliver, JobPayload, JobSchedule, JobScope, JobSource,
207 JobsListing, JobsQuery, ScheduledJob, CLAUDE_SESSION_SCAN_LIMIT, JOB_HARNESSES,
208};
209pub use jobs_control::{
210 harness_program, mutate, supports_job_control, JobControlError, JobDeliverSpec, JobMutation,
211 JobMutationOutcome, JobPayloadSpec, JobScheduleSpec, JobVerb, CONTROLLED_JOB_HARNESSES,
212};
213pub use live_runtime::{
214 discover_live_runtime, find_live_runtime, forget_live_runtime, list_live_runtimes,
215 register_live_runtime, register_live_runtime_with_metadata, resolve_live_runtime,
216 LiveRuntimeEndpoint, LiveRuntimeMetadata, LiveRuntimeReceiptError, LiveRuntimeRecord,
217 LiveRuntimeRegistration, LiveRuntimeSource, LiveRuntimeSupervisor, ResolvedLiveRuntime,
218};
219pub use memory::{
220 search_memory, show_memory, supports_memory, MemoryDocument, MemoryError, MemoryMatch,
221 MemoryQuery, MemoryScope, MemorySearchQuery, MEMORY_HARNESSES, MEMORY_SCHEMA,
222};
223pub use modules::{ModuleActivation, ModuleId};
224pub use orchestrator::{
225 clear_lease, daemon_entry, install_service, live_lease, lock_path, read_lease, service_status,
226 service_unit, uninstall_service, write_lease, write_unit, Lease, OrchestratorError,
227 ServiceState, ServiceUnit, DAEMON_ENTRY, LOCK_FILE, SERVICE_DIR, SERVICE_NAME,
228};
229pub use orchestrator_door::{
230 daemon_is_live, socket_path, Door, DoorAnswer, DoorError, NODE_BIN_ENV, SOCKET_FILE,
231};
232pub use profiles::{
233 get_profile, list_profiles, ProfileError, ProfileKind, ProfileRow, HERMES_DEFAULT_PROFILE,
234 PROFILES_SCHEMA, PROFILE_HARNESSES,
235};
236pub use profiles_control::{
237 supports_profile_control, ProfileControlError, ProfileMutation, ProfileMutationOutcome,
238 ProfileVerb, CONTROLLED_PROFILE_HARNESSES,
239};
240pub use routes::{list_routes, RouteError, RouteMatch, RouteRow, ROUTES_SCHEMA, ROUTE_HARNESSES};
241pub use runs::{
242 get_run, list_runs, supports_runs, HarnessRun, RunDelivery, RunSource, RunsListing, RunsQuery,
243 RUN_HARNESSES,
244};
245pub use sessions_control::{
246 controlled_verbs, supports_session_control, SessionControlError, SessionDoor, SessionMutation,
247 SessionMutationOutcome, SessionVerb, CONTROLLED_SESSION_HARNESSES,
248};
249pub use teams::{
250 install_service as install_teams_service, service_status as teams_service_status,
251 service_unit as teams_service_unit, teams_entry, teams_home,
252 uninstall_service as uninstall_teams_service, write_unit as write_teams_unit, TeamsError,
253 SERVICE_DIR as TEAMS_SERVICE_DIR, SERVICE_NAME as TEAMS_SERVICE_NAME, TEAMS_ENTRY,
254};
255pub use triggers::{
256 list_triggers, TriggerError, TriggerKind, TriggerRow, TRIGGERS_SCHEMA, TRIGGER_HARNESSES,
257};
258
259pub fn format_reply(reply: &str, json: bool) -> String {
263 if json {
264 serde_json::json!({ "result": reply }).to_string()
265 } else {
266 reply.to_string()
267 }
268}
269pub use error::{Error, Result};
270pub use event::{AgentEvent, EventSink};
271pub use fidelity::{
272 core_messages, measure_fidelity, messages_equal, messages_equal_multimodal, replay_eligible,
273 Fidelity, FidelityMetric, FidelityResidue,
274};
275#[cfg(feature = "adapter-api")]
276pub use frontend::HttpFrontendRuntime;
277pub use frontend::{
278 FrontendActions, FrontendApprovalDecision, FrontendAttachSnapshot, FrontendAttachment,
279 FrontendCommandDescriptor, FrontendConnectionState, FrontendDisplayCapabilities,
280 FrontendElicitationAction, FrontendEvent, FrontendOperationDescriptor,
281 FrontendOperationInvocation, FrontendOperationKind, FrontendOperationResult, FrontendRequest,
282 FrontendRequestKind, FrontendResponse, FrontendRuntime, FrontendRuntimeDescriptor,
283 FrontendRuntimeError, FrontendRuntimeMetadata, FrontendTurnState, FRONTEND_REPLAY_CAPACITY,
284 FRONTEND_RUNTIME_SCHEMA_VERSION,
285};
286pub use frontend_contract_generated::{
287 FrontendFacadeMethod, FrontendFacadeTransport, GeneratedFrontendClient,
288};
289pub use harness_auth::{
290 harness_authentication_methods, harness_authentication_plan, inspect_harness_authentication,
291 HarnessAuthenticationEnvironment, HarnessAuthenticationError, HarnessAuthenticationInteraction,
292 HarnessAuthenticationLaunch, HarnessAuthenticationMethod, HarnessAuthenticationMethodId,
293 HarnessAuthenticationPlan, HarnessAuthenticationReport, HarnessAuthenticationState,
294 HarnessBrowserBehavior, HARNESS_AUTHENTICATION_SCHEMA,
295};
296pub use harness_service::{
297 HarnessSessionService, HARNESS_SERVICE_VERSION, RUNTIME_EVENT_METHOD,
298 SESSION_ACTIVITY_EVENT_METHOD, SESSION_EVENT_METHOD, SESSION_INDEX_EVENT_METHOD,
299};
300pub use message::{
301 is_tool_error, mark_tool_error, mark_tool_outcome_unknown, tool_outcome, ChatMessage,
302 FunctionCall, Role, ToolCall, ToolOutcome, TOOL_ERROR_METADATA_KEY,
303 TOOL_OUTCOME_UNKNOWN_METADATA_KEY,
304};
305pub use provider::{
306 model_context_limit, ChatRequest, OpenAiProvider, PromptTokensDetails, Provider, RetryLog,
307 RetryNotice, ToolSchema, Usage, SERVED_MODEL_KEY, UNKNOWN_MODEL_CONTEXT_FLOOR,
308};
309#[cfg(feature = "adapter-api")]
310pub use runtime::SupercodeHttpRuntimeBackend;
311pub use runtime::{
312 AcpRuntimeBackend, BearerToken, ClaudeCodeRuntimeBackend, CodexRuntimeBackend, HarnessEvent,
313 McpServerLaunch, OpenCodeRuntimeBackend, PiRuntimeBackend, ResolvedRuntimeConnection,
314 RuntimeAttachRequest, RuntimeBackend, RuntimeCapabilities, RuntimeConnectLaunch,
315 RuntimeConnection, RuntimeEndpoint, RuntimeHandle, RuntimeInput, RuntimeLaunch,
316 RuntimeStartRequest,
317};
318pub use runtime_lease::{
319 CoordinatedRuntime, CoordinatedRuntimeClient, RuntimeAuthorization, RuntimeClientId,
320 RuntimeControllerLease, RuntimeLeaseCoordinator, RuntimeLeaseError, RuntimeLeaseSnapshot,
321 RuntimeObserverLease, RuntimePermission, DEFAULT_RUNTIME_LEASE_TTL_MS,
322};
323#[cfg(feature = "adapter-api")]
324pub use runtime_registry::{
325 LocalRuntimeRegistry, RuntimeRegistryEntry, RuntimeRegistryEvent, RuntimeRegistryOwner,
326 RuntimeRegistryQuery, RuntimeRegistryState, RuntimeRegistryWatch,
327};
328pub use sandbox::{landlock_available, netns_available, SandboxEnvPolicy, SandboxEscalation};
329pub use sdk::{
330 create_agent, discover_session_page, discover_sessions, load_session, load_session_path,
331 resume_agent, show_model_input, submit_agent, submit_agent_with_images, RuntimeSubmitError,
332 SdkAgent, SdkCapabilities, SdkError, SdkErrorCode, SdkEvent, SdkOperation, SdkPromptSource,
333 SdkRequest, SdkRuntime, SdkRuntimeEvent, SdkService, SDK_SCHEMA_VERSION,
334};
335pub use server::RpcEngine;
336pub use session::{
337 CrossSurface, OrchestrationNouns, Recurrence, Session, SessionFormat, SessionMeta,
338 SessionSource, SurfaceKey, Trigger, WorkspaceKind, WorkspaceRef,
339};
340pub use session_activity::{
341 SessionActivity, SessionActivityEvidence, SessionPresence, SessionTurnState,
342};
343pub use session_index::{SessionIndexChange, SessionIndexDelta, SessionIndexKey};
344pub use skills::{
345 declared_skill_name, list_skills, skill_roots, writable_skill_roots, SkillHomes, SkillRow,
346 SkillScope, SkillsQuery, SKILL_HARNESSES,
347};
348pub use skills_control::{
349 mutate_skill, supports_skill_control, SkillControlError, SkillMutation, SkillMutationOutcome,
350 SkillVerb, CONTROLLED_SKILL_HARNESSES,
351};
352pub use store::{SessionInfo, SessionStore};
353pub use support::{
354 harness_support, harness_support_registry, HarnessSupportDescriptor, ImplementationKind,
355 NativeSupport, RuntimeSupport, SupportRegistryReport, SUPPORT_REGISTRY_SCHEMA,
356};
357pub use tools::{
358 shell_sandbox_unenforceable, SandboxPolicy, SchemaTier, Tool, ToolContext, ToolRegistry,
359 WriteObserver,
360};
361pub use watch::{SessionFollower, SessionSnapshotReason, SessionWatchEvent};