forked from theexperiencecompany/gaia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
421 lines (334 loc) · 17.6 KB
/
mise.toml
File metadata and controls
421 lines (334 loc) · 17.6 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# ═══════════════════════════════════════════════════════════════════════════════
# GAIA Monorepo - Root mise.toml
# ═══════════════════════════════════════════════════════════════════════════════
#
# mise manages tools (node, python, nx) and task execution
# nx manages build caching and project graph
#
# Quick Start:
# mise setup # First-time setup (all apps)
# mise dev # Start API + web
# mise tasks # List all available tasks
#
# Documentation: https://docs.heygaia.io/developers/commands
# ═══════════════════════════════════════════════════════════════════════════════
experimental_monorepo_root = true
# ─────────────────────────────────────────────────────────────────────────────
# MONOREPO CONFIGURATION
# ─────────────────────────────────────────────────────────────────────────────
#
# Monorepo mode allows accessing sub-project tasks from root using // syntax:
#
# mise //apps/api:lint # Run api lint
# mise //apps/api:dev # Run api dev (no docker)
# mise //apps/desktop:dist:mac # Build macOS desktop app
# mise //apps/bots/discord:dev # Run discord bot
# mise //...:lint # Run lint in ALL config_roots
#
# From within a sub-project, tasks work without // syntax:
# cd apps/api && mise lint # Same as: mise //apps/api:lint
# cd apps/desktop && mise dist:mac
#
# Root tasks (defined below) handle orchestration and docker setup:
# mise dev # docker + api + web (orchestrated)
# mise dev:api # docker + api (orchestrated)
# mise lint # lint all projects (orchestrated)
#
# When to use each:
# - Root tasks (mise dev, mise lint) = orchestration + docker
# - Monorepo tasks (mise //apps/api:dev) = direct app commands
# - Local tasks (cd apps/api && mise dev) = when working in one app
#
# [monorepo]
# config_roots = [
# "apps/api",
# "apps/web",
# "apps/desktop",
# "apps/mobile",
# "docs",
# "apps/voice-agent",
# "apps/bots/*",
# ]
# ─────────────────────────────────────────────────────────────────────────────
# TOOLS & ENVIRONMENT
# ─────────────────────────────────────────────────────────────────────────────
[tools]
python = "3.12"
node = "22"
java = "21"
uv = "latest"
prek = "0.2.23"
"npm:nx" = "latest"
"npm:mintlify" = "latest"
[env]
_.python.venv = { path = ".venv", create = true }
MISE_NODE_COREPACK = "1"
[settings]
experimental = true
task.monorepo_depth = 4
task.monorepo_exclude_dirs = ["node_modules", ".next", ".venv", "__pycache__", "dist", "build", ".expo"]
# ─────────────────────────────────────────────────────────────────────────────
# SETUP & INSTALLATION
# ─────────────────────────────────────────────────────────────────────────────
[tasks."setup:env"]
description = "Check if environment files exist for all apps"
run = '''
echo "Checking environment files..."
missing=""
# API (Manual check)
if [ ! -f "apps/api/.env" ]; then
missing="$missing\n cp apps/api/.env.example apps/api/.env"
fi
# Web (Auto-copy)
if [ ! -f "apps/web/.env" ] && [ -f "apps/web/.env.example" ]; then
echo "Creating apps/web/.env from example (no secrets)"
cp apps/web/.env.example apps/web/.env
fi
# Mobile (Auto-copy)
if [ ! -f "apps/mobile/.env" ] && [ -f "apps/mobile/.env.example" ]; then
echo "Creating apps/mobile/.env from example (no secrets)"
cp apps/mobile/.env.example apps/mobile/.env
fi
if [ -n "$missing" ]; then
echo "ERROR: Missing API environment file!"
echo ""
echo "Please copy the example file (contains secrets):"
echo -e "$missing"
exit 1
fi
echo "Environment files ready"
'''
[tasks."setup:mobile"]
description = "Install mobile dependencies (Expo)"
dir = "apps/mobile"
run = "pnpm install"
[tasks."setup:desktop"]
description = "Install desktop dependencies (Electron)"
dir = "apps/desktop"
run = "pnpm install"
[tasks."setup:voice-agent"]
description = "Install voice agent dependencies + download models"
dir = "apps/voice-agent"
run = "uv sync && uv run python -m src download-files"
[tasks."setup:deps"]
description = "Install all project dependencies"
run = '''
echo "Installing all dependencies..."
pnpm install
echo "Installing API dependencies..."
(cd apps/api && uv sync --group backend --group dev)
echo "Installing voice-agent dependencies..."
(cd apps/voice-agent && uv sync)
echo "All dependencies installed"
'''
[tasks.setup]
description = "Complete project setup for all apps (API, Web, Desktop, Mobile, Voice)"
depends = ["setup:env", "setup:deps"]
run = '''
echo "Starting Docker services..."
nx run docker:docker:up
echo "Seeding AI models..."
(cd apps/api && uv run --group backend python scripts/seed_models.py --force)
echo ""
echo "Setup complete! Run 'mise dev' to start development servers."
'''
# ─────────────────────────────────────────────────────────────────────────────
# DEVELOPMENT COMMANDS
# ─────────────────────────────────────────────────────────────────────────────
[tasks.dev]
description = "Run API + web in parallel (starts Docker automatically)"
run = "nx run docker:docker:up && nx run-many -t dev --projects=api,web --parallel=2"
[tasks."dev:api"]
description = "Run ONLY API server (starts Docker automatically)"
run = "nx run docker:docker:up && nx dev api"
[tasks."dev:web"]
description = "Run ONLY web (starts Docker automatically)"
run = "nx run docker:docker:up && nx dev web"
[tasks."dev:mobile"]
description = "Run Mobile App + API (starts Docker automatically)"
run = "nx run docker:docker:up && nx run-many -t dev --projects=api,mobile --parallel=2"
[tasks."dev:bots"]
description = "Run ALL bots (Discord, Telegram, Slack, WhatsApp) in parallel"
run = "nx run-many -t dev --projects=bot-discord,bot-telegram,bot-slack,bot-whatsapp --parallel=4"
[tasks."dev:full"]
description = "Run API + web + arq worker + voice agent + all bots in parallel"
run = "nx run docker:docker:up && nx run-many -t dev,worker --projects=api,web,voice-agent,bot-discord,bot-telegram,bot-slack,bot-whatsapp --parallel=8"
# ─────────────────────────────────────────────────────────────────────────────
# BUILD COMMANDS
# ─────────────────────────────────────────────────────────────────────────────
[tasks.build]
description = "Build all apps"
run = "nx run-many -t build"
[tasks."build:affected"]
description = "Build only affected projects"
run = "nx affected -t build"
# ─────────────────────────────────────────────────────────────────────────────
# TEST COMMANDS
# ─────────────────────────────────────────────────────────────────────────────
[tasks.test]
description = "Run all JS/TS tests via Nx"
run = "nx run-many -t test --parallel=3"
[tasks."test:affected"]
description = "Test only affected projects"
run = "nx affected -t test --parallel=3"
[tasks."test:python"]
description = "Run all Python tests with real services via Dagger"
run = "dagger call -s test-python"
[tasks."test:python:unit"]
description = "Run Python unit tests only (no services, fast)"
run = "cd apps/api && USE_REAL_SERVICES=0 uv run pytest tests/unit --tb=short -q"
[tasks."test:python:coverage"]
description = "Run Python tests with coverage via Dagger"
run = "dagger call -s test-python-coverage"
[tasks."test:typescript"]
description = "Run JS/TS tests via Nx"
run = "nx run-many -t test --parallel=3"
[tasks."test:bots"]
description = "Test all bots (Discord, Slack, Telegram, WhatsApp)"
run = "cd apps/bots && pnpm vitest run"
[tasks."test:cli"]
description = "Run CLI tests"
run = "cd packages/cli && pnpm vitest run"
# ─────────────────────────────────────────────────────────────────────────────
# LINTING & FORMATTING
# ─────────────────────────────────────────────────────────────────────────────
[tasks.lint]
description = "Lint all apps (parallel with caching)"
run = "nx run-many -t lint --parallel=3"
[tasks."lint:fix"]
description = "Fix all apps: lint + format + sort imports (biome check --write)"
run = "nx run-many -t lint:fix --parallel=3"
[tasks."lint:affected"]
description = "Lint only affected projects (parallel with caching)"
run = "nx affected -t lint --parallel=3"
[tasks.format]
description = "Whitespace/indentation only — does NOT sort imports (use lint:fix for that)"
run = "nx run-many -t format --parallel=3"
[tasks."format:check"]
description = "Check whitespace/indentation only — does NOT check import order"
run = "nx run-many -t format:check --parallel=3"
[tasks."format:affected"]
description = "Whitespace/indentation only for affected projects — does NOT sort imports"
run = "nx affected -t format --parallel=3"
[tasks."type-check"]
description = "Type-check all apps (parallel with caching)"
run = "nx run-many -t type-check --parallel=3"
[tasks."type-check:affected"]
description = "Type-check only affected projects (parallel with caching)"
run = "nx affected -t type-check --parallel=3"
# ─────────────────────────────────────────────────────────────────────────────
# PRE-COMMIT HOOKS
# ─────────────────────────────────────────────────────────────────────────────
[tasks."pre-commit"]
description = "Run all pre-commit checks (workspace mode)"
run = "prek run --all-files"
[tasks."pre-commit:install"]
description = "Install pre-commit hooks using prek"
run = "prek install"
[tasks."pre-commit:run"]
description = "Run pre-commit hooks on staged files"
run = "prek run"
[tasks."pre-commit:api"]
description = "Run pre-commit checks for API only"
run = "prek run apps/api/"
[tasks."pre-commit:web"]
description = "Run pre-commit checks for web only"
run = "prek run apps/web/"
[tasks."pre-commit:uninstall"]
description = "Uninstall pre-commit hooks"
run = "prek uninstall"
# ─────────────────────────────────────────────────────────────────────────────
# CLEAN & MAINTENANCE
# ─────────────────────────────────────────────────────────────────────────────
[tasks.clean]
description = "Clean all apps"
run = "nx run-many -t clean"
[tasks."clean:nx"]
description = "Clean Nx cache"
run = "nx reset"
[tasks."dagger-clean"]
description = "Clear Dagger engine local cache"
run = "dagger core engine local-cache prune"
# ─────────────────────────────────────────────────────────────────────────────
# NX UTILITIES
# ─────────────────────────────────────────────────────────────────────────────
[tasks.graph]
description = "Show Nx project graph"
run = "nx graph"
[tasks."affected:graph"]
description = "Show affected projects graph"
run = "nx affected:graph"
# ─────────────────────────────────────────────────────────────────────────────
# CI/CD COMMANDS
# ─────────────────────────────────────────────────────────────────────────────
# ── Dagger (only for tasks that need service containers) ──
[tasks."ci:test-python"]
description = "Run Python tests via Dagger with real services (same as CI)"
run = "dagger call -s test-python"
[tasks."ci:test-python:coverage"]
description = "Run Python tests with coverage via Dagger"
run = "dagger call -s test-python-coverage"
[tasks."ci:quality"]
description = "Run full quality gate via Dagger (local convenience, runs everything)"
run = "dagger call -s quality-checks"
[tasks."ci:quality:debug"]
description = "Run quality gate with interactive debugging on failure"
run = "dagger call quality-checks --interactive"
[tasks."ci:quality:verbose"]
description = "Run quality gate with full TUI and debug logs"
run = "dagger call -vv quality-checks"
# ── Docker image builds via Dagger ──
[tasks."ci:docker"]
description = "Build all Docker images via Dagger"
run = "dagger call -s docker-build-all"
[tasks."ci:docker:api"]
description = "Build API Docker image via Dagger"
run = "dagger call -s docker-build --app api"
[tasks."ci:docker:web"]
description = "Build web Docker image via Dagger"
run = "dagger call -s docker-build --app web"
[tasks."ci:docker:voice-agent"]
description = "Build voice-agent Docker image via Dagger"
run = "dagger call -s docker-build --app voice-agent"
[tasks."ci:docker:bot-discord"]
description = "Build Discord bot Docker image via Dagger"
run = "dagger call -s docker-build --app bot-discord"
[tasks."ci:docker:bot-slack"]
description = "Build Slack bot Docker image via Dagger"
run = "dagger call -s docker-build --app bot-slack"
[tasks."ci:docker:bot-telegram"]
description = "Build Telegram bot Docker image via Dagger"
run = "dagger call -s docker-build --app bot-telegram"
[tasks."ci:docker:bot-whatsapp"]
description = "Build WhatsApp bot Docker image via Dagger"
run = "dagger call -s docker-build --app bot-whatsapp"
# ── GitHub Actions simulation (via act) ──
[tasks."ci:act:quality"]
description = "Dry-run quality-checks workflow locally with act"
run = "act workflow_dispatch -n -W .github/workflows/main.yml"
[tasks."ci:act:quality:run"]
description = "Actually run quality-checks workflow locally with act"
run = "act workflow_dispatch -W .github/workflows/main.yml"
[tasks."ci:act:desktop"]
description = "Test desktop-release workflow locally with act (dry-run)"
run = "act release --job build -n --eventpath .github/test-events/release.json"
[tasks."ci:act:desktop:run"]
description = "Actually run desktop-release workflow locally with act"
run = "act release --job build --eventpath .github/test-events/release.json"
[tasks."ci:act:build"]
description = "Test build.yml workflow (dry-run)"
run = "act workflow_call -n -W .github/workflows/build.yml"
[tasks."ci:act:list"]
description = "List all jobs across all workflows"
run = "act -l --workflows .github/workflows/"
# DEAD CODE DETECTION
# ─────────────────────────────────────────────────────────────────────────────
[tasks."dead-code"]
description = "Check for dead code (summary view)"
run = "bash scripts/dead-code-check.sh"
[tasks."dead-code:verbose"]
description = "Check for dead code (detailed with file names)"
run = "bash scripts/dead-code-check.sh --verbose"
[tasks."dead-code:strict"]
description = "Check for dead code (fail on findings)"
run = "bash scripts/dead-code-check.sh --strict"