-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
148 lines (108 loc) · 5.92 KB
/
Copy pathMakefile
File metadata and controls
148 lines (108 loc) · 5.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Quorum — Multi-Domain Agent Orchestration Daemon
# ============================================================
.PHONY: init build clean test help web web-stop web-status install uninstall
.DEFAULT_GOAL := help
# ── Config ───────────────────────────────────────────────────
BUILD_DIR := build
BUILD_TYPE := Release
NPROC := $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
CONFIG := configs/mm-bot.yaml
# ── Help ─────────────────────────────────────────────────────
help: ## Show this help
@echo "Quorum — Multi-Domain Agent Orchestration"
@echo ""
@echo "Usage: make <target>"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
# ── Bootstrap ────────────────────────────────────────────────
init: ## Bootstrap project directory structure
@echo "=== Bootstrapping Quorum project structure ==="
@# ── quorum-core (C++, closed source) ──
@mkdir -p quorum-core/src/daemon
@mkdir -p quorum-core/src/agent
@mkdir -p quorum-core/src/vault
@mkdir -p quorum-core/src/storage
@mkdir -p quorum-core/src/utils
@mkdir -p quorum-core/src/knowledge
@mkdir -p quorum-core/tests/unit
@mkdir -p quorum-core/tests/integration
@# ── Configs ──
@mkdir -p configs/agents
@mkdir -p configs/tasks
@# ── Data directories (gitignored) ──
@mkdir -p data/vaults
@mkdir -p data/knowledge/inbox
@mkdir -p data/knowledge/library
@mkdir -p data/knowledge/archive
@echo ""
@echo "✓ Project structure created."
@echo " Next: run 'make build'"
# ── Build ────────────────────────────────────────────────────
build: ## Build C++ daemon and CLI
@echo "=== Building quorum-core ==="
cmake -B $(BUILD_DIR) -S quorum-core \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build $(BUILD_DIR) -j$(NPROC)
@echo "✓ Build complete: $(BUILD_DIR)/"
build-debug: ## Build with debug symbols
$(MAKE) build BUILD_TYPE=Debug
# ── Install ──────────────────────────────────────────────────
BINDIR := $(HOME)/.local/bin
install: build ## Install the `quorum` CLI (-> BINDIR, default ~/.local/bin) + skills + supervisor agent
@mkdir -p "$(BINDIR)"
@ln -sfn "$(CURDIR)/$(BUILD_DIR)/quorum_daemon" "$(BINDIR)/quorum"
@echo "✓ quorum -> $(BINDIR)/quorum (symlink to $(BUILD_DIR)/quorum_daemon; tracks rebuilds)"
@command -v quorum >/dev/null 2>&1 \
&& echo "✓ 'quorum' resolves on PATH" \
|| echo "⚠ $(BINDIR) is not on PATH — add it: export PATH=\"$(BINDIR):\$$PATH\""
@./scripts/install-skills.sh
@echo ""
@echo "✓ Install complete. Next: cd <your-project> && quorum init && quorum supervisor init"
uninstall: ## Remove the `quorum` CLI symlink from BINDIR
@rm -f "$(BINDIR)/quorum"
@echo "✓ Removed $(BINDIR)/quorum"
@echo " (skills/agents left intact — remove ~/.claude/skills/quorum-roles + ~/.claude/agents/supervisor.md by hand if desired)"
# ── Run ──────────────────────────────────────────────────────
run: build ## Build and run daemon
./$(BUILD_DIR)/quorum_daemon --config $(CONFIG)
run-verbose: build ## Build and run daemon with verbose logging
./$(BUILD_DIR)/quorum_daemon --config $(CONFIG) --verbose
# ── Test ─────────────────────────────────────────────────────
test: build ## Run C++ tests
cd $(BUILD_DIR) && ctest --output-on-failure
# ── Clean ────────────────────────────────────────────────────
clean: ## Remove build artifacts
rm -rf $(BUILD_DIR)
clean-data: ## Remove runtime data (vaults, SQLite)
rm -rf data/
rm -f quorum.db quorum.db-wal quorum.db-shm
clean-all: clean clean-data ## Remove everything (build + data)
# ── Web ─────────────────────────────────────────────────────
web-install: ## Install web dashboard dependencies (server + client)
cd quorum-web && bun install && cd client && bun install
web-dev: ## Start web API server (dev mode with watch, :3100)
cd quorum-web && bun run dev
web-client: ## Start React frontend (dev mode, :3101 → proxy :3100)
cd quorum-web && bun run dev:client
web: ## Start the web dashboard (API :3100 + UI :3101) in the background
./scripts/web.sh start
web-stop: ## Stop the background web dashboard
./scripts/web.sh stop
web-status: ## Show web dashboard status
./scripts/web.sh status
web-build: ## Build React frontend for production
cd quorum-web && bun run build:client
web-start: ## Start web API server (production)
cd quorum-web && bun run start
# ── Utilities ────────────────────────────────────────────────
fmt: ## Format C++ code (requires clang-format)
find quorum-core/src -name '*.h' -o -name '*.cpp' | xargs clang-format -i
lint: ## Lint C++ code (requires clang-tidy)
find quorum-core/src -name '*.h' -o -name '*.cpp' | \
xargs clang-tidy -p $(BUILD_DIR)
loc: ## Count lines of code
@echo "=== Lines of Code ==="
@echo "C++:"
@find quorum-core/src -name '*.h' -o -name '*.cpp' | xargs wc -l 2>/dev/null | tail -1 || echo " 0"