1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! # GG: Gui for [JJ](https://jj-vcs.github.io/jj/)
//!
//! This crate exposes two ways to embed GG's functionality in your own application:
//!
//! ## Axum router (for embedding `gg web`)
//!
//! [`web::create_app`] returns an [`axum::Router`] that serves both the embedded
//! UI and a JSON API. This is the easiest integration path — you get a fully
//! working GG instance that can be composed with other Axum services or bound to
//! any [`tokio::net::TcpListener`].
//!
//! ## Worker session (for a custom embedding or use as an API)
//!
//! For lower-level control, create a [`worker::WorkerSession`] and drive it with
//! [`worker::SessionEvent`] messages over a standard [`std::sync::mpsc`] channel.
//! This is how both the Tauri GUI and the web server work internally — each
//! window/tab owns one worker thread because jj-lib is single-threaded.
//!
//! The worker thread is a state machine: [`worker::WorkerSession`] (unloaded) →
//! `WorkspaceSession` (loaded) → `QuerySession` (pagination). Only the first state
//! is public; transitions happen automatically in response to [`worker::SessionEvent`] messages.
pub use read_config;
use UserSettings;
use PathBuf;
/// Configuration passed to [`web::create_app`] or the internal GUI launcher.
///
/// Use [`RunOptions::new`] for a simple starting point, or [`read_context`]
/// and [`read_config`] to put the pieces together yourself.
/// Load the context generated by [`tauri::generate_context!`], which contains the embedded frontend assets.