Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Added optional `visibility` parameter to `/api/chat/blocking` endpoint and MCP `ask_codebase` tool to allow controlling chat session visibility in shared environments. [#903](https://github.com/sourcebot-dev/sourcebot/pull/903)
- Added `defaultBranch`, `isFork`, and `isArchived` fields to the `/api/repos` endpoint response and MCP `list_repos` tool. [#905](https://github.com/sourcebot-dev/sourcebot/pull/905)

## [4.11.1] - 2026-02-18

Expand Down
1 change: 1 addition & 0 deletions packages/mcp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Added optional `visibility` parameter to `ask_codebase` tool to allow controlling chat session visibility in shared environments. [#903](https://github.com/sourcebot-dev/sourcebot/pull/903)
- Added `defaultBranch`, `isFork`, and `isArchived` fields to the `list_repos` tool response. [#905](https://github.com/sourcebot-dev/sourcebot/pull/905)

## [1.0.16] - 2026-02-10

Expand Down
3 changes: 3 additions & 0 deletions packages/mcp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ server.tool(
name: repo.repoName,
url: repo.webUrl,
pushedAt: repo.pushedAt,
defaultBranch: repo.defaultBranch,
isFork: repo.isFork,
isArchived: repo.isArchived,
})),
totalCount: result.totalCount,
})
Expand Down
3 changes: 3 additions & 0 deletions packages/mcp/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ export const repositoryQuerySchema = z.object({
imageUrl: z.string().optional(),
indexedAt: z.coerce.date().optional(),
pushedAt: z.coerce.date().optional(),
defaultBranch: z.string().optional(),
isFork: z.boolean(),
isArchived: z.boolean(),
});

export const listReposResponseSchema = repositoryQuerySchema.array();
Expand Down
11 changes: 7 additions & 4 deletions packages/web/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import InviteUserEmail from "./emails/inviteUserEmail";
import JoinRequestApprovedEmail from "./emails/joinRequestApprovedEmail";
import JoinRequestSubmittedEmail from "./emails/joinRequestSubmittedEmail";
import { AGENTIC_SEARCH_TUTORIAL_DISMISSED_COOKIE_NAME, MOBILE_UNSUPPORTED_SPLASH_SCREEN_DISMISSED_COOKIE_NAME, SINGLE_TENANT_ORG_DOMAIN, SOURCEBOT_GUEST_USER_ID, SOURCEBOT_SUPPORT_EMAIL } from "./lib/constants";
import { orgDomainSchema, orgNameSchema, repositoryQuerySchema } from "./lib/schemas";
import { ApiKeyPayload, TenancyMode } from "./lib/types";
import { orgDomainSchema, orgNameSchema } from "./lib/schemas";
import { ApiKeyPayload, RepositoryQuery, TenancyMode } from "./lib/types";
import { withAuthV2, withOptionalAuthV2 } from "./withAuthV2";
import { getBrowsePath } from "./app/[domain]/browse/hooks/utils";

Expand Down Expand Up @@ -479,7 +479,7 @@ export const getRepos = async ({

const baseUrl = env.AUTH_URL;

return repos.map((repo) => repositoryQuerySchema.parse({
return repos.map((repo) => ({
codeHostType: repo.external_codeHostType,
repoId: repo.id,
repoName: repo.name,
Expand All @@ -494,7 +494,10 @@ export const getRepos = async ({
imageUrl: repo.imageUrl ?? undefined,
indexedAt: repo.indexedAt ?? undefined,
pushedAt: repo.pushedAt ?? undefined,
}))
defaultBranch: repo.defaultBranch ?? undefined,
isFork: repo.isFork,
isArchived: repo.isArchived,
} satisfies RepositoryQuery))
}));

/**
Expand Down
10 changes: 6 additions & 4 deletions packages/web/src/app/api/(server)/repos/listReposApi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { sew } from "@/actions";
import { repositoryQuerySchema } from "@/lib/schemas";
import { ListReposQueryParams } from "@/lib/types";
import { ListReposQueryParams, RepositoryQuery } from "@/lib/types";
import { withOptionalAuthV2 } from "@/withAuthV2";
import { getBrowsePath } from "@/app/[domain]/browse/hooks/utils";
import { env } from "@sourcebot/shared";
Expand Down Expand Up @@ -34,7 +33,7 @@ export const listRepos = async ({ query, page, perPage, sort, direction }: ListR
]);

return {
data: repos.map((repo) => repositoryQuerySchema.parse({
data: repos.map((repo) => ({
codeHostType: repo.external_codeHostType,
repoId: repo.id,
repoName: repo.name,
Expand All @@ -49,7 +48,10 @@ export const listRepos = async ({ query, page, perPage, sort, direction }: ListR
imageUrl: repo.imageUrl ?? undefined,
indexedAt: repo.indexedAt ?? undefined,
pushedAt: repo.pushedAt ?? undefined,
})),
defaultBranch: repo.defaultBranch ?? undefined,
isFork: repo.isFork,
isArchived: repo.isArchived,
} satisfies RepositoryQuery)),
totalCount,
};
})
Expand Down
3 changes: 3 additions & 0 deletions packages/web/src/lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export const repositoryQuerySchema = z.object({
imageUrl: z.string().optional(),
indexedAt: z.coerce.date().optional(),
pushedAt: z.coerce.date().optional(),
defaultBranch: z.string().optional(),
isFork: z.boolean(),
isArchived: z.boolean(),
});

export const searchContextQuerySchema = z.object({
Expand Down