@@ -51,6 +51,9 @@ const ACP_REGISTRY_URL = "https://cdn.agentclientprotocol.com/registry/v1/latest
5151
5252const MAX_REGISTRY_BYTES = 1024 * 1024 ;
5353const MAX_ARCHIVE_BYTES = 1024 * 1024 * 1024 ;
54+ const MAX_COMMAND_OUTPUT_BYTES = 1024 * 1024 ;
55+ // Archive listings can exceed the output of package-manager commands.
56+ const MAX_ARCHIVE_LISTING_BYTES = 64 * 1024 * 1024 ;
5457const MAX_PACKAGE_MANIFEST_BYTES = 1024 * 1024 ;
5558// Older clients omit the limit and validate responses against a 20-agent cap.
5659const DEFAULT_SEARCH_LIMIT = 20 ;
@@ -916,6 +919,7 @@ export const makeAcpRegistryCatalog = Effect.fn("AcpRegistryCatalog.make")(funct
916919 readonly env ?: NodeJS . ProcessEnv ;
917920 readonly timeout ?: Duration . Input ;
918921 readonly truncatedOutputReason ?: AcpRegistryErrorReason ;
922+ readonly maxStdoutBytes ?: number ;
919923 } = { } ,
920924 ) {
921925 const collect = Effect . gen ( function * ( ) {
@@ -934,8 +938,11 @@ export const makeAcpRegistryCatalog = Effect.fn("AcpRegistryCatalog.make")(funct
934938 yield * Effect . addFinalizer ( ( ) => child . kill ( ) . pipe ( Effect . ignore ) ) ;
935939 const [ stdout , stderr , exitCode ] = yield * Effect . all (
936940 [
937- collectUint8StreamText ( { stream : child . stdout , maxBytes : 1024 * 1024 } ) ,
938- collectUint8StreamText ( { stream : child . stderr , maxBytes : 1024 * 1024 } ) ,
941+ collectUint8StreamText ( {
942+ stream : child . stdout ,
943+ maxBytes : options . maxStdoutBytes ?? MAX_COMMAND_OUTPUT_BYTES ,
944+ } ) ,
945+ collectUint8StreamText ( { stream : child . stderr , maxBytes : MAX_COMMAND_OUTPUT_BYTES } ) ,
939946 child . exitCode ,
940947 ] ,
941948 { concurrency : "unbounded" } ,
@@ -1532,10 +1539,11 @@ export const makeAcpRegistryCatalog = Effect.fn("AcpRegistryCatalog.make")(funct
15321539 : platform === "win32"
15331540 ? [ "-tf" , archivePath ]
15341541 : undefined ;
1542+ const listingOptions = { maxStdoutBytes : MAX_ARCHIVE_LISTING_BYTES } ;
15351543 const entries =
15361544 listArgs === undefined
1537- ? yield * runCommand ( "unzip" , [ "-Z1" , archivePath ] )
1538- : yield * runCommand ( tarCommand , listArgs ) ;
1545+ ? yield * runCommand ( "unzip" , [ "-Z1" , archivePath ] , listingOptions )
1546+ : yield * runCommand ( tarCommand , listArgs , listingOptions ) ;
15391547 if ( ! validateArchiveEntries ( entries ) ) {
15401548 return yield * new AcpRegistryError ( {
15411549 reason : "archive_invalid" ,
0 commit comments