I started this PR because I wanted to share the `format_duration()`
utility function in `codex-rs/exec/src/event_processor.rs` with the TUI.
The question was: where to put it?
`core` should have as few dependencies as possible, so moving it there
would introduce a dependency on `chrono`, which seemed undesirable.
`core` already had this `cli` feature to deal with a similar situation
around sharing common utility functions, so I decided to:
* make `core` feature-free
* introduce `common`
* `common` can have as many "special interest" features as it needs,
each of which can declare their own deps
* the first two features of common are `cli` and `elapsed`
In practice, this meant updating a number of `Cargo.toml` files,
replacing this line:
```toml
codex-core = { path = "../core", features = ["cli"] }
```
with these:
```toml
codex-core = { path = "../core" }
codex-common = { path = "../common", features = ["cli"] }
```
Moving `format_duration()` into its own file gave it some "breathing
room" to add a unit test, so I had Codex generate some tests and new
support for durations over 1 minute.
41 lines
928 B
TOML
41 lines
928 B
TOML
[package]
|
|
name = "codex-tui"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[[bin]]
|
|
name = "codex-tui"
|
|
path = "src/main.rs"
|
|
|
|
[lib]
|
|
name = "codex_tui"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
anyhow = "1"
|
|
clap = { version = "4", features = ["derive"] }
|
|
codex-ansi-escape = { path = "../ansi-escape" }
|
|
codex-core = { path = "../core" }
|
|
codex-common = { path = "../common", features = ["cli", "elapsed"] }
|
|
color-eyre = "0.6.3"
|
|
crossterm = "0.28.1"
|
|
mcp-types = { path = "../mcp-types" }
|
|
ratatui = { version = "0.29.0", features = [
|
|
"unstable-widget-ref",
|
|
"unstable-rendered-line-info",
|
|
] }
|
|
serde_json = "1"
|
|
shlex = "1.3.0"
|
|
tokio = { version = "1", features = [
|
|
"io-std",
|
|
"macros",
|
|
"process",
|
|
"rt-multi-thread",
|
|
"signal",
|
|
] }
|
|
tracing = { version = "0.1.41", features = ["log"] }
|
|
tracing-appender = "0.2.3"
|
|
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
|
|
tui-input = "0.11.1"
|
|
tui-textarea = "0.7.0"
|