返回 CodeWhale
setup.rs
根目录 / crates / protocol / src / setup.rs
1 use serde::{Deserialize, Serialize};
2
3 /// Canonical setup step ids. The ordering matches the first-run spine so a
4 /// `BTreeMap<SetupStep, _>` renders in wizard order.
5 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
6 #[serde(rename_all = "snake_case")]
7 pub enum SetupStep {
8 /// Language first, so later screens and constitution prose are localized.
9 Language,
10 /// Provider + key (or local runtime) and a default model.
11 ProviderModel,
12 /// Trust, approvals, sandbox, network — runtime posture (#3406).
13 TrustSandbox,
14 /// User-global constitution choice / checkpoint.
15 Constitution,
16 /// Operate/Fleet readiness: provider auth, worker runtime, roster, and
17 /// concurrency review. Plan-limit detection remains a separate product
18 /// decision; this step only records reviewed current facts.
19 OperateFleet,
20 /// Hotbar shortcuts are optional, but now have a first-class setup card.
21 Hotbar,
22 /// Tools / MCP / skills / plugins (later lanes; tracked for completeness).
23 ToolsMcp,
24 /// Remote / mobile runtime (later lane; tracked for completeness).
25 RemoteRuntime,
26 /// Persistence paths for setup state, config, constitution, memory, and notes.
27 Persistence,
28 /// Final verification / doctor / ready summary.
29 Verification,
30 }
31
32 impl SetupStep {
33 /// All steps in canonical first-run order.
34 pub const ALL: [SetupStep; 10] = [
35 SetupStep::Language,
36 SetupStep::ProviderModel,
37 SetupStep::TrustSandbox,
38 SetupStep::Constitution,
39 SetupStep::OperateFleet,
40 SetupStep::Hotbar,
41 SetupStep::ToolsMcp,
42 SetupStep::RemoteRuntime,
43 SetupStep::Persistence,
44 SetupStep::Verification,
45 ];
46 }
47
47 lines RUST