mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 18:41:53 +08:00
Crates: - api: Anthropic Messages API client with SSE streaming - tools: Claude-compatible tool implementations (Bash, Read, Write, Edit, Glob, Grep + extended suite) - runtime: conversation loop, session persistence, permissions, system prompt builder - rusty-claude-cli: terminal UI with markdown rendering, syntax highlighting, spinners - commands: subcommand definitions - compat-harness: upstream TS parity verification All crates pass cargo fmt/clippy/test.
57 lines
1.5 KiB
Rust
57 lines
1.5 KiB
Rust
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum BootstrapPhase {
|
|
CliEntry,
|
|
FastPathVersion,
|
|
StartupProfiler,
|
|
SystemPromptFastPath,
|
|
ChromeMcpFastPath,
|
|
DaemonWorkerFastPath,
|
|
BridgeFastPath,
|
|
DaemonFastPath,
|
|
BackgroundSessionFastPath,
|
|
TemplateFastPath,
|
|
EnvironmentRunnerFastPath,
|
|
MainRuntime,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
pub struct BootstrapPlan {
|
|
phases: Vec<BootstrapPhase>,
|
|
}
|
|
|
|
impl BootstrapPlan {
|
|
#[must_use]
|
|
pub fn claude_code_default() -> Self {
|
|
Self::from_phases(vec![
|
|
BootstrapPhase::CliEntry,
|
|
BootstrapPhase::FastPathVersion,
|
|
BootstrapPhase::StartupProfiler,
|
|
BootstrapPhase::SystemPromptFastPath,
|
|
BootstrapPhase::ChromeMcpFastPath,
|
|
BootstrapPhase::DaemonWorkerFastPath,
|
|
BootstrapPhase::BridgeFastPath,
|
|
BootstrapPhase::DaemonFastPath,
|
|
BootstrapPhase::BackgroundSessionFastPath,
|
|
BootstrapPhase::TemplateFastPath,
|
|
BootstrapPhase::EnvironmentRunnerFastPath,
|
|
BootstrapPhase::MainRuntime,
|
|
])
|
|
}
|
|
|
|
#[must_use]
|
|
pub fn from_phases(phases: Vec<BootstrapPhase>) -> Self {
|
|
let mut deduped = Vec::new();
|
|
for phase in phases {
|
|
if !deduped.contains(&phase) {
|
|
deduped.push(phase);
|
|
}
|
|
}
|
|
Self { phases: deduped }
|
|
}
|
|
|
|
#[must_use]
|
|
pub fn phases(&self) -> &[BootstrapPhase] {
|
|
&self.phases
|
|
}
|
|
}
|