Skip to main content

nyx_agent_ai/
lib.rs

1//! `AiRuntime` trait + concrete vendor adapters.
2//!
3//! This crate is published so the `nyx-agent` binary can be installed
4//! from crates.io with versioned internal dependencies. It is an
5//! implementation detail of Nyx Agent, not a stable public API.
6//!
7//! Ships the trait, the `BudgetTracker` host port, the direct-HTTP
8//! Anthropic Messages adapter, the OpenAI-compatible local-LLM
9//! adapter, and the Claude Code / Codex CLI all-in-one drivers.
10//! OpenAI API / Bedrock / Vertex remain on the roadmap. Adapters
11//! depend only on `nyx-agent-types`; the agent binary wires the
12//! host-side budget port to `nyx-agent-core`'s `BudgetStore` at startup.
13
14pub mod adapter;
15pub mod runtime;
16pub mod tasks;
17
18pub use adapter::anthropic::{
19    AnthropicSdkAdapter, Pricing, ANTHROPIC_VERSION, DEFAULT_BASE_URL, DEFAULT_RANKING_MODEL,
20    DEFAULT_SYNTHESIS_MODEL,
21};
22pub use adapter::claude_code::{
23    detect_claude_binary, parse_stream_json, ClaudeBinary, ClaudeCodeAdapter,
24    DEFAULT_CLAUDE_BINARY, MINIMUM_CLAUDE_VERSION,
25};
26pub use adapter::codex::{
27    detect_codex_binary, parse_codex_jsonl, CodexBinary, CodexCliAdapter, DEFAULT_CODEX_BINARY,
28    MINIMUM_CODEX_VERSION,
29};
30pub use adapter::local_llm::{LocalLlmAdapter, DEFAULT_LOCAL_LLM_MODEL};
31pub use runtime::{
32    deterministic_seed, AiRuntime, BudgetTracker, InMemoryBudgetTracker, SharedBudgetTracker,
33};
34pub use tasks::attack_agent::{
35    run as run_attack_agent, AttackAgentAuditEntry, AttackAgentKnownLead, AttackAgentOutcome,
36    AttackAgentProfile, AttackAgentScope, AttackAgentVulnerability, AttackWorkspace,
37    ExistingVulnerabilitySummary, ATTACK_AGENT_PROMPT_VERSION, DEFAULT_ATTACK_AGENT_MAX_TURNS,
38    DEFAULT_ATTACK_AGENT_PROFILES, SPECIALIST_ATTACK_AGENT_PROFILES,
39};
40pub use tasks::auth_setup::{
41    run as run_auth_setup, AuthSetupOutcome, AuthSetupScope, AUTH_SETUP_PROMPT_VERSION,
42    DEFAULT_AUTH_SETUP_RUN_CAP_USD_MICROS,
43};
44pub use tasks::chain_reasoning::{
45    run as run_chain_reasoning, run_agentic as run_agentic_chain_reasoning, ChainReasoningOutcome,
46    ChainReasoningWorkspace,
47};
48pub use tasks::exploration::{
49    run as run_exploration, AuditEntry as ExplorationAuditEntry, EscapeSuiteGate,
50    EscapeSuiteVerdict, ExplorationEndpoint, ExplorationFinding, ExplorationHaltReason,
51    ExplorationKnownLead, ExplorationOutcome, ExplorationScope,
52    DEFAULT_EXPLORATION_RUN_CAP_USD_MICROS, DEFAULT_EXPLORATION_SOFT_CAP_USD_MICROS,
53    DEFAULT_EXPLORATION_WALL_CLOCK, EXPLORATION_PROMPT_VERSION,
54    EXPLORATION_RESEARCH_PROMPT_VERSION,
55};
56pub use tasks::live_evidence_review::{
57    run as run_live_evidence_review, LiveEvidenceReviewDecision, LiveEvidenceReviewInput,
58    LiveEvidenceReviewOutcome, LiveEvidenceReviewOutput, LIVE_EVIDENCE_REVIEW_PROMPT_VERSION,
59};
60pub use tasks::novel_findings::{run as run_novel_findings, NovelFindingDiscoveryOutcome};
61pub use tasks::payload_synthesis::{run as run_payload_synthesis, PayloadSynthesisOutcome};
62pub use tasks::project_setup::{
63    run as run_project_setup, ProjectSetupOutcome, ProjectSetupScope,
64    DEFAULT_PROJECT_SETUP_RUN_CAP_USD_MICROS, PROJECT_SETUP_PROMPT_VERSION,
65};
66pub use tasks::remediation::{
67    run as run_remediation, RemediationOutcome, RemediationScope,
68    DEFAULT_REMEDIATION_RUN_CAP_USD_MICROS, REMEDIATION_PROMPT_VERSION,
69};
70pub use tasks::seed_setup::{
71    run as run_seed_setup, SeedSetupOutcome, SeedSetupScope, DEFAULT_SEED_SETUP_RUN_CAP_USD_MICROS,
72    SEED_SETUP_PROMPT_VERSION,
73};
74pub use tasks::spec_derivation::{
75    read_excerpt as read_spec_excerpt, run as run_spec_derivation, SpecDerivationOutcome,
76};