Skip to content

Commit 0479059

Browse files
cursoragentmsukkari
andcommitted
chore: resolve merge conflict with main
Co-authored-by: Michael Sukkarieh <msukkari@users.noreply.github.com>
2 parents 449d109 + 9e07fcd commit 0479059

File tree

153 files changed

+3646
-4254
lines changed

Some content is hidden

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

153 files changed

+3646
-4254
lines changed

.env.development

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ CONFIG_PATH=${PWD}/config.json # Path to the sourcebot config file (if one exist
4040
# Redis
4141
REDIS_URL="redis://localhost:6379"
4242

43-
# Stripe
44-
# STRIPE_SECRET_KEY: z.string().optional(),
45-
# STRIPE_PRODUCT_ID: z.string().optional(),
46-
# STRIPE_WEBHOOK_SECRET: z.string().optional(),
47-
# STRIPE_ENABLE_TEST_CLOCKS=false
48-
4943
# Agents
5044

5145
# GITHUB_APP_ID=
@@ -75,6 +69,5 @@ SOURCEBOT_TELEMETRY_DISABLED=true # Disables telemetry collection
7569

7670
# CONFIG_MAX_REPOS_NO_TOKEN=
7771
NODE_ENV=development
78-
# SOURCEBOT_TENANCY_MODE=single
7972

8073
DEBUG_WRITE_CHAT_MESSAGES_TO_FILE=true

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111
- Updated MCP OAuth consent screen to use Sourcebot branded logo with dark/light mode support. [#1062](https://github.com/sourcebot-dev/sourcebot/pull/1062)
1212

13+
## [4.16.5] - 2026-04-02
14+
15+
### Added
16+
- Added `GET /api/commit` endpoint for retrieving details about a single commit, including parent commit SHAs [#1077](https://github.com/sourcebot-dev/sourcebot/pull/1077)
17+
18+
### Changed
19+
- Replaced placeholder avatars with deterministic minidenticon-based avatars generated from email addresses [#1072](https://github.com/sourcebot-dev/sourcebot/pull/1072)
20+
- Changed `author_name` and `author_email` fields to `authorName` and `authorEmail` in `GET /api/commits` response [#1077](https://github.com/sourcebot-dev/sourcebot/pull/1077)
21+
- Changed `oldPath` and `newPath` in `GET /api/diff` response from `"/dev/null"` to `null` for added/deleted files [#1077](https://github.com/sourcebot-dev/sourcebot/pull/1077)
22+
- Bumped `simple-git` to `3.33.0`. [#1078](https://github.com/sourcebot-dev/sourcebot/pull/1078)
23+
24+
## [4.16.4] - 2026-04-01
25+
26+
### Added
27+
- Added `GET /api/diff` endpoint for retrieving structured diffs between two git refs [#1063](https://github.com/sourcebot-dev/sourcebot/pull/1063)
28+
29+
### Fixed
30+
- Fixed `GET /api/mcp` hanging with zero bytes by returning `405 Method Not Allowed` per the MCP Streamable HTTP spec [#1064](https://github.com/sourcebot-dev/sourcebot/pull/1064)
31+
- Fixed tokens with trailing newlines breaking git clone URLs by adding `.trim()` in `getTokenFromConfig()` [#1067](https://github.com/sourcebot-dev/sourcebot/pull/1067)
32+
33+
### Removed
34+
- Removed "general" settings page with options to change organization name and domain. [#1065](https://github.com/sourcebot-dev/sourcebot/pull/1065)
35+
36+
### Changed
37+
- Changed the analytics and license settings pages to only be viewable by organization owners. [#1065](https://github.com/sourcebot-dev/sourcebot/pull/1065)
38+
1339
## [4.16.3] - 2026-03-27
1440

1541
### Added

CLAUDE.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ className="border-[var(--border)] bg-[var(--card)] text-[var(--foreground)]"
7171

7272
## API Route Handlers
7373

74+
When implementing a new API route, ask the user whether it should be part of the public API. If yes:
75+
76+
1. Add the request/response Zod schemas to `packages/web/src/openapi/publicApiSchemas.ts`, calling `.openapi('SchemaName')` on each schema to register it with a name.
77+
2. Register the route in `packages/web/src/openapi/publicApiDocument.ts` using `registry.registerPath(...)`, assigning it to the appropriate tag.
78+
3. Add the endpoint to the relevant group in the `API Reference` tab of `docs/docs.json`.
79+
4. Regenerate the OpenAPI spec by running `yarn workspace @sourcebot/web openapi:generate`.
80+
7481
Route handlers should validate inputs using Zod schemas.
7582

7683
**Query parameters** (GET requests):
@@ -148,11 +155,11 @@ Server actions should be used for mutations (POST/PUT/DELETE operations), not fo
148155

149156
## Authentication
150157

151-
Use `withAuthV2` or `withOptionalAuthV2` from `@/withAuthV2` to protect server actions and API routes.
158+
Use `withAuth` or `withOptionalAuth` from `@/middleware/withAuth` to protect server actions and API routes.
152159

153-
- **`withAuthV2`** - Requires authentication. Returns `notAuthenticated()` if user is not logged in.
154-
- **`withOptionalAuthV2`** - Allows anonymous access if the org has anonymous access enabled. `user` may be `undefined`.
155-
- **`withMinimumOrgRole`** - Wrap inside auth context to require a minimum role (e.g., `OrgRole.OWNER`).
160+
- **`withAuth`** - Requires authentication. Returns `notAuthenticated()` if user is not logged in.
161+
- **`withOptionalAuth`** - Allows anonymous access if the org has anonymous access enabled. `user` may be `undefined`.
162+
- **`withMinimumOrgRole`** - Wrap inside auth context to require a minimum role (e.g., `OrgRole.OWNER`). Import from `@/middleware/withMinimumOrgRole`.
156163

157164
**Important:** Always use the `prisma` instance provided by the auth context. This instance has `userScopedPrismaClientExtension` applied, which enforces repository visibility rules (e.g., filtering repos based on user permissions). Do NOT import `prisma` directly from `@/prisma` in actions or routes that return data to the client.
158165

@@ -161,19 +168,19 @@ Use `withAuthV2` or `withOptionalAuthV2` from `@/withAuthV2` to protect server a
161168
```ts
162169
'use server';
163170

164-
import { sew } from "@/actions";
165-
import { withAuthV2 } from "@/withAuthV2";
171+
import { sew } from "@/middleware/sew";
172+
import { withAuth } from "@/middleware/withAuth";
166173

167174
export const myProtectedAction = async ({ id }: { id: string }) => sew(() =>
168-
withAuthV2(async ({ org, user, prisma }) => {
175+
withAuth(async ({ org, user, prisma }) => {
169176
// user is guaranteed to be defined
170177
// prisma is scoped to the user
171178
return { success: true };
172179
})
173180
);
174181

175182
export const myPublicAction = async ({ id }: { id: string }) => sew(() =>
176-
withOptionalAuthV2(async ({ org, user, prisma }) => {
183+
withOptionalAuth(async ({ org, user, prisma }) => {
177184
// user may be undefined for anonymous access
178185
return { success: true };
179186
})
@@ -185,10 +192,10 @@ export const myPublicAction = async ({ id }: { id: string }) => sew(() =>
185192
```ts
186193
import { serviceErrorResponse } from "@/lib/serviceError";
187194
import { isServiceError } from "@/lib/utils";
188-
import { withAuthV2 } from "@/withAuthV2";
195+
import { withAuth } from "@/middleware/withAuth";
189196

190197
export const GET = apiHandler(async (request: NextRequest) => {
191-
const result = await withAuthV2(async ({ org, user, prisma }) => {
198+
const result = await withAuth(async ({ org, user, prisma }) => {
192199
// ... your logic
193200
return data;
194201
});

0 commit comments

Comments
 (0)