@@ -18,11 +18,10 @@ import {
1818 TASK_STATUS ,
1919} from '@swarmdock/shared' ;
2020import { authMiddleware , requireScope , type AuthContext } from '../middleware/auth.js' ;
21- import { rateLimitAuth } from '../middleware/rateLimit.js' ;
21+ import { rateLimitAuth , rateLimitStrict } from '../middleware/rateLimit.js' ;
2222import { eventBus } from '../lib/events.js' ;
2323import { getRatingsSummary } from '../services/ratings.js' ;
2424import { provisionAgentWallet } from '../services/wallet.js' ;
25- import { getAgentCardById } from '../services/agent-card.js' ;
2625import { updateTrustLevel } from '../services/reputation.js' ;
2726import { getAgentPortfolio , createPortfolioItem , updatePortfolioItem , deletePortfolioItem } from '../services/portfolio.js' ;
2827import { fetchOrderedRowsByIds , searchAgentsIndex } from '../services/search.js' ;
@@ -519,7 +518,8 @@ app.patch('/:id', authMiddleware, requireScope('profile.write'), async (c) => {
519518 data : { agentId : id } ,
520519 } ) ;
521520
522- return c . json ( updated ) ;
521+ const { webhookSecret : _ws , publicKey : _pk , ...safeUpdated } = updated ;
522+ return c . json ( safeUpdated ) ;
523523} ) ;
524524
525525// POST /api/v1/agents/:id/heartbeat — Refresh AAT
@@ -636,18 +636,10 @@ app.delete('/:id/portfolio/:itemId', authMiddleware, requireScope('portfolio.wri
636636 }
637637} ) ;
638638
639- // GET /agents/:id/.well-known/agent.json — A2A Agent Card
640- app . get ( '/:id/.well-known/agent.json' , async ( c ) => {
641- const agentCard = await getAgentCardById ( c . req . param ( 'id' ) ) ;
642- if ( ! agentCard ) {
643- return c . json ( { error : 'Agent not found' } , 404 ) ;
644- }
645-
646- return c . json ( agentCard ) ;
647- } ) ;
639+ // Agent card served from index.ts at /agents/:id/.well-known/agent.json
648640
649641// POST /api/v1/agents/match — Find best-matching agents for a task
650- app . post ( '/match' , async ( c ) => {
642+ app . post ( '/match' , rateLimitStrict , async ( c ) => {
651643 const body = await c . req . json ( ) ;
652644 const { description, skills, limit = 10 } = body as { description : string ; skills ?: string [ ] ; limit ?: number } ;
653645
0 commit comments