@@ -253,9 +253,6 @@ const wellKnowns = {
253253 plugin . name = rawPlugin . name || '(No name provided)' ;
254254 plugin . description = rawPlugin . description || '(No description provided)' ;
255255 plugin . version = rawPlugin . version || 'local' ;
256- plugin . enabled = rawPlugin . hasOwnProperty ( 'enabled' )
257- ? rawPlugin . enabled
258- : false ;
259256 plugin . image_url = rawPlugin . image_url || null ;
260257 if (
261258 typeof plugin . image_url === 'string' &&
@@ -269,6 +266,13 @@ const wellKnowns = {
269266 plugin . forModel . description = plugin . forModel . description || plugin . description ;
270267
271268 plugin . termsOfService = rawPlugin . termsOfService || null ;
269+ if (
270+ typeof plugin . termsOfService === 'string' &&
271+ plugin . termsOfService . startsWith ( '/' )
272+ ) {
273+ plugin . termsOfService = `${ origin } ${ plugin . termsOfService } ` ;
274+ }
275+
272276 plugin . contact = rawPlugin . contact || { } ;
273277
274278 const checkPluginValue = ( name , isRequired = false ) => {
@@ -289,10 +293,6 @@ const wellKnowns = {
289293 }
290294 } ;
291295
292- if ( typeof plugin . enabled !== 'boolean' ) {
293- throw new Error ( `plugin.enabled must be a boolean` ) ;
294- }
295-
296296 [
297297 'name' ,
298298 'description' ,
@@ -331,14 +331,20 @@ const wellKnowns = {
331331
332332 const AIPlugin = { } ;
333333 AIPlugin . schema_version = 'v1' ;
334- AIPlugin . name_for_human = plugin . name ;
335- AIPlugin . name_for_model = plugin . forModel . name ;
336- AIPlugin . description_for_human = plugin . description ;
337- AIPlugin . description_for_model = plugin . forModel . description ;
334+ AIPlugin . name_for_human = plugin . name . slice ( 0 , 20 ) ;
335+ AIPlugin . name_for_model = plugin . forModel . name . slice ( 0 , 50 ) ;
336+ AIPlugin . description_for_human = plugin . description . slice ( 0 , 100 ) ;
337+ AIPlugin . description_for_model = plugin . forModel . description . slice ( 0 , 8000 ) ;
338+ AIPlugin . auth = {
339+ type : 'none'
340+ } ;
338341 AIPlugin . api = {
339342 type : 'openapi' ,
340343 url : `${ origin } /.well-known/openapi.yaml`
341344 } ;
345+ AIPlugin . logo_url = `${ origin } /logo.png` ;
346+ AIPlugin . contact_email = `noreply@${ origin . replace ( / ^ h t t p s ? \: \/ \/ ( .* ) ( : \d + ) / gi, '$1' ) } ` ;
347+ AIPlugin . legal_info_url = `${ origin } /tos.txt` ;
342348 if ( plugin . image_url ) {
343349 AIPlugin . logo_url = plugin . image_url ;
344350 }
0 commit comments