Skip to content
Open
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
7 changes: 4 additions & 3 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
build-essential g++-11 \
libcurl4-openssl-dev pkg-config \
libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config \
lcov gcovr python3-pip

- name: Configure with coverage
Expand Down Expand Up @@ -258,7 +258,8 @@ jobs:
if [ -f pr-coverage/coverage-summary.txt ]; then
echo "### Current PR Coverage" >> coverage-diff.md
echo "\`\`\`" >> coverage-diff.md
cat pr-coverage/coverage-summary.txt >> coverage-diff.md
grep -E '^Total (Line|Function) Coverage:' pr-coverage/coverage-summary.txt >> coverage-diff.md || \
tail -n 10 pr-coverage/coverage-summary.txt >> coverage-diff.md
echo "\`\`\`" >> coverage-diff.md
fi

Expand All @@ -276,7 +277,7 @@ jobs:
const fs = require('fs');
const report = fs.readFileSync('coverage-diff.md', 'utf8');

github.rest.issues.createComment({
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/cpp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,19 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libcurl4-openssl-dev pkg-config
sudo apt-get install -y build-essential libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install cmake curl pkg-config
brew install cmake curl gumbo-parser sqlite pkg-config

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
set "OVERLAY_PORTS=%CD%\.github\vcpkg-overlay-ports"
%VCPKG_INSTALLATION_ROOT%\vcpkg install --overlay-ports="%OVERLAY_PORTS%" curl:x64-windows gumbo:x64-windows sqlite3:x64-windows

- name: Check C++ compiler availability
shell: bash
Expand Down Expand Up @@ -110,7 +117,13 @@ jobs:
python3 tools/check_case_collisions.py || python tools/check_case_collisions.py

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
shell: bash
run: |
EXTRA_ARGS=""
if [[ "$RUNNER_OS" == "Windows" ]]; then
EXTRA_ARGS="-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows"
fi
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} $EXTRA_ARGS

- name: Build
run: cmake --build build --config ${{ matrix.build_type }} -j 2
Expand Down Expand Up @@ -191,7 +204,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ build-essential libcurl4-openssl-dev pkg-config
sudo apt-get install -y cmake g++ build-essential libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config

- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
Expand Down
72 changes: 60 additions & 12 deletions .github/workflows/e2e-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,47 @@ jobs:
${{ matrix.cc }} \
${{ matrix.cxx }} \
libcurl4-openssl-dev \
libgumbo-dev \
libsqlite3-dev \
pkg-config \
lcov \
gcovr

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install cmake curl pkg-config lcov
brew install cmake curl gumbo-parser sqlite pkg-config lcov

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
if (-not $env:VCPKG_INSTALLATION_ROOT) {
$vcpkgCmd = (Get-Command vcpkg -ErrorAction Stop).Source
$env:VCPKG_INSTALLATION_ROOT = Split-Path -Path $vcpkgCmd -Parent
}
$overlayPorts = Join-Path $env:GITHUB_WORKSPACE ".github/vcpkg-overlay-ports"
vcpkg install --overlay-ports="$overlayPorts" curl:x64-windows sqlite3:x64-windows gumbo:x64-windows
"VCPKG_INSTALLATION_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Configure environment
shell: bash
run: |
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV

- name: Configure CMake
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake -B build `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows

- name: Configure CMake (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: |
cmake -B build \
Expand Down Expand Up @@ -200,7 +225,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
build-essential g++-11 \
libcurl4-openssl-dev pkg-config \
libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config \
lcov gcovr

- name: Configure with coverage
Expand Down Expand Up @@ -272,7 +297,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
build-essential g++-11 \
libcurl4-openssl-dev pkg-config
libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config

- name: Build Release
run: |
Expand Down Expand Up @@ -338,7 +363,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
build-essential g++-11 \
libcurl4-openssl-dev pkg-config
libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config

- name: Build Release
run: |
Expand Down Expand Up @@ -431,7 +456,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
build-essential g++-11 \
libcurl4-openssl-dev pkg-config \
libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config \
cppcheck clang-tidy-14

- name: Configure CMake
Expand Down Expand Up @@ -489,7 +514,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
build-essential g++-11 \
libcurl4-openssl-dev pkg-config
libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config

- name: Configure with ${{ matrix.sanitizer }} sanitizer
run: |
Expand Down Expand Up @@ -533,8 +558,6 @@ jobs:
include:
- os: ubuntu-22.04
package_type: DEB
- os: ubuntu-20.04
package_type: DEB
- os: windows-latest
package_type: ZIP
- os: macos-latest
Expand All @@ -558,15 +581,40 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
build-essential g++-11 \
libcurl4-openssl-dev pkg-config \
libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config \
rpm

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install cmake curl pkg-config
brew install cmake curl gumbo-parser sqlite pkg-config

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
if (-not $env:VCPKG_INSTALLATION_ROOT) {
$vcpkgCmd = (Get-Command vcpkg -ErrorAction Stop).Source
$env:VCPKG_INSTALLATION_ROOT = Split-Path -Path $vcpkgCmd -Parent
}
$overlayPorts = Join-Path $env:GITHUB_WORKSPACE ".github/vcpkg-overlay-ports"
vcpkg install --overlay-ports="$overlayPorts" curl:x64-windows sqlite3:x64-windows gumbo:x64-windows
"VCPKG_INSTALLATION_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Build and Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake -B build `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows
cmake --build build --config Release -j 4
Set-Location build
cpack -G ${{ matrix.package_type }}

- name: Build and Package
- name: Build and Package (Linux/macOS)
if: runner.os != 'Windows'
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j 4
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install git and dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y git cmake g++ build-essential libcurl4-openssl-dev pkg-config rpm dpkg-dev ca-certificates
DEBIAN_FRONTEND=noninteractive apt-get install -y git cmake g++ build-essential python3 libcurl4-openssl-dev libgumbo-dev libsqlite3-dev pkg-config rpm dpkg-dev ca-certificates

- uses: actions/checkout@v4

Expand Down Expand Up @@ -164,9 +164,23 @@ jobs:
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.20'

- name: Install dependencies (Windows)
shell: pwsh
run: |
$vcpkgCmd = (Get-Command vcpkg -ErrorAction Stop).Source
$env:VCPKG_INSTALLATION_ROOT = Split-Path -Path $vcpkgCmd -Parent
$overlayPorts = Join-Path $PWD ".github\vcpkg-overlay-ports"
& $vcpkgCmd install --overlay-ports="$overlayPorts" curl:x64-windows gumbo:x64-windows sqlite3:x64-windows
"VCPKG_INSTALLATION_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
shell: pwsh
run: |
cmake -B build `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows

- name: Build
run: cmake --build build --config Release -j 2
Expand Down Expand Up @@ -239,7 +253,7 @@ jobs:

- name: Install dependencies
run: |
brew install cmake curl pkg-config
brew install cmake curl gumbo-parser sqlite pkg-config

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
Expand Down
27 changes: 16 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,9 @@ endif()
# Find packages
find_package(Threads REQUIRED)

# Find libcurl for HTTP operations
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(CURL QUIET libcurl)
endif()

if(NOT CURL_FOUND)
find_package(CURL QUIET)
endif()
# Find libcurl for HTTP operations. Use CMake's package module so the
# imported target carries configuration-specific Windows library paths.
find_package(CURL REQUIRED)

# Enable testing
# Bound individual tests so a deadlock fails promptly instead of occupying a
Expand Down Expand Up @@ -672,14 +666,15 @@ install(TARGETS
elizaos-core elizaos-agentloop elizaos-agentmemory
elizaos-agentaction elizaos-agentagenda
elizaos-agentcomms elizaos-agentlogger elizaos-agentshell
elizaos-agentbrowser
elizaos-agentbrowser elizaos-endocrine elizaos-persistence

# Application modules
elizaos-eliza elizaos-characters elizaos-knowledge
elizaos-goal_manager

# Integration modules
elizaos-auto_fun elizaos-autonomous_starter
elizaos-auto_fun elizaos-autonomous_starter elizaos-cognitive_curriculum
elizaos-llama_cpp elizaos-cognitive_bridge
elizaos-sweagent elizaos-mcp_gateway elizaos-otaku elizaos-otc_agent

# Plugin modules
Expand Down Expand Up @@ -747,11 +742,21 @@ install(TARGETS

# Generate package config
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ElizaOSConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/ElizaOSConfig.cmake"
INSTALL_DESTINATION lib/cmake/ElizaOS
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ElizaOSConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/ElizaOSConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ElizaOSConfigVersion.cmake"
DESTINATION lib/cmake/ElizaOS
)

# Print configuration summary
message(STATUS "ElizaOS-CPP Configuration Summary:")
Expand Down
75 changes: 75 additions & 0 deletions cmake/ElizaOSConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(Threads)
find_dependency(SQLite3)
find_dependency(nlohmann_json CONFIG)

set(ElizaOS_FOUND TRUE)

function(_elizaos_import_static name)
if(TARGET ElizaOS::${name})
return()
endif()

string(MAKE_C_IDENTIFIER "${name}" key)
string(TOUPPER "${key}" key)
find_library(ELIZAOS_${key}_LIBRARY
NAMES ${ARGN}
PATHS "${PACKAGE_PREFIX_DIR}/lib"
NO_DEFAULT_PATH
)
if(NOT ELIZAOS_${key}_LIBRARY)
set(ElizaOS_FOUND FALSE PARENT_SCOPE)
set(ElizaOS_NOT_FOUND_MESSAGE
"ElizaOS installation is incomplete: missing static library for ${name}"
PARENT_SCOPE)
return()
endif()

add_library(ElizaOS::${name} STATIC IMPORTED)
set_target_properties(ElizaOS::${name} PROPERTIES
IMPORTED_LOCATION "${ELIZAOS_${key}_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include"
)
endfunction()

_elizaos_import_static(core elizaos-core)
_elizaos_import_static(agentloop elizaos-agentloop)
_elizaos_import_static(agentmemory elizaos-agentmemory)
_elizaos_import_static(agentshell elizaos-agentshell)
_elizaos_import_static(agentlogger elizaos-agentlogger)
_elizaos_import_static(endocrine elizaos-endocrine)
_elizaos_import_static(autonomous_starter elizaos-autonomous_starter)
_elizaos_import_static(cognitive_curriculum elizaos-cognitive_curriculum)
_elizaos_import_static(llama_cpp elizaos-llama_cpp)
_elizaos_import_static(cognitive_bridge elizaos-cognitive_bridge)
_elizaos_import_static(persistence elizaos_persistence elizaos-persistence)

if(NOT ElizaOS_FOUND)
return()
endif()

set_property(TARGET ElizaOS::core PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads")
set_property(TARGET ElizaOS::agentloop PROPERTY INTERFACE_LINK_LIBRARIES "ElizaOS::core;Threads::Threads")
set_property(TARGET ElizaOS::agentmemory PROPERTY INTERFACE_LINK_LIBRARIES "ElizaOS::core;Threads::Threads")
set_property(TARGET ElizaOS::agentlogger PROPERTY INTERFACE_LINK_LIBRARIES "ElizaOS::core")
set_property(TARGET ElizaOS::agentshell PROPERTY INTERFACE_LINK_LIBRARIES "ElizaOS::core;ElizaOS::agentlogger")
set_property(TARGET ElizaOS::endocrine PROPERTY INTERFACE_LINK_LIBRARIES "nlohmann_json::nlohmann_json")
set_property(TARGET ElizaOS::autonomous_starter PROPERTY INTERFACE_LINK_LIBRARIES
"ElizaOS::core;ElizaOS::agentloop;ElizaOS::agentshell;ElizaOS::agentlogger;ElizaOS::agentmemory;ElizaOS::endocrine;Threads::Threads")
set_property(TARGET ElizaOS::cognitive_curriculum PROPERTY INTERFACE_LINK_LIBRARIES
"ElizaOS::autonomous_starter;ElizaOS::core;ElizaOS::agentloop;ElizaOS::agentshell;ElizaOS::agentlogger;Threads::Threads")
set_property(TARGET ElizaOS::llama_cpp PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads")
set_property(TARGET ElizaOS::cognitive_bridge PROPERTY INTERFACE_LINK_LIBRARIES "Threads::Threads")
set_property(TARGET ElizaOS::persistence PROPERTY INTERFACE_LINK_LIBRARIES
"ElizaOS::core;SQLite::SQLite3;Threads::Threads")

set(ElizaOS_LIBRARIES
ElizaOS::cognitive_curriculum
ElizaOS::llama_cpp
ElizaOS::cognitive_bridge
ElizaOS::persistence
)

check_required_components(ElizaOS)
Loading
Loading