feat: proje secimi ve otomatik ekip akisini ekle
This commit is contained in:
@@ -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 })
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user