codex_runtime/runtime/
mod.rs1pub mod api;
2pub mod approvals;
3pub mod client;
4pub mod core;
5pub mod errors;
6pub mod events;
7pub mod hooks;
8pub(crate) mod id;
9pub mod metrics;
10pub mod rpc;
11pub mod rpc_contract;
12pub(crate) mod runtime_validation;
13pub mod shell_hook;
14pub mod sink;
15pub mod state;
16pub mod transport;
17pub(crate) mod turn_lifecycle;
18pub mod turn_output;
19
20pub use api::{
21 ApprovalPolicy, ByteRange, CommandExecOutputDeltaNotification, CommandExecOutputStream,
22 CommandExecParams, CommandExecResizeParams, CommandExecResizeResponse, CommandExecResponse,
23 CommandExecTerminalSize, CommandExecTerminateParams, CommandExecTerminateResponse,
24 CommandExecWriteParams, CommandExecWriteResponse, ExternalNetworkAccess, InputItem,
25 Personality, PromptAttachment, PromptRunError, PromptRunParams, PromptRunResult,
26 ReasoningEffort, SandboxPolicy, SandboxPreset, ServiceTier, SkillDependencies, SkillErrorInfo,
27 SkillInterface, SkillMetadata, SkillScope, SkillToolDependency, SkillsListEntry,
28 SkillsListExtraRootsForCwd, SkillsListParams, SkillsListResponse, TextElement,
29 ThreadAgentMessageItemView, ThreadCommandExecutionItemView, ThreadHandle,
30 ThreadItemPayloadView, ThreadItemType, ThreadItemView, ThreadListParams, ThreadListResponse,
31 ThreadListSortKey, ThreadLoadedListParams, ThreadLoadedListResponse, ThreadReadParams,
32 ThreadReadResponse, ThreadRollbackParams, ThreadRollbackResponse, ThreadStartParams,
33 ThreadTurnErrorView, ThreadTurnStatus, ThreadTurnView, ThreadView, TurnHandle, TurnStartParams,
34 DEFAULT_REASONING_EFFORT,
35};
36pub use approvals::{ServerRequest, ServerRequestConfig, TimeoutAction};
37pub use client::{
38 Client, ClientConfig, ClientError, CompatibilityGuard, RunProfile, SemVerTriplet, Session,
39 SessionConfig,
40};
41pub use core::{InitializeCapabilities, RestartPolicy, Runtime, RuntimeConfig, SupervisorConfig};
42pub use errors::{RpcError, RpcErrorObject, RuntimeError, SinkError};
43pub use hooks::RuntimeHookConfig;
44pub use metrics::RuntimeMetricsSnapshot;
45pub use rpc_contract::RpcValidationMode;
46pub use shell_hook::ShellCommandHook;
47pub use transport::{StdioProcessSpec, StdioTransportConfig};
48
49pub type ServerRequestRx = tokio::sync::mpsc::Receiver<ServerRequest>;
50
51pub(crate) fn now_millis() -> i64 {
54 use std::time::{SystemTime, UNIX_EPOCH};
55 match SystemTime::now().duration_since(UNIX_EPOCH) {
56 Ok(d) => d.as_millis() as i64,
57 Err(_) => 0,
58 }
59}