Compare commits
1 Commits
master
...
work/proje
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e44ac58fb4 |
@ -15,10 +15,10 @@ pub use schema::{
|
|||||||
McpServerConfig, McpTransport, MemoryConfig, Microsoft365Config, ModelRouteConfig,
|
McpServerConfig, McpTransport, MemoryConfig, Microsoft365Config, ModelRouteConfig,
|
||||||
MultimodalConfig, NextcloudTalkConfig, NodeTransportConfig, NodesConfig, NotionConfig,
|
MultimodalConfig, NextcloudTalkConfig, NodeTransportConfig, NodesConfig, NotionConfig,
|
||||||
ObservabilityConfig, OpenAiTtsConfig, OpenVpnTunnelConfig, OtpConfig, OtpMethod,
|
ObservabilityConfig, OpenAiTtsConfig, OpenVpnTunnelConfig, OtpConfig, OtpMethod,
|
||||||
PeripheralBoardConfig, PeripheralsConfig, ProxyConfig, ProxyScope, QdrantConfig,
|
PeripheralBoardConfig, PeripheralsConfig, ProjectIntelConfig, ProxyConfig, ProxyScope,
|
||||||
QueryClassificationConfig, ReliabilityConfig, ResourceLimitsConfig, RuntimeConfig,
|
QdrantConfig, QueryClassificationConfig, ReliabilityConfig, ResourceLimitsConfig,
|
||||||
SandboxBackend, SandboxConfig, SchedulerConfig, SecretsConfig, SecurityConfig, SkillsConfig,
|
RuntimeConfig, SandboxBackend, SandboxConfig, SchedulerConfig, SecretsConfig, SecurityConfig,
|
||||||
SkillsPromptInjectionMode, SlackConfig, StorageConfig, StorageProviderConfig,
|
SkillsConfig, SkillsPromptInjectionMode, SlackConfig, StorageConfig, StorageProviderConfig,
|
||||||
StorageProviderSection, StreamMode, SwarmConfig, SwarmStrategy, TelegramConfig,
|
StorageProviderSection, StreamMode, SwarmConfig, SwarmStrategy, TelegramConfig,
|
||||||
ToolFilterGroup, ToolFilterGroupMode, TranscriptionConfig, TtsConfig, TunnelConfig,
|
ToolFilterGroup, ToolFilterGroupMode, TranscriptionConfig, TtsConfig, TunnelConfig,
|
||||||
WebFetchConfig, WebSearchConfig, WebhookConfig, WorkspaceConfig,
|
WebFetchConfig, WebSearchConfig, WebhookConfig, WorkspaceConfig,
|
||||||
|
|||||||
@ -216,6 +216,10 @@ pub struct Config {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub web_search: WebSearchConfig,
|
pub web_search: WebSearchConfig,
|
||||||
|
|
||||||
|
/// Project delivery intelligence configuration (`[project_intel]`).
|
||||||
|
#[serde(default)]
|
||||||
|
pub project_intel: ProjectIntelConfig,
|
||||||
|
|
||||||
/// Proxy configuration for outbound HTTP/HTTPS/SOCKS5 traffic (`[proxy]`).
|
/// Proxy configuration for outbound HTTP/HTTPS/SOCKS5 traffic (`[proxy]`).
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub proxy: ProxyConfig,
|
pub proxy: ProxyConfig,
|
||||||
@ -1785,6 +1789,52 @@ impl Default for WebSearchConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Project Intelligence ────────────────────────────────────────
|
||||||
|
|
||||||
|
/// Project delivery intelligence configuration (`[project_intel]` section).
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
|
||||||
|
pub struct ProjectIntelConfig {
|
||||||
|
#[serde(default)]
|
||||||
|
pub enabled: bool,
|
||||||
|
#[serde(default = "default_project_intel_language")]
|
||||||
|
pub default_language: String,
|
||||||
|
#[serde(default = "default_project_intel_report_dir")]
|
||||||
|
pub report_output_dir: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub templates_dir: Option<String>,
|
||||||
|
#[serde(default = "default_project_intel_risk_sensitivity")]
|
||||||
|
pub risk_sensitivity: String,
|
||||||
|
#[serde(default = "default_true")]
|
||||||
|
pub include_git_data: bool,
|
||||||
|
#[serde(default)]
|
||||||
|
pub include_jira_data: bool,
|
||||||
|
#[serde(default)]
|
||||||
|
pub jira_base_url: Option<String>,
|
||||||
|
}
|
||||||
|
fn default_project_intel_language() -> String {
|
||||||
|
"en".into()
|
||||||
|
}
|
||||||
|
fn default_project_intel_report_dir() -> String {
|
||||||
|
"~/.zeroclaw/project-reports".into()
|
||||||
|
}
|
||||||
|
fn default_project_intel_risk_sensitivity() -> String {
|
||||||
|
"medium".into()
|
||||||
|
}
|
||||||
|
impl Default for ProjectIntelConfig {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
enabled: false,
|
||||||
|
default_language: default_project_intel_language(),
|
||||||
|
report_output_dir: default_project_intel_report_dir(),
|
||||||
|
templates_dir: None,
|
||||||
|
risk_sensitivity: default_project_intel_risk_sensitivity(),
|
||||||
|
include_git_data: true,
|
||||||
|
include_jira_data: false,
|
||||||
|
jira_base_url: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ── Proxy ───────────────────────────────────────────────────────
|
// ── Proxy ───────────────────────────────────────────────────────
|
||||||
|
|
||||||
/// Proxy application scope — determines which outbound traffic uses the proxy.
|
/// Proxy application scope — determines which outbound traffic uses the proxy.
|
||||||
@ -4697,6 +4747,7 @@ impl Default for Config {
|
|||||||
multimodal: MultimodalConfig::default(),
|
multimodal: MultimodalConfig::default(),
|
||||||
web_fetch: WebFetchConfig::default(),
|
web_fetch: WebFetchConfig::default(),
|
||||||
web_search: WebSearchConfig::default(),
|
web_search: WebSearchConfig::default(),
|
||||||
|
project_intel: ProjectIntelConfig::default(),
|
||||||
proxy: ProxyConfig::default(),
|
proxy: ProxyConfig::default(),
|
||||||
identity: IdentityConfig::default(),
|
identity: IdentityConfig::default(),
|
||||||
cost: CostConfig::default(),
|
cost: CostConfig::default(),
|
||||||
@ -5854,6 +5905,26 @@ impl Config {
|
|||||||
validate_mcp_config(&self.mcp)?;
|
validate_mcp_config(&self.mcp)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Project intelligence
|
||||||
|
if self.project_intel.enabled {
|
||||||
|
let lang = &self.project_intel.default_language;
|
||||||
|
if !["en", "de", "fr", "it"].contains(&lang.as_str()) {
|
||||||
|
anyhow::bail!(
|
||||||
|
"project_intel.default_language must be one of: en, de, fr, it (got '{lang}')"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
let sens = &self.project_intel.risk_sensitivity;
|
||||||
|
if !["low", "medium", "high"].contains(&sens.as_str()) {
|
||||||
|
anyhow::bail!("project_intel.risk_sensitivity must be one of: low, medium, high (got '{sens}')");
|
||||||
|
}
|
||||||
|
if let Some(ref tpl_dir) = self.project_intel.templates_dir {
|
||||||
|
let path = std::path::Path::new(tpl_dir);
|
||||||
|
if !path.exists() {
|
||||||
|
anyhow::bail!("project_intel.templates_dir path does not exist: {tpl_dir}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Proxy (delegate to existing validation)
|
// Proxy (delegate to existing validation)
|
||||||
self.proxy.validate()?;
|
self.proxy.validate()?;
|
||||||
|
|
||||||
@ -6642,6 +6713,7 @@ mod tests {
|
|||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
#[allow(unused_imports)]
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
use tokio::sync::{Mutex, MutexGuard};
|
use tokio::sync::{Mutex, MutexGuard};
|
||||||
use tokio::test;
|
use tokio::test;
|
||||||
@ -6966,6 +7038,7 @@ default_temperature = 0.7
|
|||||||
multimodal: MultimodalConfig::default(),
|
multimodal: MultimodalConfig::default(),
|
||||||
web_fetch: WebFetchConfig::default(),
|
web_fetch: WebFetchConfig::default(),
|
||||||
web_search: WebSearchConfig::default(),
|
web_search: WebSearchConfig::default(),
|
||||||
|
project_intel: ProjectIntelConfig::default(),
|
||||||
proxy: ProxyConfig::default(),
|
proxy: ProxyConfig::default(),
|
||||||
agent: AgentConfig::default(),
|
agent: AgentConfig::default(),
|
||||||
identity: IdentityConfig::default(),
|
identity: IdentityConfig::default(),
|
||||||
@ -7262,6 +7335,7 @@ tool_dispatcher = "xml"
|
|||||||
multimodal: MultimodalConfig::default(),
|
multimodal: MultimodalConfig::default(),
|
||||||
web_fetch: WebFetchConfig::default(),
|
web_fetch: WebFetchConfig::default(),
|
||||||
web_search: WebSearchConfig::default(),
|
web_search: WebSearchConfig::default(),
|
||||||
|
project_intel: ProjectIntelConfig::default(),
|
||||||
proxy: ProxyConfig::default(),
|
proxy: ProxyConfig::default(),
|
||||||
agent: AgentConfig::default(),
|
agent: AgentConfig::default(),
|
||||||
identity: IdentityConfig::default(),
|
identity: IdentityConfig::default(),
|
||||||
|
|||||||
@ -910,7 +910,7 @@ async fn run_gateway_chat_simple(state: &AppState, message: &str) -> anyhow::Res
|
|||||||
/// Full-featured chat with tools for channel handlers (WhatsApp, Linq, Nextcloud Talk).
|
/// Full-featured chat with tools for channel handlers (WhatsApp, Linq, Nextcloud Talk).
|
||||||
async fn run_gateway_chat_with_tools(state: &AppState, message: &str) -> anyhow::Result<String> {
|
async fn run_gateway_chat_with_tools(state: &AppState, message: &str) -> anyhow::Result<String> {
|
||||||
let config = state.config.lock().clone();
|
let config = state.config.lock().clone();
|
||||||
crate::agent::process_message(config, message).await
|
Box::pin(crate::agent::process_message(config, message)).await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Webhook request body
|
/// Webhook request body
|
||||||
|
|||||||
@ -166,6 +166,7 @@ pub async fn run_wizard(force: bool) -> Result<Config> {
|
|||||||
multimodal: crate::config::MultimodalConfig::default(),
|
multimodal: crate::config::MultimodalConfig::default(),
|
||||||
web_fetch: crate::config::WebFetchConfig::default(),
|
web_fetch: crate::config::WebFetchConfig::default(),
|
||||||
web_search: crate::config::WebSearchConfig::default(),
|
web_search: crate::config::WebSearchConfig::default(),
|
||||||
|
project_intel: crate::config::ProjectIntelConfig::default(),
|
||||||
proxy: crate::config::ProxyConfig::default(),
|
proxy: crate::config::ProxyConfig::default(),
|
||||||
identity: crate::config::IdentityConfig::default(),
|
identity: crate::config::IdentityConfig::default(),
|
||||||
cost: crate::config::CostConfig::default(),
|
cost: crate::config::CostConfig::default(),
|
||||||
@ -528,6 +529,7 @@ async fn run_quick_setup_with_home(
|
|||||||
multimodal: crate::config::MultimodalConfig::default(),
|
multimodal: crate::config::MultimodalConfig::default(),
|
||||||
web_fetch: crate::config::WebFetchConfig::default(),
|
web_fetch: crate::config::WebFetchConfig::default(),
|
||||||
web_search: crate::config::WebSearchConfig::default(),
|
web_search: crate::config::WebSearchConfig::default(),
|
||||||
|
project_intel: crate::config::ProjectIntelConfig::default(),
|
||||||
proxy: crate::config::ProxyConfig::default(),
|
proxy: crate::config::ProxyConfig::default(),
|
||||||
identity: crate::config::IdentityConfig::default(),
|
identity: crate::config::IdentityConfig::default(),
|
||||||
cost: crate::config::CostConfig::default(),
|
cost: crate::config::CostConfig::default(),
|
||||||
|
|||||||
@ -53,8 +53,10 @@ pub mod model_routing_config;
|
|||||||
pub mod node_tool;
|
pub mod node_tool;
|
||||||
pub mod notion_tool;
|
pub mod notion_tool;
|
||||||
pub mod pdf_read;
|
pub mod pdf_read;
|
||||||
|
pub mod project_intel;
|
||||||
pub mod proxy_config;
|
pub mod proxy_config;
|
||||||
pub mod pushover;
|
pub mod pushover;
|
||||||
|
pub mod report_templates;
|
||||||
pub mod schedule;
|
pub mod schedule;
|
||||||
pub mod schema;
|
pub mod schema;
|
||||||
pub mod screenshot;
|
pub mod screenshot;
|
||||||
@ -102,6 +104,7 @@ pub use model_routing_config::ModelRoutingConfigTool;
|
|||||||
pub use node_tool::NodeTool;
|
pub use node_tool::NodeTool;
|
||||||
pub use notion_tool::NotionTool;
|
pub use notion_tool::NotionTool;
|
||||||
pub use pdf_read::PdfReadTool;
|
pub use pdf_read::PdfReadTool;
|
||||||
|
pub use project_intel::ProjectIntelTool;
|
||||||
pub use proxy_config::ProxyConfigTool;
|
pub use proxy_config::ProxyConfigTool;
|
||||||
pub use pushover::PushoverTool;
|
pub use pushover::PushoverTool;
|
||||||
pub use schedule::ScheduleTool;
|
pub use schedule::ScheduleTool;
|
||||||
@ -364,6 +367,14 @@ pub fn all_tools_with_runtime(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Project delivery intelligence
|
||||||
|
if root_config.project_intel.enabled {
|
||||||
|
tool_arcs.push(Arc::new(ProjectIntelTool::new(
|
||||||
|
root_config.project_intel.default_language.clone(),
|
||||||
|
root_config.project_intel.risk_sensitivity.clone(),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
// PDF extraction (feature-gated at compile time via rag-pdf)
|
// PDF extraction (feature-gated at compile time via rag-pdf)
|
||||||
tool_arcs.push(Arc::new(PdfReadTool::new(security.clone())));
|
tool_arcs.push(Arc::new(PdfReadTool::new(security.clone())));
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user