Skip to content

Commit a30e64a

Browse files
authored
Merge pull request #40 from odefun/ode_1770386239.048649
fix: restore local-setting sidebar and agent check flow
2 parents d7cef3b + 3524a49 commit a30e64a

File tree

3 files changed

+510
-136
lines changed

3 files changed

+510
-136
lines changed

packages/core/web/server.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ type JsonResponse = {
3333
error?: string;
3434
config?: typeof defaultDashboardConfig;
3535
workspace?: (typeof defaultDashboardConfig)["workspaces"][number];
36+
agentCheck?: {
37+
opencode: boolean;
38+
claude: boolean;
39+
};
3640
providers?: unknown;
3741
result?: unknown;
3842
};
@@ -176,13 +180,6 @@ async function handleRequest(request: Request): Promise<Response> {
176180
});
177181
}
178182

179-
if (pathname.startsWith("/local-setting/slack-bot/")) {
180-
return new Response(null, {
181-
status: 307,
182-
headers: { location: "/local-setting" },
183-
});
184-
}
185-
186183
if (pathname === "/api/config") {
187184
if (request.method === "GET") {
188185
const config = await readLocalSettings();
@@ -291,6 +288,19 @@ async function handleRequest(request: Request): Promise<Response> {
291288
}
292289
}
293290

291+
if (pathname === "/api/agent-check") {
292+
if (request.method !== "GET") {
293+
return jsonResponse(405, { ok: false, error: "Method not allowed" });
294+
}
295+
return jsonResponse(200, {
296+
ok: true,
297+
result: {
298+
opencode: Boolean(Bun.which("opencode")),
299+
claude: Boolean(Bun.which("claude")),
300+
},
301+
});
302+
}
303+
294304
if (pathname === "/api/action") {
295305
if (request.method !== "POST") {
296306
return jsonResponse(405, { ok: false, error: "Method not allowed" });

0 commit comments

Comments
 (0)