Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
82a90fd
start work on prototype
Feb 12, 2025
3c22613
start of prototype, gen types, sdk, tests
Feb 14, 2025
7f52a2e
added openrouter and prompt tester
Feb 18, 2025
0feef8b
start on more robust data schema and api routes
Feb 18, 2025
511776f
cursor written api endpoint tests
Feb 18, 2025
1236f29
move files around, add placeholders for bullmq, rest services
Feb 20, 2025
a8068cb
fix nextjs public folder
Feb 21, 2025
f99c067
slight adjustment to typegen cmd
Feb 21, 2025
3878107
path fixes for build passing
Feb 21, 2025
88dd504
add supabase github actions, and first migration, delete agent rest a…
Feb 21, 2025
6f479d8
fix gh actions directory
Feb 21, 2025
f870c8c
seeding and migration changes
Feb 21, 2025
e32c07f
fucking tests man
Feb 22, 2025
65cda60
add llm logs table
Feb 22, 2025
289117d
sign in with github auth
chad-syntax Feb 23, 2025
2f03d09
add tests to gh actions
chad-syntax Feb 24, 2025
5733902
try updating cli version for running tests
chad-syntax Feb 24, 2025
36d3747
try latest?
chad-syntax Feb 24, 2025
5e3b2a5
refactored openrouter implementation to work with vault and code veri…
chad-syntax Feb 25, 2025
f447d3a
add pgTAP tests for new rpc fns
chad-syntax Feb 25, 2025
347f5f9
consolidate supabase migration check and tests into one workflow
chad-syntax Feb 25, 2025
95b525f
rename workflow
chad-syntax Feb 25, 2025
14c31e0
test prompt running
chad-syntax Feb 26, 2025
558508a
change app to studio routes, add prompt pages from supabase, add llm …
chad-syntax Feb 27, 2025
a42dcdd
start onboarding logic
chad-syntax Feb 27, 2025
e2ca675
upgrade tailwind to v4, add onboarding logic
chad-syntax Feb 27, 2025
64c88b0
add org and project switcher, adjust client side context, consolidate…
chad-syntax Feb 28, 2025
cdfe8e6
refactor routes
chad-syntax Mar 1, 2025
6e27fcb
layout and context kinda fixed
chad-syntax Mar 1, 2025
5efec33
adjust prompt schema, adjust openrouter calling, fix routing on some …
chad-syntax Mar 3, 2025
5731dd3
fix ts err for now
chad-syntax Mar 3, 2025
b5fdcc1
openrouter clean up, org page listing users
chad-syntax Mar 3, 2025
a245aad
prompts pages, template extracting, component consolidation
chad-syntax Mar 4, 2025
c28ebd8
remove uneeded code
chad-syntax Mar 4, 2025
a2ce78c
prompt editorial workflow fixes
chad-syntax Mar 4, 2025
ca0d58a
add api tests
chad-syntax Mar 4, 2025
64a15ec
move util
chad-syntax Mar 4, 2025
d116169
shadcn overhaul, colors, and themes
chad-syntax Mar 5, 2025
2d7c393
refactor keys so orgs get an sdk api key on creation, allow for users…
chad-syntax Mar 7, 2025
99a402a
fix prompt config saving, add additional openrouter typing
chad-syntax Mar 7, 2025
669dc4a
finish services refactor
chad-syntax Mar 9, 2025
270920a
progress towards github repo sync
chad-syntax Mar 12, 2025
8c57535
start of sync work that was vibing so it probably doesnt work
chad-syntax Mar 13, 2025
5b6365f
refactor migration into using schemas
chad-syntax Apr 15, 2025
6a08308
remove test migration, replace initial schema migration
chad-syntax Apr 15, 2025
f869a6c
attempt to pin postgres-version because of permissions error
chad-syntax Apr 15, 2025
6f6fff3
Refactor GitHub App installation flow
chad-syntax Apr 17, 2025
2176b60
Create .prettierrc.json
chad-syntax Apr 17, 2025
f6396c1
Github App installation record flow working (still need to save and
chad-syntax Apr 18, 2025
f8e7cf8
Remove supabase declarative schemas, still kinda buggy
chad-syntax Apr 19, 2025
a8642c9
Refactor: Centralize external URLs in routes utility
chad-syntax Apr 20, 2025
4639a8f
Add GitHub repository sync functionality
chad-syntax Apr 21, 2025
a3bfffa
Enhance project connection and repository handling
chad-syntax Apr 22, 2025
2ab9145
Update project_repositories test to include default branch
chad-syntax Apr 22, 2025
5a261c6
Refactor GitHub services and update user authentication handling
chad-syntax Apr 23, 2025
3037020
Update environment configuration and enhance template variable handling
chad-syntax Apr 25, 2025
333cd64
Big GitHubSync Service refactor
chad-syntax Apr 28, 2025
66fae9a
Janky but working version of repo -> agentsmith syncing
chad-syntax Apr 28, 2025
b5ee786
complete sync service refactor
chad-syntax May 10, 2025
f05e29f
add support for global context
chad-syntax May 14, 2025
ddbf804
add erorr alert for authoring with missing globals
chad-syntax May 16, 2025
2dca68b
refactor a lot of fe component names, add studio header and hooks
chad-syntax May 18, 2025
bf65e13
styling refactors
chad-syntax May 19, 2025
c3892c5
logger refactor
chad-syntax May 19, 2025
0671464
add emoji mode
chad-syntax May 20, 2025
4311d13
fix migration ordering
chad-syntax May 20, 2025
e971580
comment out test for now
chad-syntax May 20, 2025
1308d22
adjust supabase migrations cicd yml
chad-syntax May 20, 2025
352fe0e
adjust landing styling
chad-syntax May 20, 2025
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
12 changes: 12 additions & 0 deletions .cursor/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"mcpServers": {
"supabase": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://postgres:postgres@127.0.0.1:54322/postgres"
]
}
}
}
8 changes: 8 additions & 0 deletions .cursor/rules/psql.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
description:
globs: *.sql, *.psql
alwaysApply: false
---
1. All psql should be written in lowercase syntax
2. When creating psql indices we should be as concise as we can, omitting defaults like the index name and the type. So we rather do `create index on table(column)` instead of `create idx_table_column on table using btree (column)`
3. We should add indices to columns that reference other tables and columns that are queried frequently. e.g. if the column is `slug` it will most likely be queried on that instead of `id` so we should create an index on it.
25 changes: 25 additions & 0 deletions .cursor/rules/typescript.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: These rules are helpful for contrubuting to the front-end Nextjs code and the typescript code.
globs: *.tsx, *.ts
alwaysApply: false
---

# Agentsmith tsx contributing rules for cursor AI

1. Only use named exports (`export const thing`, not `export default`)¹
2. All pages should have a single top level page component in page-components
3. All components should be in components folder either as a single file named after the component or in a subfolder named after the component¹
4. All functions should be declared in const rocket format: `const rocket = async (payload: any) => { ... }`¹
5. All props should be explicitly typed as `type ComponentProps = { ... }` and not typed inline ex: `props: { foo: any }` is bad `props: ComponentProps` is good. DO NOT deconstruct props, if a component has props, it should be named as `props` and deconstructed in the body of the component. Write `const foo = (props: FooProps) => { const { arg, arg2 } = props; }` rather than `const foo = ({ arg, arg2 }: FooProps) => {}`
6. Only use icons from `lucide-react`
7. Only use tailwind css
8. Each component file should have at most 2 react components, any more than that and it should be split up into multiple component files/folders.
9. Any links to pages that exist under the web-studio should be prefixed with /app
10. All functions that take more than 1 argument, should use an `options` syntax instead of adding many arguments. i.e. `const foo = (options: FooOptions) => {}` rather than `const foo = (bar: string, baz: string, quux: string) => {}`
11. If the response for a function is an object, then it should be typed separately rather than inline. i.e. `const foo = (): FooResult => {}` instead of `const foo = (): { foo: string; bar: string; baz: string } => {}`
12. DO NOT edit any generated files within the `__generated__` folder.
13. DO NOT create new types if they can be inferred from the supabase generated types OR can be inferred from the return of a supabase.from call using `Awaited<ReturnType><>`


¹ Exception for the Nextjs page.tsx files. They should only have one default function export.

36 changes: 36 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# FREE_MODELS_ONLY=true

NEXT_PUBLIC_SITE_URL="http://localhost:3000"

NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=

NEXT_PUBLIC_POSTHOG_KEY=
NEXT_PUBLIC_POSTHOG_HOST=

SUPABASE_AUTH_GITHUB_CLIENT_ID=
SUPABASE_AUTH_GITHUB_SECRET=

SUPABASE_JWT_SECRET=

# used for testing local dev
SMEE_WEBHOOK_PROXY_URL=

GITHUB_APP_NAME=
GITHUB_APP_ID=
GITHUB_APP_PRIVATE_KEY=
GITHUB_APP_WEBHOOK_SECRET=
GITHUB_WEBHOOK_SERVICE_USER_ID=


# TESTING TURNSTILE LOCALLY
# NEXT_PUBLIC_CF_TURNSTILE_SITE_KEY=1x00000000000000000000AA # Always passes visible
# NEXT_PUBLIC_CF_TURNSTILE_SITE_KEY=2x00000000000000000000AB # Always blocks visible
NEXT_PUBLIC_CF_TURNSTILE_SITE_KEY=1x00000000000000000000BB # Always passes invisible
# NEXT_PUBLIC_CF_TURNSTILE_SITE_KEY=2x00000000000000000000BB # Always blocks invisible
# NEXT_PUBLIC_CF_TURNSTILE_SITE_KEY=3x00000000000000000000FF # Forces an interactive challenge visible

# unused right now, but good to have in case we validate on our end
CF_TURNSTILE_SECRET_KEY=1x0000000000000000000000000000000AA # Always passes
# CF_TURNSTILE_SECRET_KEY=2x0000000000000000000000000000000AA # Always fails
# CF_TURNSTILE_SECRET_KEY=3x0000000000000000000000000000000AA # Yields a "token already spent" error
36 changes: 36 additions & 0 deletions .github/workflows/supabase_migrations_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Supabase Tests

on:
pull_request:
workflow_dispatch:

jobs:
supabase_tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- name: Overwrite Supabase db version
run: |
mkdir -p supabase/.temp
echo "15.8.1.038" > supabase/.temp/postgres-version

- name: Start Supabase local development setup
run: supabase db start

- name: Run Tests
run: supabase test db

- name: Verify generated types are checked in
run: |
supabase gen types typescript --local > types.gen.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet types.gen.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
27 changes: 27 additions & 0 deletions .github/workflows/supabase_migrations_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Push Supabase Migrations to Production

on:
push:
branches:
- main
workflow_dispatch:

jobs:
push_supabase_migrations_production:
environment: Production
runs-on: ubuntu-latest

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}

steps:
- uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase db push
27 changes: 27 additions & 0 deletions .github/workflows/supabase_migrations_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Push Supabase Migrations to Staging

on:
push:
branches:
- staging
workflow_dispatch:

jobs:
push_supabase_migrations_staging:
environment: Staging
runs-on: ubuntu-latest

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}

steps:
- uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase db push
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.13.1
22.14.0
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true
}
28 changes: 28 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# CLAUDE.md - AgentSmith Development Guidelines

## Build and Test Commands

- **Development**: `npm run dev` - Start Next.js dev server
- **Build**: `npm run build` - Build the Next.js application
- **Start**: `npm run start` - Start production server
- **Test**: `npm run test` - Run all tests with Jest
- **Test (Watch)**: `npm run test:watch` - Run tests in watch mode
- **Test Single File**: `npm run test -- -t "test name"` or `npm run test -- path/to/file.test.ts`
- **Type Generation**: `npm run typegen` - Generate Supabase TypeScript types

## Code Style Guidelines

- **Components**: Use named exports only; default exports only for Next.js page files
- **Functions**: Declare with const arrow format: `const myFunc = (params: Type) => {}`
- **Types**: Always explicitly type props as separate types, not inline
- **File Structure**:
- Components in `/components` folder with max 2 components per file
- Page components in `/page-components`
- **Imports**: Use path aliases: `@/` for src, `&/` for lib, `~/` for root
- **Naming**: PascalCase for components, camelCase for functions, kebab-case for files
- **Icons**: Only use icons from `lucide-react`
- **Styling**: Only use Tailwind CSS, no custom CSS
- **SQL**: Lowercase syntax for queries, concise index declarations with `create index concurrently`
- **Error Handling**: Use try/catch with appropriate error logging

Always follow existing patterns in the codebase.
Loading