1use std::path::PathBuf;
2use std::sync::Arc;
3
4pub use crate::tui::config::KeyboardProtocolConfig;
5pub use crate::tui::core_tui::types::protocol::{
6 InlineCommand, InlineEvent, InlineHandle, InlineSession,
7};
8pub use crate::tui::core_tui::types::{
9 AuthAction, ContentPart, FocusChangeCallback, InlineEventCallback, InlineHeaderContext,
10 InlineHeaderHighlight, InlineHeaderStatusBadge, InlineHeaderStatusTone, InlineLinkRange,
11 InlineLinkTarget, InlineListItem, InlineListSearchConfig, InlineListSelection,
12 InlineMessageKind, InlineSegment, InlineTextStyle, InlineTheme, ListOverlayRequest,
13 ModalOverlayRequest, OverlayEvent, OverlayHotkey, OverlayHotkeyAction, OverlayHotkeyKey,
14 OverlayRequest, OverlaySelectionChange, OverlaySubmission, RewindAction, SecurePromptConfig,
15 SubmittedInput, WizardModalMode, WizardOverlayRequest, WizardStep,
16};
17pub use crate::tui::options::{
18 FullscreenInteractionSettings, KeyboardProtocolSettings, SessionSurface,
19};
20
21pub type CoreCommand = InlineCommand;
22pub type CoreEvent = InlineEvent;
23pub type CoreHandle = InlineHandle;
24pub type CoreSession = InlineSession;
25
26#[derive(Clone)]
28pub struct CoreSessionOptions {
29 pub placeholder: Option<String>,
30 pub surface_preference: SessionSurface,
31 pub inline_rows: u16,
32 pub event_callback: Option<InlineEventCallback>,
33 pub focus_callback: Option<FocusChangeCallback>,
34 pub workspace_root: Option<PathBuf>,
35 pub app_name: String,
36 pub non_interactive_hint: Option<String>,
37}
38
39impl Default for CoreSessionOptions {
40 fn default() -> Self {
41 Self {
42 placeholder: None,
43 surface_preference: SessionSurface::default(),
44 inline_rows: 24,
45 event_callback: None,
46 focus_callback: None,
47 workspace_root: None,
48 app_name: "oxicode".to_string(),
49 non_interactive_hint: None,
50 }
51 }
52}
53
54pub fn spawn_core_session(
57 _theme: InlineTheme,
58 _options: CoreSessionOptions,
59) -> anyhow::Result<(
60 InlineHandle,
61 tokio::sync::mpsc::UnboundedReceiver<InlineEvent>,
62)> {
63 unimplemented!("spawn_core_session is implemented in oxicode-cli's TUI harness")
66}
67
68pub mod prelude {
70 pub use super::{
71 CoreCommand, CoreEvent, CoreHandle, CoreSession, CoreSessionOptions,
72 FullscreenInteractionSettings, InlineHeaderContext, InlineHeaderHighlight,
73 InlineHeaderStatusBadge, InlineHeaderStatusTone, InlineMessageKind, InlineSegment,
74 InlineTextStyle, InlineTheme, KeyboardProtocolSettings, ListOverlayRequest,
75 ModalOverlayRequest, OverlayEvent, OverlayHotkey, OverlayHotkeyAction, OverlayHotkeyKey,
76 OverlayRequest, OverlaySelectionChange, OverlaySubmission, SessionSurface, WizardModalMode,
77 WizardOverlayRequest, WizardStep, spawn_core_session,
78 };
79}