Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
333f152
build: add @duckdb/node-api and recharts dependencies
ThomasK33 Feb 21, 2026
a19f957
feat(analytics): add Zod schemas for analytics oRPC contract
ThomasK33 Feb 21, 2026
f846826
Add DuckDB analytics backend and ORPC wiring
ThomasK33 Feb 21, 2026
4987fb9
πŸ€– feat: add analytics dashboard frontend
ThomasK33 Feb 21, 2026
7f03bba
fix: resolve OPEN_ANALYTICS keybind collision with CYCLE_AGENT
ThomasK33 Feb 21, 2026
28804da
build: update flake.nix hash for new dependencies
ThomasK33 Feb 21, 2026
7f9a8ba
fix: address Codex review feedback
ThomasK33 Feb 21, 2026
d0f0a0a
fix: address Codex review round 2
ThomasK33 Feb 21, 2026
e95de73
fix: address Codex review round 3
ThomasK33 Feb 21, 2026
02dc14f
fix: address Codex review round 4
ThomasK33 Feb 21, 2026
58f61cf
fix: UTC-aware date-only bucket label formatting
ThomasK33 Feb 21, 2026
06aebfb
Add populated analytics dashboard Storybook story
ThomasK33 Feb 21, 2026
c4e55ff
fix: refresh rewritten analytics rows and split postinstall rebuild g…
ThomasK33 Feb 21, 2026
7945de1
Fix analytics ETL rewind handling and TTFT extraction
ThomasK33 Feb 21, 2026
3be7930
Fix analytics ETL rebuild on sequence regression
ThomasK33 Feb 21, 2026
a8d046f
Fix analytics ETL truncation rebuild detection
ThomasK33 Feb 21, 2026
b66cc64
Fix analytics ETL sequence regression detection
ThomasK33 Feb 21, 2026
c8c97f6
analytics: base rebuild regression on parsed max sequence
ThomasK33 Feb 21, 2026
854ebcc
Detect ETL head mismatch when assistant history shifts
ThomasK33 Feb 21, 2026
a85256d
Clear analytics state when chat history is missing
ThomasK33 Feb 21, 2026
b6a81e7
πŸ€– fix: clear analytics for deleted workspaces and UTC today spend
ThomasK33 Feb 21, 2026
2611d8e
Fix analytics workspace clear bootstrap and bucket time parsing
ThomasK33 Feb 21, 2026
ffcbb0b
fix: accept callable ORPC analytics namespace proxies
ThomasK33 Feb 21, 2026
ec6aef6
test: cover useAnalyticsSummary with real ORPC client
ThomasK33 Feb 21, 2026
90aaae6
Serialize analytics worker tasks and gate startup backfill
ThomasK33 Feb 21, 2026
1c27eb2
Fix analytics rebuild gating and metadata backfill
ThomasK33 Feb 21, 2026
c1bd5ba
Fix needsBackfill split-brain handling
ThomasK33 Feb 21, 2026
90c4889
Apply analytics date range across all dashboard queries
ThomasK33 Feb 21, 2026
77fbe2c
fix: clear deleted workspace analytics when persisted DB exists
ThomasK33 Feb 21, 2026
5091ae8
fix: persist ttftMs in finalized assistant metadata
ThomasK33 Feb 22, 2026
2309b43
feat: add provider cache-hit ratio analytics chart
ThomasK33 Feb 22, 2026
dcda582
test: fix require-await in streamManager TTFT mocks
ThomasK33 Feb 22, 2026
41946ba
fix: avoid analytics rebuild loops when watermarks exist
ThomasK33 Feb 22, 2026
4c9a5a7
Fix spend-by-model chart text contrast in dark theme
ThomasK33 Feb 22, 2026
3eebc23
Retry startup analytics backfill when initialization is partial
ThomasK33 Feb 22, 2026
6ad6cda
Fix startup backfill when watermarks are missing
ThomasK33 Feb 22, 2026
460b4b2
Make analytics rebuildAll reset transactional
ThomasK33 Feb 22, 2026
4f57879
Fix lint issues in analytics ETL tests
ThomasK33 Feb 22, 2026
0e689fa
fix analytics startup backfill for wiped events
ThomasK33 Feb 22, 2026
398ab9f
πŸ€– fix: gate startup backfill on workspace watermark IDs
ThomasK33 Feb 22, 2026
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ mobile/node_modules/.installed: mobile/package.json mobile/bun.lock
ensure-deps: node_modules/.installed

# Rebuild native modules for Electron
rebuild-native: node_modules/.installed ## Rebuild native modules (node-pty) for Electron
rebuild-native: node_modules/.installed ## Rebuild native modules (node-pty, DuckDB) for Electron
@echo "Rebuilding native modules for Electron..."
@npx @electron/rebuild -f -m node_modules/node-pty
@npx @electron/rebuild -f -m node_modules/@duckdb/node-bindings
@echo "Native modules rebuilt successfully"

# Run compiled CLI with trailing arguments (builds only if missing)
Expand Down
34 changes: 34 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

outputHashMode = "recursive";
# Marker used by scripts/update_flake_hash.sh to update this hash in place.
outputHash = "sha256-+6o2twg8KOUBuq2RoEqY/OwqCnWSrUiXFuaeLUiuF3k="; # mux-offline-cache-hash
outputHash = "sha256-XSh54hSydWb3fnA52vMJfh7zmEBsP+JHKZgIh6EzjYU="; # mux-offline-cache-hash
};

configurePhase = ''
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@duckdb/node-api": "^1.4.4-r.1",
"@homebridge/ciao": "^1.3.4",
"@jitl/quickjs-wasmfile-release-asyncify": "^0.31.0",
"@lydell/node-pty": "1.1.0",
Expand Down Expand Up @@ -117,6 +118,7 @@
"react-colorful": "^5.6.1",
"react-resizable-panels": "^3.0.6",
"react-router-dom": "^7.11.0",
"recharts": "^2.15.3",
"rehype-harden": "^1.1.5",
"rehype-sanitize": "^6.0.0",
"remark-breaks": "^4.0.0",
Expand Down Expand Up @@ -272,7 +274,8 @@
"asarUnpack": [
"dist/**/*.wasm",
"dist/**/*.map",
"**/node_modules/node-pty/build/**/*"
"**/node_modules/node-pty/build/**/*",
"**/node_modules/@duckdb/**/*.node"
],
"mac": {
"category": "public.app-category.developer-tools",
Expand Down
1 change: 1 addition & 0 deletions scripts/check_eager_imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ BANNED_IMPORTS=(
"@ai-sdk/anthropic"
"@ai-sdk/openai"
"@ai-sdk/google"
"@duckdb/node-api"
"ai"
)

Expand Down
95 changes: 66 additions & 29 deletions scripts/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
ELECTRON_PATH="$PROJECT_ROOT/node_modules/electron"
NODE_PTY_PATH="$PROJECT_ROOT/node_modules/node-pty"
DUCKDB_NODE_API_PATH="$PROJECT_ROOT/node_modules/@duckdb/node-api"
DUCKDB_NODE_BINDINGS_PATH="$PROJECT_ROOT/node_modules/@duckdb/node-bindings"

# 1) Skip in headless/benchmark mode (no Electron UI needed)
if [ "${MUX_HEADLESS:-}" = "1" ]; then
Expand All @@ -26,58 +28,93 @@ if [ "${INIT_CWD:-$PROJECT_ROOT}" != "$PROJECT_ROOT" ]; then
exit 0
fi

# 3) Skip if Electron or node-pty aren't installed
if [ ! -d "$ELECTRON_PATH" ] || [ ! -d "$NODE_PTY_PATH" ]; then
echo "🌐 Server mode detected or Electron/node-pty missing – skipping native rebuild"
# 3) Skip when Electron is unavailable (server mode install)
if [ ! -d "$ELECTRON_PATH" ]; then
echo "🌐 Server mode detected (Electron missing) – skipping native rebuild"
exit 0
fi

# 4) Build a cache key (Electron version + node-pty version + platform + arch)
HAS_NODE_PTY=0
if [ -d "$NODE_PTY_PATH" ]; then
HAS_NODE_PTY=1
fi

HAS_DUCKDB=0
if [ -d "$DUCKDB_NODE_API_PATH" ] && [ -d "$DUCKDB_NODE_BINDINGS_PATH" ]; then
HAS_DUCKDB=1
fi

if [ "$HAS_NODE_PTY" = "0" ] && [ "$HAS_DUCKDB" = "0" ]; then
echo "🌐 Native modules missing – skipping native rebuild"
exit 0
fi

# 4) Build cache keys (Electron version + native module versions + platform + arch)
ELECTRON_VERSION="$(
node -p "require('${ELECTRON_PATH}/package.json').version" 2>/dev/null || echo "unknown"
)"
NODE_PTY_VERSION="$(
node -p "require('${NODE_PTY_PATH}/package.json').version" 2>/dev/null || echo "unknown"
)"
DUCKDB_VERSION="$(
node -p "require('${DUCKDB_NODE_API_PATH}/package.json').version" 2>/dev/null || echo "unknown"
)"

PLATFORM="$(uname -s 2>/dev/null || echo unknown)"
ARCH="$(uname -m 2>/dev/null || echo unknown)"

STAMP_DIR="$PROJECT_ROOT/node_modules/.cache/mux-native"
STAMP_FILE="$STAMP_DIR/node-pty-${ELECTRON_VERSION}-${NODE_PTY_VERSION}-${PLATFORM}-${ARCH}.stamp"
NODE_PTY_STAMP_FILE="$STAMP_DIR/node-pty-${ELECTRON_VERSION}-${NODE_PTY_VERSION}-${PLATFORM}-${ARCH}.stamp"
DUCKDB_STAMP_FILE="$STAMP_DIR/duckdb-${ELECTRON_VERSION}-${DUCKDB_VERSION}-${PLATFORM}-${ARCH}.stamp"

mkdir -p "$STAMP_DIR"

# 5) Skip if we've already rebuilt for this combo
if [ -f "$STAMP_FILE" ]; then
echo "βœ… node-pty already rebuilt for Electron ${ELECTRON_VERSION} on ${PLATFORM}/${ARCH} – skipping"
exit 0
fi

echo "πŸ”§ Rebuilding node-pty for Electron ${ELECTRON_VERSION} on ${PLATFORM}/${ARCH}..."

# 6) Run rebuild
# 5) Resolve rebuild command
if command -v npx >/dev/null 2>&1; then
npx @electron/rebuild -f -m node_modules/node-pty || {
echo "⚠️ Failed to rebuild native modules"
echo " Terminal functionality may not work in desktop mode."
echo " Run 'make rebuild-native' manually to fix."
exit 0
}
REBUILD_CMD="npx"
elif command -v bunx >/dev/null 2>&1; then
bunx @electron/rebuild -f -m node_modules/node-pty || {
echo "⚠️ Failed to rebuild native modules"
echo " Terminal functionality may not work in desktop mode."
echo " Run 'make rebuild-native' manually to fix."
exit 0
}
REBUILD_CMD="bunx"
else
echo "⚠️ Neither npx nor bunx found - cannot rebuild native modules"
echo " Terminal functionality may not work in desktop mode."
echo " Run 'make rebuild-native' manually to fix."
exit 0
fi

# 7) Mark this combo as done
touch "$STAMP_FILE"
echo "βœ… Native modules rebuilt successfully (cached at $STAMP_FILE)"
# 6) Rebuild node-pty (once per version/platform)
if [ "$HAS_NODE_PTY" = "1" ]; then
if [ -f "$NODE_PTY_STAMP_FILE" ]; then
echo "βœ… node-pty already rebuilt for Electron ${ELECTRON_VERSION} on ${PLATFORM}/${ARCH} – skipping"
else
echo "πŸ”§ Rebuilding node-pty for Electron ${ELECTRON_VERSION} on ${PLATFORM}/${ARCH}..."
$REBUILD_CMD @electron/rebuild -f -m node_modules/node-pty || {
echo "⚠️ Failed to rebuild native modules"
echo " Terminal functionality may not work in desktop mode."
echo " Run 'make rebuild-native' manually to fix."
exit 0
}
touch "$NODE_PTY_STAMP_FILE"
echo "βœ… node-pty rebuilt successfully (cached at $NODE_PTY_STAMP_FILE)"
fi
else
echo "ℹ️ node-pty package missing – skipping node-pty rebuild"
fi

# 7) Rebuild DuckDB (once per version/platform)
if [ "$HAS_DUCKDB" = "1" ]; then
if [ -f "$DUCKDB_STAMP_FILE" ]; then
echo "βœ… DuckDB already rebuilt for Electron ${ELECTRON_VERSION} on ${PLATFORM}/${ARCH} – skipping"
else
echo "πŸ”§ Rebuilding DuckDB for Electron ${ELECTRON_VERSION} on ${PLATFORM}/${ARCH}..."
$REBUILD_CMD @electron/rebuild -f -m node_modules/@duckdb/node-bindings || {
echo "⚠️ Failed to rebuild native modules"
echo " Terminal functionality may not work in desktop mode."
echo " Run 'make rebuild-native' manually to fix."
exit 0
}
touch "$DUCKDB_STAMP_FILE"
echo "βœ… DuckDB rebuilt successfully (cached at $DUCKDB_STAMP_FILE)"
fi
else
echo "ℹ️ DuckDB packages missing – skipping DuckDB rebuild"
fi
Loading
Loading