Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "codeg",
"private": true,
"version": "0.21.4",
"version": "0.21.5",
"packageManager": "[email protected]",
"scripts": {
"dev": "next dev --turbopack",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "codeg"
version = "0.21.4"
version = "0.21.5"
description = "Agent Code Generation App"
authors = ["feitao"]
edition = "2021"
Expand Down
57 changes: 57 additions & 0 deletions src-tauri/src/acp/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,63 @@ pub struct AcpAgentStatus {
pub installed_version: Option<String>,
}

/// Severity of a single diagnostics check / the overall verdict.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum DiagLevel {
/// Healthy / expected.
Ok,
/// Suspicious but not necessarily broken (e.g. slow `npm prefix -g`).
Warn,
/// A concrete problem that explains a failure.
Fail,
/// Neutral information (not a pass/fail signal).
Info,
}

/// One labelled probe result inside a [`DiagSection`]. `value` and `hint` carry
/// dynamic data (paths, versions) and are rendered as plain text in the UI —
/// they are NEVER fed through i18n/ICU (see `label`, which is a language-neutral
/// technical string emitted by the backend).
#[derive(Debug, Clone, Serialize)]
pub struct DiagCheck {
pub label: String,
pub value: String,
pub status: DiagLevel,
pub hint: Option<String>,
}

/// A titled group of [`DiagCheck`]s.
#[derive(Debug, Clone, Serialize)]
pub struct DiagSection {
pub title: String,
pub checks: Vec<DiagCheck>,
}

/// The one-line "likely cause" conclusion. `code` is a stable identifier the
/// frontend localizes via `DiagnosticsSettings.verdict.<code>`; `summary` is a
/// pre-formatted English sentence used only inside [`AgentDiagnosticsReport::plain_text`]
/// so a copied report reads the same regardless of UI locale.
#[derive(Debug, Clone, Serialize)]
pub struct DiagnosticsVerdict {
pub level: DiagLevel,
pub code: String,
pub summary: String,
}

/// Full environment-diagnostics report returned by `acp_env_diagnostics`.
///
/// Plain `Serialize` with snake_case fields (the repo convention for response
/// DTOs), mirrored field-for-field by the `AgentDiagnosticsReport` TS interface.
#[derive(Debug, Clone, Serialize)]
pub struct AgentDiagnosticsReport {
pub generated_at: String,
pub agent_type: Option<crate::models::agent::AgentType>,
pub verdict: DiagnosticsVerdict,
pub sections: Vec<DiagSection>,
pub plain_text: String,
}

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum AgentSkillScope {
Expand Down
Loading
Loading