Skip to content

Commit e3c7ff9

Browse files
committed
feat: major codebase update — Instructor integration, Inngest setup, frontend cleanup
- Add structured LLM service (Instructor + Pydantic) and agent schemas - Add Inngest client and function scaffolding for async workflows - Remove Dramatiq worker (Dockerfile.worker, worker_entrypoint, worker_service) - Clean up frontend: remove unused components, hooks, and API modules - Add lint CI workflow and Makefile - Update dependencies (backend pyproject.toml, frontend package.json) - Misc fixes across agent tools, billing, composio, and sandbox modules
1 parent 4aeb976 commit e3c7ff9

File tree

355 files changed

+23401
-35940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

355 files changed

+23401
-35940
lines changed

.github/workflows/docker-build.yml

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,13 @@ jobs:
5050
cache-from: type=gha
5151
cache-to: type=gha,mode=max
5252

53-
- name: build and push worker image
54-
uses: docker/build-push-action@v5
55-
with:
56-
context: ./backend
57-
file: ./backend/Dockerfile.worker
58-
push: true
59-
platforms: linux/amd64
60-
tags: ${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/worker:latest
61-
cache-from: type=gha
62-
cache-to: type=gha,mode=max
63-
6453
- name: deploy api to cloud run
6554
run: |
55+
# --allow-unauthenticated is intentional:
56+
# Traffic flows CF Worker proxy -> Cloud Run. App-layer JWT auth (Clerk)
57+
# handles user authentication. Cloud Run IAM auth would require the
58+
# CF Worker to carry a service account key, adding complexity without
59+
# security benefit since every endpoint already validates JWTs.
6660
gcloud run deploy cheatcode-api \
6761
--project=${{ env.PROJECT_ID }} \
6862
--region=${{ env.REGION }} \
@@ -80,27 +74,5 @@ jobs:
8074
--subnet=default \
8175
--vpc-egress=private-ranges-only \
8276
--service-account=cheatcode-api@${{ env.PROJECT_ID }}.iam.gserviceaccount.com \
83-
--set-secrets="REDIS_URL=REDIS_URL:latest,ANTHROPIC_API_KEY=ANTHROPIC_API_KEY:latest,OPENAI_API_KEY=OPENAI_API_KEY:latest,OPENROUTER_API_KEY=OPENROUTER_API_KEY:latest,SUPABASE_URL=SUPABASE_URL:latest,SUPABASE_ANON_KEY=SUPABASE_ANON_KEY:latest,SUPABASE_SERVICE_ROLE_KEY=SUPABASE_SERVICE_ROLE_KEY:latest,CLERK_SECRET_KEY=CLERK_SECRET_KEY:latest,CLERK_DOMAIN=CLERK_DOMAIN:latest,POLAR_ACCESS_TOKEN=POLAR_ACCESS_TOKEN:latest,POLAR_ORGANIZATION_ID=POLAR_ORGANIZATION_ID:latest,POLAR_PRODUCT_ID_PRO=POLAR_PRODUCT_ID_PRO:latest,POLAR_PRODUCT_ID_PREMIUM=POLAR_PRODUCT_ID_PREMIUM:latest,POLAR_PRODUCT_ID_BYOK=POLAR_PRODUCT_ID_BYOK:latest,DAYTONA_API_KEY=DAYTONA_API_KEY:latest,DAYTONA_SERVER_URL=DAYTONA_SERVER_URL:latest,TAVILY_API_KEY=TAVILY_API_KEY:latest,FIRECRAWL_API_KEY=FIRECRAWL_API_KEY:latest,LANGFUSE_PUBLIC_KEY=LANGFUSE_PUBLIC_KEY:latest,LANGFUSE_SECRET_KEY=LANGFUSE_SECRET_KEY:latest,MCP_CREDENTIAL_ENCRYPTION_KEY=MCP_CREDENTIAL_ENCRYPTION_KEY:latest,COMPOSIO_API_KEY=COMPOSIO_API_KEY:latest,VERCEL_BEARER_TOKEN=VERCEL_BEARER_TOKEN:latest,GOOGLE_API_KEY=GOOGLE_API_KEY:latest,MORPH_API_KEY=MORPH_API_KEY:latest,RELACE_API_KEY=RELACE_API_KEY:latest" \
84-
--set-env-vars="ENV_MODE=production,LOG_LEVEL=INFO,LANGFUSE_HOST=https://us.cloud.langfuse.com,MODEL_TO_USE=openrouter/anthropic/claude-sonnet-4,FIRECRAWL_URL=https://api.firecrawl.dev,DAYTONA_TARGET=us"
85-
86-
- name: deploy worker to cloud run
87-
run: |
88-
gcloud run deploy cheatcode-worker \
89-
--project=${{ env.PROJECT_ID }} \
90-
--region=${{ env.REGION }} \
91-
--image=${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/worker:latest \
92-
--platform=managed \
93-
--no-allow-unauthenticated \
94-
--cpu=2 \
95-
--memory=4Gi \
96-
--timeout=3500 \
97-
--min-instances=1 \
98-
--max-instances=3 \
99-
--no-cpu-throttling \
100-
--cpu-boost \
101-
--network=default \
102-
--subnet=default \
103-
--vpc-egress=private-ranges-only \
104-
--service-account=cheatcode-api@${{ env.PROJECT_ID }}.iam.gserviceaccount.com \
105-
--set-secrets="REDIS_URL=REDIS_URL:latest,ANTHROPIC_API_KEY=ANTHROPIC_API_KEY:latest,OPENAI_API_KEY=OPENAI_API_KEY:latest,OPENROUTER_API_KEY=OPENROUTER_API_KEY:latest,SUPABASE_URL=SUPABASE_URL:latest,SUPABASE_ANON_KEY=SUPABASE_ANON_KEY:latest,SUPABASE_SERVICE_ROLE_KEY=SUPABASE_SERVICE_ROLE_KEY:latest,CLERK_SECRET_KEY=CLERK_SECRET_KEY:latest,CLERK_DOMAIN=CLERK_DOMAIN:latest,POLAR_ACCESS_TOKEN=POLAR_ACCESS_TOKEN:latest,POLAR_ORGANIZATION_ID=POLAR_ORGANIZATION_ID:latest,POLAR_PRODUCT_ID_PRO=POLAR_PRODUCT_ID_PRO:latest,POLAR_PRODUCT_ID_PREMIUM=POLAR_PRODUCT_ID_PREMIUM:latest,POLAR_PRODUCT_ID_BYOK=POLAR_PRODUCT_ID_BYOK:latest,DAYTONA_API_KEY=DAYTONA_API_KEY:latest,DAYTONA_SERVER_URL=DAYTONA_SERVER_URL:latest,TAVILY_API_KEY=TAVILY_API_KEY:latest,FIRECRAWL_API_KEY=FIRECRAWL_API_KEY:latest,LANGFUSE_PUBLIC_KEY=LANGFUSE_PUBLIC_KEY:latest,LANGFUSE_SECRET_KEY=LANGFUSE_SECRET_KEY:latest,MCP_CREDENTIAL_ENCRYPTION_KEY=MCP_CREDENTIAL_ENCRYPTION_KEY:latest,COMPOSIO_API_KEY=COMPOSIO_API_KEY:latest,VERCEL_BEARER_TOKEN=VERCEL_BEARER_TOKEN:latest,GOOGLE_API_KEY=GOOGLE_API_KEY:latest,MORPH_API_KEY=MORPH_API_KEY:latest,RELACE_API_KEY=RELACE_API_KEY:latest" \
77+
--set-secrets="REDIS_URL=REDIS_URL:latest,ANTHROPIC_API_KEY=ANTHROPIC_API_KEY:latest,OPENAI_API_KEY=OPENAI_API_KEY:latest,OPENROUTER_API_KEY=OPENROUTER_API_KEY:latest,SUPABASE_URL=SUPABASE_URL:latest,SUPABASE_ANON_KEY=SUPABASE_ANON_KEY:latest,SUPABASE_SERVICE_ROLE_KEY=SUPABASE_SERVICE_ROLE_KEY:latest,CLERK_SECRET_KEY=CLERK_SECRET_KEY:latest,CLERK_DOMAIN=CLERK_DOMAIN:latest,POLAR_ACCESS_TOKEN=POLAR_ACCESS_TOKEN:latest,POLAR_ORGANIZATION_ID=POLAR_ORGANIZATION_ID:latest,POLAR_PRODUCT_ID_PRO=POLAR_PRODUCT_ID_PRO:latest,POLAR_PRODUCT_ID_PREMIUM=POLAR_PRODUCT_ID_PREMIUM:latest,POLAR_PRODUCT_ID_BYOK=POLAR_PRODUCT_ID_BYOK:latest,DAYTONA_API_KEY=DAYTONA_API_KEY:latest,DAYTONA_SERVER_URL=DAYTONA_SERVER_URL:latest,TAVILY_API_KEY=TAVILY_API_KEY:latest,FIRECRAWL_API_KEY=FIRECRAWL_API_KEY:latest,LANGFUSE_PUBLIC_KEY=LANGFUSE_PUBLIC_KEY:latest,LANGFUSE_SECRET_KEY=LANGFUSE_SECRET_KEY:latest,MCP_CREDENTIAL_ENCRYPTION_KEY=MCP_CREDENTIAL_ENCRYPTION_KEY:latest,COMPOSIO_API_KEY=COMPOSIO_API_KEY:latest,VERCEL_BEARER_TOKEN=VERCEL_BEARER_TOKEN:latest,GOOGLE_API_KEY=GOOGLE_API_KEY:latest,MORPH_API_KEY=MORPH_API_KEY:latest,RELACE_API_KEY=RELACE_API_KEY:latest,INNGEST_EVENT_KEY=INNGEST_EVENT_KEY:latest,INNGEST_SIGNING_KEY=INNGEST_SIGNING_KEY:latest" \
10678
--set-env-vars="ENV_MODE=production,LOG_LEVEL=INFO,LANGFUSE_HOST=https://us.cloud.langfuse.com,MODEL_TO_USE=openrouter/anthropic/claude-sonnet-4,FIRECRAWL_URL=https://api.firecrawl.dev,DAYTONA_TARGET=us"

.github/workflows/lint.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Lint & Format Check
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: lint-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint-backend:
15+
name: Backend (Ruff)
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
working-directory: backend
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v4
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.11"
30+
31+
- name: Install dependencies
32+
run: uv sync --group dev --frozen
33+
34+
- name: Ruff lint
35+
run: uv run ruff check . --output-format=github
36+
37+
- name: Ruff format check
38+
run: uv run ruff format . --check
39+
40+
lint-frontend:
41+
name: Frontend (ESLint + Prettier)
42+
runs-on: ubuntu-latest
43+
defaults:
44+
run:
45+
working-directory: frontend
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Set up Node.js
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: "20"
53+
cache: "npm"
54+
cache-dependency-path: frontend/package-lock.json
55+
56+
- name: Install dependencies
57+
run: npm ci
58+
59+
- name: ESLint
60+
run: npx eslint src/ --max-warnings=0
61+
62+
- name: Prettier check
63+
run: npx prettier --check "src/**/*.{ts,tsx,css,json}"
64+
65+
- name: Knip (unused deps, exports, files)
66+
run: npx knip
67+
68+
build-frontend:
69+
name: Frontend Build
70+
runs-on: ubuntu-latest
71+
defaults:
72+
run:
73+
working-directory: frontend
74+
env:
75+
NEXT_PUBLIC_SUPABASE_URL: "https://placeholder.supabase.co"
76+
NEXT_PUBLIC_SUPABASE_ANON_KEY: "placeholder-anon-key"
77+
NEXT_PUBLIC_BACKEND_URL: "https://placeholder.api.com"
78+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: "pk_test_placeholder"
79+
NEXT_PUBLIC_APP_URL: "http://localhost:3000"
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Set up Node.js
84+
uses: actions/setup-node@v4
85+
with:
86+
node-version: "20"
87+
cache: "npm"
88+
cache-dependency-path: frontend/package-lock.json
89+
90+
- name: Install dependencies
91+
run: npm ci
92+
93+
- name: Build
94+
run: npm run build

Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.PHONY: lint format fix check knip
2+
3+
# ── Full check (CI-friendly, no modifications) ──
4+
check: lint-backend lint-frontend format-check-backend format-check-frontend knip
5+
@echo "All checks passed."
6+
7+
# ── Linting ──
8+
lint: lint-backend lint-frontend
9+
lint-backend:
10+
cd backend && uv run ruff check .
11+
lint-frontend:
12+
cd frontend && npx eslint src/ --max-warnings=0
13+
14+
# ── Formatting ──
15+
format: format-backend format-frontend
16+
format-backend:
17+
cd backend && uv run ruff format .
18+
format-frontend:
19+
cd frontend && npx prettier --write "src/**/*.{ts,tsx,css,json}"
20+
21+
# ── Format check (no modifications) ──
22+
format-check-backend:
23+
cd backend && uv run ruff format . --check
24+
format-check-frontend:
25+
cd frontend && npx prettier --check "src/**/*.{ts,tsx,css,json}"
26+
27+
# ── Auto-fix (applies safe fixes) ──
28+
fix: fix-backend fix-frontend
29+
fix-backend:
30+
cd backend && uv run ruff check . --fix && uv run ruff format .
31+
fix-frontend:
32+
cd frontend && npx eslint src/ --fix --max-warnings=0 && npx prettier --write "src/**/*.{ts,tsx,css,json}"
33+
34+
# ── Knip (unused files, deps, exports) ──
35+
knip:
36+
cd frontend && npx knip
37+
knip-fix:
38+
cd frontend && npx knip --fix

0 commit comments

Comments
 (0)