feat: proje secimi ve otomatik ekip akisini ekle

This commit is contained in:
2026-03-17 00:40:50 +03:00
parent 3641190a77
commit c312b83604
6 changed files with 130 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ const initialState = {
startedAt: null,
teamActivated: false,
lastError: null,
currentProjectPath: null,
runtime: {
anthropicModel: "",
anthropicBaseUrl: "",
@@ -64,6 +65,25 @@ export function useSession(socket) {
stopSession: () => emitWithAck("session:stop"),
activateTeam: () => emitWithAck("team:activate"),
sendPrompt: (prompt) => emitWithAck("prompt:send", { prompt }),
selectProject: async () => {
const response = await fetch("/api/project/select", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({})
});
const payload = await response.json();
if (!response.ok || !payload.ok) {
const message = payload.error ?? "Project selection failed";
setError(message);
throw new Error(message);
}
setError("");
return payload;
},
resizeTerminal: (cols, rows) => socket.emit("terminal:resize", { cols, rows })
};
}