@@ -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