- kei-router — keyword-dispatch meta-tool (CfC ML fallback removed) - kei-sage — Obsidian-style knowledge graph, FTS5 + BFS + PageRank - kei-task — task DAG with deps, milestones, dependency-chain queries - kei-chat-store — Claude conversation session persistence + FTS search - kei-crossdomain — typed-edge store + BFS cross-domain glue - kei-search-core — 3-wave deep research with microcent budget cap - kei-content-store — asset + prompt + campaign registry - kei-social-store — people + interactions CRM (lite) - kei-curator — edge-decay graph hygiene utility - kei-auth — multi-tenant session tokens (replaces single-bearer) Genesis-scan pre-import pass: skipped pkg/mxl1/*, pkg/inference/*, pkg/trainer/*, pkg/nc01/*, internal/ml/* (all Genesis/CfC adjacent, sensitive IP). Security: skipped tools_threat/radio/protocol/med/mlreg (offensive/banned). Domain verticals skipped: hr/legal/infra/ops/api/osint/edu/geo/hw/finance. New 'mcp' profile in MANIFEST.toml bundles all 10 for MCP server deployment. Workspace now 24 crates, cargo check --workspace clean, 94 workspace tests pass.
35 lines
894 B
Rust
35 lines
894 B
Rust
//! Keyword rule type + `require` predicate model.
|
|
|
|
use crate::extract::Extracted;
|
|
|
|
/// A dispatch rule: any matching keyword routes to `tool` if `require(extracted)` is true.
|
|
#[derive(Clone)]
|
|
pub struct KeywordRule {
|
|
pub tool: &'static str,
|
|
pub keywords: &'static [&'static str],
|
|
pub require: fn(&Extracted) -> bool,
|
|
}
|
|
|
|
/// A dynamic (runtime-added) rule — owned strings so caller can build at startup.
|
|
#[derive(Clone, Debug)]
|
|
pub struct DynRule {
|
|
pub tool: String,
|
|
pub keywords: Vec<String>,
|
|
}
|
|
|
|
// Predicates mirroring the Go require funcs.
|
|
pub fn always(_e: &Extracted) -> bool {
|
|
true
|
|
}
|
|
pub fn has_path(e: &Extracted) -> bool {
|
|
!e.path.is_empty()
|
|
}
|
|
pub fn has_id(e: &Extracted) -> bool {
|
|
e.id > 0
|
|
}
|
|
pub fn has_paths(e: &Extracted) -> bool {
|
|
!e.paths.is_empty()
|
|
}
|
|
pub fn has_any_id_or_query(e: &Extracted) -> bool {
|
|
e.id > 0 || !e.query.is_empty()
|
|
}
|