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
10 changes: 2 additions & 8 deletions implants/golemv2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@ pb = { workspace = true }
crossterm = { workspace = true }
walkdir = {workspace = true}
rust-embed = { workspace = true }
eldritch-core = { workspace = true }
eldritch-macros = { workspace = true }
eldritchv2 = { workspace = true, features = ["std", "stdlib"] }
eldritch-repl = { workspace = true }
eldritch-libagent = { workspace = true, features = ["fake_bindings"] }
eldritch-libassets = { workspace = true, features = ["stdlib"] }
eldritch-libpivot = { workspace = true, features = ["stdlib"] }
eldritch-libreport = { workspace = true, features = ["stdlib"] }
eldritchv2 = { workspace = true, features = ["std", "stdlib", "fake_bindings"] }
# Need fake here so we import this on its own
Copy link
Collaborator

@KCarretto KCarretto Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we propagate feature flags, so this should be eldritchv2 = { workspace = true, features = ["std", "stdlib", "fake_bindings"] } and then ensure eldritchv2 correctly propagates the feature flag to the stdlib crates (I think it already does). If we don't want all of the fake impls, I would add a feature flag fake_<lib> to eldritchv2 to allow it to be built with only that fake binding.

tokio.workspace = true
futures.workspace = true

Expand Down
8 changes: 4 additions & 4 deletions implants/golemv2/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extern crate alloc;

use clap::{Arg, ArgAction, Command};
use eldritch_libagent::fake::AgentFake;
use eldritchv2::agent::{fake::AgentFake, std::StdAgentLibrary};
use eldritchv2::assets::{
AssetsLibrary,
std::{EmbeddedAssets, StdAssetsLibrary},
Expand Down Expand Up @@ -41,11 +41,11 @@ fn new_runtime(assetlib: impl ForeignValue + 'static) -> Interpreter {
// Register the libraries that we need. Basically the same as interp.with_task_context but
// with our custom assets library
let agent = Arc::new(AgentFake {});
let agent_lib = eldritch_libagent::std::StdAgentLibrary::new(agent.clone(), 0);
let agent_lib = StdAgentLibrary::new(agent.clone(), 0);
interp.register_lib(agent_lib);
let report_lib = eldritch_libreport::std::StdReportLibrary::new(agent.clone(), 0);
let report_lib = eldritchv2::report::std::StdReportLibrary::new(agent.clone(), 0);
interp.register_lib(report_lib);
let pivot_lib = eldritch_libpivot::std::StdPivotLibrary::new(agent.clone(), 0);
let pivot_lib = eldritchv2::pivot::std::StdPivotLibrary::new(agent.clone(), 0);
interp.register_lib(pivot_lib);
interp.register_lib(assetlib);
interp
Expand Down
5 changes: 2 additions & 3 deletions implants/golemv2/src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use crossterm::{
style::Stylize,
terminal::{self, ClearType},
};
use eldritch_core::Value;
use eldritch_repl::{Input, Repl, ReplAction};
use eldritchv2::Interpreter;
use eldritchv2::repl::{Input, Repl, ReplAction};
use eldritchv2::{Interpreter, Value};
use std::io::{self, Write};
use std::time::Duration;

Expand Down
5 changes: 0 additions & 5 deletions implants/imixv2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ prost = { workspace = true }
crossterm = { workspace = true }
prost-types = { workspace = true }
pretty_env_logger = { workspace = true }
eldritch-core = { workspace = true }
eldritchv2 = { workspace = true, features = ["std", "stdlib"] }
eldritch-repl = { workspace = true }
eldritch-agent = { workspace = true }
eldritch-libagent = { workspace = true, features = ["stdlib"] }
eldritch-libassets = { workspace = true, features = ["stdlib"] }
transport = { workspace = true }
pb = { workspace = true, features = ["imix"] }
portable-pty = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion implants/imixv2/src/agent.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{Context, Result};
use eldritch_agent::Agent;
use eldritchv2::agent::agent::Agent;
use pb::c2::host::Platform;
use pb::c2::transport::Type::{self, *};
use pb::c2::{self, ClaimTasksRequest};
Expand Down
2 changes: 1 addition & 1 deletion implants/imixv2/src/shell/parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use eldritch_repl::Input;
use eldritchv2::repl::Input;

/// A robust VT100/ANSI input parser that logs incoming bytes and swallows unknown sequences.
pub struct InputParser {
Expand Down
9 changes: 4 additions & 5 deletions implants/imixv2/src/shell/repl.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use anyhow::Result;
use crossterm::{QueueableCommand, cursor, terminal};
use eldritch_core::Value;
use eldritch_libagent::agent::Agent;
use eldritch_libassets::std::EmptyAssets;
use eldritch_repl::{Repl, ReplAction};
use eldritchv2::{Interpreter, Printer, Span};
use eldritchv2::agent::agent::Agent;
use eldritchv2::assets::std::EmptyAssets;
use eldritchv2::repl::{Repl, ReplAction};
use eldritchv2::{Interpreter, Printer, Span, Value};
use pb::c2::{
ReportTaskOutputRequest, ReverseShellMessageKind, ReverseShellRequest, ReverseShellResponse,
TaskError, TaskOutput,
Expand Down
4 changes: 2 additions & 2 deletions implants/imixv2/src/shell/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crossterm::{
style::{Color, SetForegroundColor},
terminal,
};
use eldritch_repl::Repl;
use eldritchv2::repl::Repl;
use pb::c2::{ReverseShellMessageKind, ReverseShellRequest};

pub struct VtWriter {
Expand Down Expand Up @@ -186,7 +186,7 @@ pub fn render<W: std::io::Write>(
#[cfg(test)]
mod tests {
use super::*;
use eldritch_repl::{Input, Repl};
use eldritchv2::repl::{Input, Repl};

#[test]
fn test_render_multi_line_history() {
Expand Down
11 changes: 4 additions & 7 deletions implants/imixv2/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use std::sync::{Arc, Mutex, RwLock};
use std::thread;
use std::time::SystemTime;

use eldritch_libagent::agent::Agent;
use eldritchv2::{Interpreter, Printer, Span, assets::std::EmbeddedAssets, conversion::ToValue};
use eldritchv2::agent::agent::Agent;
use eldritchv2::assets::std::EmbeddedAssets;
use eldritchv2::{Interpreter, Printer, Span, Value, conversion::ToValue};
use pb::c2::{ReportTaskOutputRequest, Task, TaskError, TaskOutput};
use prost_types::Timestamp;
use tokio::sync::mpsc::{self, UnboundedSender};
Expand Down Expand Up @@ -293,11 +294,7 @@ fn report_panic(task_id: i64, agent: &Arc<dyn Agent>, err: String) {
}
}

fn report_result(
task_id: i64,
result: Result<eldritch_core::Value, String>,
agent: &Arc<dyn Agent>,
) {
fn report_result(task_id: i64, result: Result<Value, String>, agent: &Arc<dyn Agent>) {
match result {
Ok(v) => {
#[cfg(debug_assertions)]
Expand Down
2 changes: 1 addition & 1 deletion implants/imixv2/src/tests/agent_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::super::agent::ImixAgent;
use super::super::task::TaskRegistry;
use eldritch_libagent::agent::Agent;
use eldritchv2::agent::agent::Agent;
use pb::config::Config;
use std::sync::Arc;
use transport::MockTransport;
Expand Down
2 changes: 1 addition & 1 deletion implants/imixv2/src/tests/agent_trait_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::super::agent::ImixAgent;
use super::super::task::TaskRegistry;
use eldritch_libagent::agent::Agent;
use eldritchv2::agent::agent::Agent;
use pb::c2::host::Platform;
use pb::c2::transport::Type;
use pb::c2::{self, Host};
Expand Down
2 changes: 1 addition & 1 deletion implants/imixv2/src/tests/callback_interval_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::super::agent::ImixAgent;
use super::super::task::TaskRegistry;
use eldritch_agent::Agent;
use eldritchv2::agent::agent::Agent;
use pb::config::Config;
use std::sync::Arc;
use transport::MockTransport;
Expand Down
2 changes: 1 addition & 1 deletion implants/imixv2/src/tests/task_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::super::task::TaskRegistry;
use alloc::collections::{BTreeMap, BTreeSet};
use eldritch_libagent::agent::Agent;
use eldritchv2::agent::agent::Agent;
use pb::c2;
use pb::eldritch::Tome;
use std::sync::Arc;
Expand Down
5 changes: 4 additions & 1 deletion implants/lib/eldritchv2/eldritchv2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ version = "0.3.0"
edition = "2024"

[dependencies]
eldritch-core = { workspace = true, default-features = false }
spin = "0.10"

eldritch-core = { workspace = true, default-features = false }
eldritch-macros = { workspace = true }

# Libs
eldritch-libagent = { workspace = true, default-features = false }
eldritch-libassets = { workspace = true, default-features = false }
Expand All @@ -20,6 +22,7 @@ eldritch-libregex = { workspace = true, default-features = false }
eldritch-libreport = { workspace = true, default-features = false }
eldritch-libsys = { workspace = true, default-features = false }
eldritch-libtime = { workspace = true, default-features = false }
eldritch-repl = { workspace = true, default-features = false }

[features]
default = ["std", "stdlib"]
Expand Down
4 changes: 3 additions & 1 deletion implants/lib/eldritchv2/eldritchv2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,21 @@ pub use eldritch_libregex as regex;
pub use eldritch_libreport as report;
pub use eldritch_libsys as sys;
pub use eldritch_libtime as time;
pub use eldritch_repl as repl;

// Re-export core types
pub use eldritch_core::{
BufferPrinter, Environment, ForeignValue, Interpreter as CoreInterpreter, Printer, Span,
StdoutPrinter, TokenKind, Value, conversion,
};
pub use eldritch_macros as macros;

use alloc::string::String;
use alloc::sync::Arc;
use alloc::vec::Vec;

#[cfg(feature = "stdlib")]
use crate::agent::{agent::Agent, std::StdAgentLibrary};
pub use crate::agent::{agent::Agent, std::StdAgentLibrary};
#[cfg(feature = "stdlib")]
pub use crate::assets::std::AgentAssets;
#[cfg(feature = "stdlib")]
Expand Down
Loading