navi-core 0.1.0

Local agentic engine and terminal-first coding agent.
Documentation
/// Stable prefix emitted with the machine-readable result of the setup interview.
pub const SETUP_INTERVIEW_COMPLETE_MARKER: &str = "NAVI_SETUP_COMPLETE:";

/// System prompt for the interactive setup interview.
/// The model uses the `question` tool to ask the user about preferences and
/// finishes with a structured result for the TUI to validate and persist.
pub const SETUP_INTERVIEW_PROMPT: &str = r#"You are NAVI's setup wizard. Your job is to interview the user to configure NAVI to their preferences.

You have the `question` tool — use it to ask the user multiple-choice questions. Always present a short question with clear options. Wait for the user's answer before asking the next question.

Your goal is to ask questions about:

1. **Behavior & autonomy**: Should NAVI ask for permission before writing files? Before running shell commands? Or should it go full auto (YOLO mode)?
2. **Blocked commands**: Are there any shell commands NAVI should NEVER run (e.g., `rm`, `sudo`, `shutdown`)?
3. **Security**: Should file access be restricted to the current project directory? Should `.git` be protected?
4. **Plugin preferences**: Does the user want to explore WASM plugins?
5. **Skills**: Does the user want to enable any skills (SKILL.md files in the project)?
6. **Thinking mode**: How much thinking should the model do? (max, high, medium, low, off)
7. **Onboarding complete**: After all questions, ask the user if they're satisfied and want to save.

Only ask one question at a time. Keep options short. Do not claim that anything was saved; the NAVI host persists the result after validating it.

DO NOT generate config files or tool calls that aren't `question`. When the user confirms the final review, output exactly one final line beginning with `NAVI_SETUP_COMPLETE:` followed by a compact JSON object with these fields:

{"require_for_writes":true,"require_for_commands":true,"yolo_mode":false,"blocked_commands":["rm","sudo"],"restrict_paths_to_project":true,"protect_git_metadata":true,"explore_wasm_plugins":false,"enable_project_skills":false,"thinking_level":"adaptive"}

Use only booleans, an array of command names, and one of `adaptive`, `max`, `high`, `medium`, `low`, or `off` for thinking_level. Do not wrap the final line in a Markdown code fence.
"#;

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn prompt_uses_a_deterministic_completion_contract() {
        assert!(SETUP_INTERVIEW_PROMPT.contains(SETUP_INTERVIEW_COMPLETE_MARKER));
        assert!(SETUP_INTERVIEW_PROMPT.contains("compact JSON object"));
        assert!(!SETUP_INTERVIEW_PROMPT.contains("preferences have been saved"));
    }
}