Repository navigation
Expand file tree
/
Copy pathmise.toml
More file actions
461 lines (392 loc) · 15.2 KB
/
Copy pathmise.toml
File metadata and controls
461 lines (392 loc) · 15.2 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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
min_version = "2026.6.6"
monorepo_root = true
[monorepo]
config_roots = ["apps/web", "cmd/agent"]
[tools]
# Go version from go.mod
go = "1.27.4"
# Node.js for frontend packages
node = "24.22.1"
# pnpm for workspace management
pnpm = "10"
# sqlc for sql management
sqlc = "1.31.1"
# golangci-lint for Go linting
"golangci-lint" = "2.15.0"
# Rust toolchain for the a11y-cli helper used by Computer Use.
# Pinned to a stable >= zbus MSRV (1.87+).
rust = "1.90"
[task_config]
dir = "{{cwd}}"
[settings]
experimental = true
[tasks.submodule-init]
description = "Init/update git submodules (packages/ui lives in felinics/ui)"
run = "node scripts/ensure-submodules.mjs"
[tasks.pnpm-install]
description = "Install dependencies"
env = { CI = "true" }
depends = ["submodule-init"]
run = "pnpm install"
[tasks.go-install]
description = "Install Go dependencies"
run = "go mod download"
[tasks.swagger-generate]
description = "Generate Swagger documentation"
depends = [
"//:go-install",
]
run = "cd internal/handlers && go generate"
[tasks.sdk-generate]
description = "Generate SDK code"
run = [
"pnpm run generate-sdk",
"pnpm --filter @memohai/sdk typecheck",
]
depends = [
"//:pnpm-install",
"//:swagger-generate"
]
[tasks.sqlc-generate]
description = "Generate SQL code"
# Pinned to the same invocation CI uses; a locally installed sqlc of another
# version silently rewrites every generated file's version stamp.
run = "go run github.com/sqlc-dev/sqlc/cmd/sqlc@v1.31.1 generate"
[tasks.codex-protocol-generate]
description = "Generate Go types for the codex app-server v2 protocol from the local codex CLI"
run = "go run ./cmd/gen-codex-protocol"
[tasks.grpc-generate]
description = "Generate internal gRPC protocol code"
run = """
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.11
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.6.1
PATH="$(go env GOPATH)/bin:$PATH" protoc \
--go_out=paths=source_relative:. \
--go-grpc_out=paths=source_relative:. \
internal/agent/turn/turnpb/turn.proto \
internal/rpc/runtimepb/runtime.proto \
internal/rpc/storagepb/storage.proto \
internal/network/overlay/netbird/daemonpb/daemon.proto
"""
[tasks.icons-generate]
description = "Generate icon Vue components from SVG sources"
run = "pnpm --filter @memohai/icon generate"
[tasks.dev]
description = "Start development environment"
depends = ["//:dev:workspace-image"]
run = "scripts/dev-compose.sh devenv/docker-compose.yml"
[tasks."dev:webhook-tunnel"]
description = "Start development environment with Cloudflare Quick Tunnel for webhooks"
depends = ["//:dev:workspace-image"]
run = "scripts/dev-compose.sh devenv/docker-compose.yml devenv/docker-compose.webhook-tunnel.yml"
[tasks."dev:selinux"]
description = "Start development environment on SELinux systems"
depends = ["//:dev:workspace-image"]
run = "scripts/dev-compose.sh devenv/docker-compose.yml devenv/docker-compose.selinux.yml"
[tasks."dev:down"]
description = "Stop development environment"
run = "docker compose -f devenv/docker-compose.yml down --remove-orphans"
[tasks."dev:down:selinux"]
description = "Stop development environment on SELinux systems"
run = "docker compose -f devenv/docker-compose.yml -f devenv/docker-compose.selinux.yml down --remove-orphans"
[tasks."test:session-runtime:acceptance:env"]
description = "Start the isolated two-Server Valkey environment for Session Runtime acceptance tests"
depends = ["//:dev:workspace-image"]
run = """
#!/bin/bash
set -euo pipefail
docker compose \
-f devenv/docker-compose.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.override.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.cluster.override.yml \
up -d --build --wait --wait-timeout 180 postgres pgvector valkey migrate server server_b
"""
[tasks."test:session-runtime:acceptance:env:single"]
description = "Start the isolated single-Server memory-backend acceptance environment"
depends = ["//:dev:workspace-image"]
run = """
#!/bin/bash
set -euo pipefail
# A second Server left over from the cluster topology shares this PostgreSQL but
# has its own liveness generation, so each reaper reads the other's live runs as
# stranded and condemns them. Removing it is what makes "single" mean single.
docker compose \
-f devenv/docker-compose.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.override.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.cluster.override.yml \
rm -sf valkey server_b
docker compose \
-f devenv/docker-compose.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.override.yml \
up -d --build --wait --wait-timeout 180 postgres pgvector migrate server
"""
[tasks."test:session-runtime:acceptance:env:cluster"]
description = "Start the isolated two-Server Valkey acceptance environment"
depends = ["//:dev:workspace-image"]
run = """
#!/bin/bash
set -euo pipefail
docker compose \
-f devenv/docker-compose.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.override.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.cluster.override.yml \
up -d --build --wait --wait-timeout 180 postgres pgvector valkey migrate server server_b
"""
[tasks."test:session-runtime:acceptance:env:down"]
description = "Stop the Session Runtime acceptance environment without deleting its volumes"
run = """
#!/bin/bash
set -euo pipefail
docker compose \
-f devenv/docker-compose.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.override.yml \
-f internal/agent/runtime/session/acceptance/testdata/compose.cluster.override.yml \
down
"""
[tasks."test:session-runtime:acceptance"]
description = "Run black-box Session Runtime acceptance tests against two real Server processes"
env = { MEMOH_SESSION_RUNTIME_ACCEPTANCE = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_REQUIRED = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_MODE = "cluster" }
run = """
go test \
-tags=integration \
-count=1 \
-timeout=5m \
./internal/agent/runtime/session/acceptance
"""
[tasks."test:session-runtime:acceptance:single"]
description = "Run the black-box Session Runtime suite against one memory-backend Server"
env = { MEMOH_SESSION_RUNTIME_ACCEPTANCE = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_REQUIRED = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_MODE = "single" }
run = """
go test \
-tags=integration \
-count=1 \
-timeout=5m \
./internal/agent/runtime/session/acceptance
"""
[tasks."test:session-runtime:acceptance:single:destructive"]
description = "Run the isolated decision-restart acceptance against one memory-backend Server"
env = { MEMOH_SESSION_RUNTIME_ACCEPTANCE = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_REQUIRED = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_MODE = "single", MEMOH_SESSION_RUNTIME_ACCEPTANCE_CRASH = "1" }
run = """
go test \
-tags=integration \
-count=1 \
-timeout=5m \
-run '^TestSRDEC001DecisionPersistsRunAndTurnAcrossRestart$' \
./internal/agent/runtime/session/acceptance
"""
[tasks."test:session-runtime:acceptance:cluster"]
description = "Run the black-box Session Runtime suite against two Servers and isolated Valkey"
env = { MEMOH_SESSION_RUNTIME_ACCEPTANCE = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_REQUIRED = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_MODE = "cluster", MEMOH_SESSION_RUNTIME_ACCEPTANCE_BACKEND_LOSS = "1" }
run = """
go test \
-tags=integration \
-count=1 \
-timeout=5m \
./internal/agent/runtime/session/acceptance
"""
[tasks."test:session-runtime:acceptance:cluster:destructive"]
description = "Run isolated owner, decision, steer, and terminal-proposal crash acceptance serially"
env = { MEMOH_SESSION_RUNTIME_ACCEPTANCE = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_REQUIRED = "1", MEMOH_SESSION_RUNTIME_ACCEPTANCE_MODE = "cluster", MEMOH_SESSION_RUNTIME_ACCEPTANCE_CRASH = "1" }
run = """
go test \
-tags=integration \
-count=1 \
-timeout=5m \
-run '^Test(SRDEC001DecisionPersistsRunAndTurnAcrossRestart|QueueSteerDecisionSurvivesOwnerRestart|SRDUR001AcceptedInputSurvivesOwnerCrashAsLedgerFact|SRDUR002PreparedFinishSurvivesProcessCrash)$' \
./internal/agent/runtime/session/acceptance
"""
[tasks."dev:logs"]
description = "View development logs"
run = "docker compose -f devenv/docker-compose.yml logs -f"
[tasks."dev:logs:selinux"]
description = "View development logs on SELinux systems"
run = "docker compose -f devenv/docker-compose.yml -f devenv/docker-compose.selinux.yml logs -f"
[tasks."dev:restart"]
description = "Restart a service (usage: mise run dev:restart -- server)"
depends = ["//:dev:workspace-image"]
run = "docker compose -f devenv/docker-compose.yml restart $@"
[tasks."dev:restart:selinux"]
description = "Restart a service on SELinux systems (usage: mise run dev:restart:selinux -- server)"
depends = ["//:dev:workspace-image"]
run = "docker compose -f devenv/docker-compose.yml -f devenv/docker-compose.selinux.yml restart $@"
[tasks."bridge:build"]
description = "Manually rebuild bridge binary in dev container (normally auto-triggered by air)"
run = """
#!/bin/bash
set -e
docker compose -f devenv/docker-compose.yml exec server \
sh -c 'cd /workspace && sh devenv/bridge-build.sh'
"""
[tasks."bridge:build:selinux"]
description = "Manually rebuild bridge binary in SELinux dev container"
run = """
#!/bin/bash
set -e
docker compose -f devenv/docker-compose.yml -f devenv/docker-compose.selinux.yml exec server \
sh -c 'cd /workspace && sh devenv/bridge-build.sh'
"""
[tasks."bridge:mtls:gen"]
description = "Generate strict bridge mTLS material (usage: mise run bridge:mtls:gen -- -instance-id <uuid> -out data/bridge-mtls)"
run = "scripts/gen-bridge-mtls.sh"
[tasks.db-up]
description = "Initialize and Migrate Database"
run = "scripts/db-up.sh"
[tasks.db-down]
description = "Drop Database"
run = "scripts/db-drop.sh"
[tasks.release]
description = "Release new version"
run = "pnpm release"
[tasks.build-embedded-assets]
description = "Build and stage embedded web assets"
run = "scripts/release.sh --prepare-assets"
depends = ["//:pnpm-install"]
[tasks.install-socktainer]
description = "Install socktainer"
run = "brew tap socktainer/tap && brew install socktainer"
[tasks."a11y-cli:build"]
description = "Build the a11y-cli AT-SPI helper for the workspace runtime (Linux musl static)"
run = """
#!/bin/bash
# Builds crates/a11y-cli into a static musl Linux ELF so it runs on any
# workspace container regardless of glibc version (Debian Bookworm, Alpine,
# etc). Building against a newer glibc would fail at runtime with
# `version 'GLIBC_2.XX' not found`.
set -euo pipefail
case "$(uname -m)" in
x86_64) HOST_ARCH=amd64; PLATFORM=linux/amd64; MUSL_TARGET=x86_64-unknown-linux-musl ;;
aarch64|arm64) HOST_ARCH=arm64; PLATFORM=linux/arm64; MUSL_TARGET=aarch64-unknown-linux-musl ;;
*) echo "ERROR: unsupported architecture: $(uname -m)" >&2; exit 1 ;;
esac
if [ "$(uname -s)" = "Linux" ]; then
rustup target add "$MUSL_TARGET" >/dev/null 2>&1 || true
cargo build --release --target "$MUSL_TARGET" -p a11y-cli
echo "a11y-cli built at target/$MUSL_TARGET/release/a11y-cli (host)"
exit 0
fi
if ! command -v docker >/dev/null 2>&1; then
echo "ERROR: building a11y-cli on non-Linux hosts requires Docker." >&2
exit 1
fi
CARGO_HOME_HOST="${CARGO_HOME:-$HOME/.cargo}"
mkdir -p "$CARGO_HOME_HOST/registry" "$CARGO_HOME_HOST/git" target/linux
echo "Cross-building a11y-cli for $PLATFORM via rust:1.90-alpine (musl static)..."
docker run --rm \\
--platform "$PLATFORM" \\
-v "$(pwd):/work" \\
-v "$CARGO_HOME_HOST/registry:/usr/local/cargo/registry" \\
-v "$CARGO_HOME_HOST/git:/usr/local/cargo/git" \\
-w /work \\
-e CARGO_TARGET_DIR=/work/target/linux \\
rust:1.90-alpine \\
sh -eu -c 'apk add --no-cache musl-dev && cargo build --release -p a11y-cli'
echo "a11y-cli built at target/linux/release/a11y-cli ($HOST_ARCH, musl static)"
"""
[tasks."a11y-cli:check"]
description = "Type-check the a11y-cli crate"
run = "cargo check -p a11y-cli"
[tasks."docker:workspace:build"]
description = "Build the canonical Debian workspace image"
run = "docker build --target workspace -f docker/Dockerfile.workspace -t memohai/workspace:debian ."
[tasks."dev:workspace-image"]
description = "Build and export the canonical workspace image for nested dev containerd (skipped when its inputs are unchanged)"
run = "scripts/prepare-dev-workspace-image.sh"
[tasks."dev:workspace-image:rebuild"]
description = "Force a rebuild of the dev workspace image (new base image, refreshed apt packages, ...)"
env = { MEMOH_DEV_WORKSPACE_IMAGE_FORCE = "1" }
run = "scripts/prepare-dev-workspace-image.sh"
[tasks.lint]
description = "Run all linters"
env = { CI = "true", MISE_YES = "1" }
run = [
"mise run lint:contract",
"mise run lint:settings-rows",
"mise run lint:es",
"mise run lint:go",
]
[tasks."lint:contract"]
description = "UI design-contract guard (disabled opacity, radius tokens, type scale)"
run = "node scripts/check-ui-contract.mjs"
[tasks."lint:settings-rows"]
description = "Settings row guard (rows inside a list, no hand-written card inset); needs pnpm install"
run = "node scripts/check-settings-rows.mjs"
[tasks."lint:fix"]
description = "Run all linters with auto-fix"
env = { CI = "true", MISE_YES = "1" }
run = [
"mise run lint:es:fix",
"mise run lint:go:fix",
]
[tasks."lint:go"]
description = "Run Go linter"
depends = ["//:go-install"]
run = "golangci-lint run ./..."
[tasks."lint:go:fix"]
description = "Run Go linter with auto-fix"
depends = ["//:go-install"]
run = "golangci-lint run --fix ./..."
[tasks."lint:clean"]
description = "Clear linter caches"
run = """
#!/bin/bash
set -e
golangci-lint cache clean
# Clear ESLint cache if it exists (ESLint 9 default is usually no cache unless enabled)
find . -name ".eslintcache" -delete
echo '✓ Linter caches cleared'
"""
[tasks."lint:es"]
description = "Run ESLint"
run = "pnpm lint"
[tasks."lint:es:fix"]
description = "Run ESLint with auto-fix"
run = "pnpm lint:fix"
[tasks.setup]
description = "Setup development environment"
depends = [
"//:sqlc-generate",
"//:pnpm-install",
"//:go-install",
]
run = """
#!/bin/bash
set -e
echo '✓ Setup complete! Run: mise run dev'
echo ' Dev web UI will be available at http://localhost:18082'
"""
[tasks."desktop:dev"]
description = "Start Electron desktop app in dev mode"
dir = "{{config_root}}/apps/desktop"
run = """
#!/bin/bash
set -euo pipefail
pnpm dev
"""
[tasks."desktop:preview"]
description = "Run the Electron desktop app against the production renderer bundle (no dev server / HMR)"
dir = "{{config_root}}/apps/desktop"
run = "pnpm preview"
[tasks."desktop:build"]
description = "Build Electron desktop app for release (electron-builder)"
dir = "{{config_root}}/apps/desktop"
run = "pnpm build"
[tasks."desktop:build:mac:arm64"]
description = "Build signed-capable macOS arm64 desktop artifacts"
dir = "{{config_root}}/apps/desktop"
run = "pnpm build:mac:arm64"
[tasks."desktop:build:mac:x64"]
description = "Build signed-capable macOS x64 desktop artifacts"
dir = "{{config_root}}/apps/desktop"
run = "pnpm build:mac:x64"
[tasks."desktop:build:linux:x64"]
description = "Build Linux x64 desktop artifacts"
dir = "{{config_root}}/apps/desktop"
run = "pnpm build:linux:x64"
[tasks."desktop:build:win:x64"]
description = "Build Windows x64 desktop artifacts"
dir = "{{config_root}}/apps/desktop"
run = "pnpm build:win:x64"
[tasks."desktop:build:dir"]
description = "Build unpacked Electron desktop app"
dir = "{{config_root}}/apps/desktop"
run = "pnpm build:dir"