Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "docs/palantir"]
path = docs/palantir
url = git@github.com:MarkBedrock/palantir.git
url = git@github.com:DesignOpticsFast/palantir.git
branch = main
128 changes: 128 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Options
# ---------------------------------------
option(BUILD_TESTING "Build tests" ON)
option(BEDROCK_WITH_TRANSPORT_DEPS "Enable Palantir/transport deps" OFF)

# ---------------------------------------
# OpenMP for multithreading
Expand Down Expand Up @@ -132,6 +133,133 @@ target_include_directories(bedrock_sdk INTERFACE
target_link_libraries(bedrock_sdk INTERFACE
bedrock_som)

# ---------------------------------------
# Palantir protobuf code generation (WP1)
# ---------------------------------------
if(BEDROCK_WITH_TRANSPORT_DEPS)
find_program(PROTOC_EXECUTABLE protoc)
if(NOT PROTOC_EXECUTABLE)
message(FATAL_ERROR "protoc not found but BEDROCK_WITH_TRANSPORT_DEPS=ON. Install protobuf (e.g., brew install protobuf)")
endif()

set(PALANTIR_PROTO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/docs/palantir/proto")
set(PALANTIR_PROTO_OUT_DIR "${CMAKE_BINARY_DIR}/generated/palantir")
file(MAKE_DIRECTORY "${PALANTIR_PROTO_OUT_DIR}")

set(CAPABILITIES_PROTO "${PALANTIR_PROTO_DIR}/palantir/capabilities.proto")

if(EXISTS "${CAPABILITIES_PROTO}")
add_custom_command(
OUTPUT
"${PALANTIR_PROTO_OUT_DIR}/palantir/capabilities.pb.cc"
"${PALANTIR_PROTO_OUT_DIR}/palantir/capabilities.pb.h"
COMMAND "${PROTOC_EXECUTABLE}"
--proto_path="${PALANTIR_PROTO_DIR}"
--cpp_out="${PALANTIR_PROTO_OUT_DIR}"
"${CAPABILITIES_PROTO}"
DEPENDS "${CAPABILITIES_PROTO}"
COMMENT "Generating C++ from Palantir Capabilities.proto"
)

add_library(bedrock_palantir_proto STATIC
"${PALANTIR_PROTO_OUT_DIR}/palantir/capabilities.pb.cc"
)

target_include_directories(bedrock_palantir_proto PUBLIC
"${PALANTIR_PROTO_OUT_DIR}"
)

find_package(Protobuf REQUIRED)
target_link_libraries(bedrock_palantir_proto PUBLIC
protobuf::libprotobuf
)

# Protobuf 6.33+ requires abseil libraries
# Link abseil libraries that protobuf depends on
find_library(ABSL_DIE_IF_NULL_LIB absl_die_if_null PATHS /opt/homebrew/opt/abseil/lib NO_DEFAULT_PATH)
find_library(ABSL_LOG_INITIALIZE_LIB absl_log_initialize PATHS /opt/homebrew/opt/abseil/lib NO_DEFAULT_PATH)
find_library(ABSL_STATUSOR_LIB absl_statusor PATHS /opt/homebrew/opt/abseil/lib NO_DEFAULT_PATH)
find_library(ABSL_LOG_INTERNAL_CHECK_OP_LIB absl_log_internal_check_op PATHS /opt/homebrew/opt/abseil/lib NO_DEFAULT_PATH)
find_library(ABSL_LOG_INTERNAL_CONDITIONS_LIB absl_log_internal_conditions PATHS /opt/homebrew/opt/abseil/lib NO_DEFAULT_PATH)
find_library(ABSL_LOG_INTERNAL_MESSAGE_LIB absl_log_internal_message PATHS /opt/homebrew/opt/abseil/lib NO_DEFAULT_PATH)

if(ABSL_DIE_IF_NULL_LIB AND ABSL_LOG_INITIALIZE_LIB AND ABSL_STATUSOR_LIB)
target_link_libraries(bedrock_palantir_proto PUBLIC
${ABSL_DIE_IF_NULL_LIB}
${ABSL_LOG_INITIALIZE_LIB}
${ABSL_STATUSOR_LIB}
${ABSL_LOG_INTERNAL_CHECK_OP_LIB}
${ABSL_LOG_INTERNAL_CONDITIONS_LIB}
${ABSL_LOG_INTERNAL_MESSAGE_LIB}
)
endif()

message(STATUS "Palantir proto codegen enabled: Capabilities.proto -> bedrock_palantir_proto")

# ---------------------------------------
# CapabilitiesService library
# ---------------------------------------
add_library(bedrock_capabilities_service STATIC
src/palantir/CapabilitiesService.cpp
)

target_include_directories(bedrock_capabilities_service PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/include
)

target_link_libraries(bedrock_capabilities_service PUBLIC
bedrock_palantir_proto
)

# Add compile definition so code can check for transport deps
target_compile_definitions(bedrock_capabilities_service PRIVATE BEDROCK_WITH_TRANSPORT_DEPS)

# ---------------------------------------
# PalantirServer library (Qt-based IPC server)
# ---------------------------------------
find_package(Qt6 REQUIRED COMPONENTS Core Network)

add_library(bedrock_palantir_server STATIC
src/palantir/PalantirServer.cpp
)

target_include_directories(bedrock_palantir_server PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/include
)

target_link_libraries(bedrock_palantir_server PUBLIC
Qt6::Core
Qt6::Network
bedrock_palantir_proto
bedrock_capabilities_service
)

target_compile_definitions(bedrock_palantir_server PRIVATE BEDROCK_WITH_TRANSPORT_DEPS)

# ---------------------------------------
# bedrock_server executable
# ---------------------------------------
add_executable(bedrock_server
src/palantir/bedrock_server.cpp
)

target_link_libraries(bedrock_server PRIVATE
bedrock_palantir_server
)

# Enable Qt MOC for PalantirServer
set_target_properties(bedrock_palantir_server PROPERTIES
AUTOMOC ON
)

message(STATUS "bedrock_server executable configured")
else()
message(WARNING "Capabilities.proto not found at ${CAPABILITIES_PROTO}")
endif()
endif()

# --- Sprint 1: smoke (manual run)
add_executable(bedrock_smoke_step tests/smoke_step_main.cpp)
target_link_libraries(bedrock_smoke_step PRIVATE bedrock_engine)
2 changes: 1 addition & 1 deletion docs/palantir
28 changes: 28 additions & 0 deletions include/bedrock/palantir/CapabilitiesService.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

// Include generated proto headers (only when BEDROCK_WITH_TRANSPORT_DEPS=ON)
#ifdef BEDROCK_WITH_TRANSPORT_DEPS
#include "palantir/capabilities.pb.h"
#endif

namespace bedrock {
namespace palantir {

// CapabilitiesService - In-process API for generating CapabilitiesResponse
// WP1: Simple, deterministic implementation without networking
// Future: Will be integrated into Palantir IPC server
class CapabilitiesService {
public:
#ifdef BEDROCK_WITH_TRANSPORT_DEPS
// Get server capabilities
// Returns a CapabilitiesResponse with server version and supported features
::palantir::CapabilitiesResponse getCapabilities() const;
#else
// When transport deps are OFF, this class is a no-op
// (proto types not available)
#endif
};

} // namespace palantir
} // namespace bedrock

24 changes: 24 additions & 0 deletions src/palantir/CapabilitiesService.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "CapabilitiesService.hpp"

#ifdef BEDROCK_WITH_TRANSPORT_DEPS

namespace bedrock {
namespace palantir {

::palantir::CapabilitiesResponse CapabilitiesService::getCapabilities() const {
::palantir::CapabilitiesResponse response;
auto* caps = response.mutable_capabilities();

// WP1: Hard-coded capabilities
// Future: May read from configuration or detect dynamically
caps->set_server_version("bedrock-0.0.1");
caps->add_supported_features("xy_sine");

return response;
}

} // namespace palantir
} // namespace bedrock

#endif // BEDROCK_WITH_TRANSPORT_DEPS

28 changes: 28 additions & 0 deletions src/palantir/CapabilitiesService.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

// Include generated proto headers (only when BEDROCK_WITH_TRANSPORT_DEPS=ON)
#ifdef BEDROCK_WITH_TRANSPORT_DEPS
#include "palantir/capabilities.pb.h"
#endif

namespace bedrock {
namespace palantir {

// CapabilitiesService - In-process API for generating CapabilitiesResponse
// WP1: Simple, deterministic implementation without networking
// Future: Will be integrated into Palantir IPC server
class CapabilitiesService {
public:
#ifdef BEDROCK_WITH_TRANSPORT_DEPS
// Get server capabilities
// Returns a CapabilitiesResponse with server version and supported features
::palantir::CapabilitiesResponse getCapabilities() const;
#else
// When transport deps are OFF, this class is a no-op
// (proto types not available)
#endif
};

} // namespace palantir
} // namespace bedrock

Loading