import { defineHandler } from '@kb-labs/sdk';
import { SessionManager } from '@kb-labs/agent-core';

// src/rest/handlers/list-sessions-handler.ts
var list_sessions_handler_default = defineHandler({
  async execute(ctx, input) {
    const query = input.query;
    const sessionManager = new SessionManager(ctx.cwd);
    const result = await sessionManager.listSessions({
      status: query?.status,
      limit: query?.limit ?? 50,
      offset: query?.offset ?? 0
    });
    return {
      sessions: result.sessions,
      total: result.total
    };
  }
});

export { list_sessions_handler_default as default };
//# sourceMappingURL=list-sessions-handler.js.map
//# sourceMappingURL=list-sessions-handler.js.map