import { giteaForUser, isLocalUser, type GiteaOrg } from "@peppa/core"; import { loadEnv } from "@peppa/shared"; import { Flash, PageHeader } from "@/components/common"; import { Hidden } from "@/components/cards"; import { Button } from "@/components/ui/button"; import { Input, Label, NativeSelect } from "@/components/ui/input"; import { Workspace } from "@/components/Workspace"; import { requireUser } from "@/lib/auth"; import { db } from "@/lib/db"; import { createProjectAction } from "../../actions"; function Choice({ name, value, checked, children }: { name: string; value: string; checked?: boolean; children: React.ReactNode }) { return ( {children} ); } export default async function NewProject({ searchParams }: { searchParams: Promise<{ error?: string }> }) { const user = await requireUser(); const { error } = await searchParams; let orgs: GiteaOrg[] = []; let giteaError: string | undefined; const giteaUrl = loadEnv().GITEA_URL.replace(/^https?:\/\//, ""); // PEP-68: a local user has no Gitea account — the repo is created in peppa-bot's namespace. const local = isLocalUser(user); const botLogin = process.env.GITEA_BOT_USER ?? "peppa-bot"; if (!local) { try { orgs = await (await giteaForUser(db, user)).orgsWithRepoCreate(user.login); } catch (e) { giteaError = (e as Error).message; } } return ( Название Репозиторий (slug) Ключ стори {local ? ( У вас нет аккаунта Gitea — репозиторий будет {giteaUrl}/{botLogin}/<slug>. Доступ к коду — только через Пеппу (агенты, PR, проверки); соавтором в Gitea вас добавить нельзя. ) : ( <> Пространство в Gitea {user.login} — личное {orgs.map((o) => ( {o.username} — организация ))} Репозиторий будет {giteaUrl}/<пространство>/<slug>. В личном пространстве приватный репозиторий видите только вы, peppa-bot и участники проекта; в организации — ещё её участники с доступом к репозиториям. {orgs.length === 0 && " Организаций, где вы можете создавать репозитории, нет."} > )} Видимость Публичный — все, у кого есть доступ к Gitea Приватный — только те, кому выдан доступ Репозиторий Создать новый Подключить существующий (нужны права админа; видимость не меняется) Пеппа добавит peppa-bot соавтором, положит AGENTS.md, .mcp.json и .peppa/project.json из шаблона и запустит openspec init. Занимает до ~15 секунд. Создать проект ); }
У вас нет аккаунта Gitea — репозиторий будет {giteaUrl}/{botLogin}/<slug>. Доступ к коду — только через Пеппу (агенты, PR, проверки); соавтором в Gitea вас добавить нельзя.
Репозиторий будет {giteaUrl}/<пространство>/<slug>. В личном пространстве приватный репозиторий видите только вы, peppa-bot и участники проекта; в организации — ещё её участники с доступом к репозиториям. {orgs.length === 0 && " Организаций, где вы можете создавать репозитории, нет."}
Пеппа добавит peppa-bot соавтором, положит AGENTS.md, .mcp.json и .peppa/project.json из шаблона и запустит openspec init. Занимает до ~15 секунд.