@@ -384,12 +384,14 @@ export class HttpDispatcher {
384384 // /metadata/:type/:name
385385 if ( parts . length === 2 ) {
386386 const [ type , name ] = parts ;
387+ // Extract optional package filter from query string
388+ const packageId = query ?. package || undefined ;
387389
388390 // PUT /metadata/:type/:name (Save)
389391 if ( method === 'PUT' && body ) {
390392 // Try to get the protocol service directly
391393 const protocol = await this . resolveService ( 'protocol' ) ;
392-
394+
393395 if ( protocol && typeof protocol . saveMetaItem === 'function' ) {
394396 try {
395397 const result = await protocol . saveMetaItem ( { type, name, item : body } ) ;
@@ -398,7 +400,7 @@ export class HttpDispatcher {
398400 return { handled : true , response : this . error ( e . message , 400 ) } ;
399401 }
400402 }
401-
403+
402404 // Fallback to broker if protocol not available (legacy)
403405 if ( broker ) {
404406 try {
@@ -430,12 +432,12 @@ export class HttpDispatcher {
430432 // If type is singular (e.g. 'app'), use it directly
431433 // If plural (e.g. 'apps'), slice it
432434 const singularType = type . endsWith ( 's' ) ? type . slice ( 0 , - 1 ) : type ;
433-
435+
434436 // Try Protocol Service First (Preferred)
435437 const protocol = await this . resolveService ( 'protocol' ) ;
436438 if ( protocol && typeof protocol . getMetaItem === 'function' ) {
437439 try {
438- const data = await protocol . getMetaItem ( { type : singularType , name } ) ;
440+ const data = await protocol . getMetaItem ( { type : singularType , name, packageId } ) ;
439441 return { handled : true , response : this . success ( data ) } ;
440442 } catch ( e : any ) {
441443 // Protocol might throw if not found or not supported
0 commit comments