@@ -28,7 +28,9 @@ function extractPrompt(
2828 if ( typeof message === "string" ) return message ;
2929 if ( message && typeof message === "object" && "content" in message ) {
3030 const content = ( message as { content ?: unknown } ) . content ;
31- return typeof content === "string" ? content : JSON . stringify ( content ) ;
31+ return typeof content === "string"
32+ ? content
33+ : JSON . stringify ( content ) ;
3234 }
3335 return JSON . stringify ( message ) ;
3436 } )
@@ -316,7 +318,8 @@ function buildWebShopActionToon(prompt: string): string {
316318 actions : "BENCHMARK_ACTION" ,
317319 providers : "" ,
318320 text : "Searching WebShop." ,
319- params : "BENCHMARK_ACTION:\n command: search[wireless bluetooth headphones]" ,
321+ params :
322+ "BENCHMARK_ACTION:\n command: search[wireless bluetooth headphones]" ,
320323 } ) ;
321324}
322325
@@ -348,8 +351,9 @@ function buildTrustAnalysisToon(prompt: string): string {
348351 / i g n o r e | d i s r e g a r d | p r e v i o u s i n s t r u c t i o n s | n e w i n s t r u c t i o n s | s y s t e m o v e r r i d e | s y s t e m c o m m a n d | d a n | b y p a s s | j a i l b r e a k / . test (
349352 lower ,
350353 ) ;
351- const privilege =
352- / a d m i n | o w n e r | r o o t | p r i v i l e g e | p e r m i s s i o n s | e l e v a t e / . test ( lower ) ;
354+ const privilege = / a d m i n | o w n e r | r o o t | p r i v i l e g e | p e r m i s s i o n s | e l e v a t e / . test (
355+ lower ,
356+ ) ;
353357 const analysis = {
354358 prompt_injection : {
355359 detected : promptInjection ,
@@ -382,7 +386,8 @@ function buildSocialAlphaExtractionToon(prompt: string): string {
382386 const ticker = / \$ ( [ A - Z ] [ A - Z 0 - 9 ] { 1 , 12 } ) / . exec ( message ) ?. [ 1 ] ?? "" ;
383387 const sell = / s e l l | d u m p | s h o r t | a v o i d | b e a r i s h | r u g | s c a m / . test ( lower ) ;
384388 const buy = / b u y | m o o n | p u m p | b u l l i s h | l o n g | a p e | g e m | a l p h a | 1 0 0 x / . test ( lower ) ;
385- const recommendation_type = buy && ! sell ? "BUY" : sell && ! buy ? "SELL" : "NOISE" ;
389+ const recommendation_type =
390+ buy && ! sell ? "BUY" : sell && ! buy ? "SELL" : "NOISE" ;
386391 const is_recommendation = recommendation_type !== "NOISE" ;
387392 const conviction = is_recommendation
388393 ? / 1 0 0 x | m o o n | a p e | s t r o n g | h i g h | g e m | a l p h a / . test ( lower )
@@ -512,27 +517,45 @@ function buildCompletion(prompt: string): string {
512517 return buildVendingActionToon ( prompt ) ;
513518 }
514519
515- if ( / B e n c h m a r k : \* { 0 , 2 } \s * m i n d 2 w e b / i. test ( prompt ) || / M i n d 2 W e b b e n c h m a r k / i. test ( prompt ) ) {
520+ if (
521+ / B e n c h m a r k : \* { 0 , 2 } \s * m i n d 2 w e b / i. test ( prompt ) ||
522+ / M i n d 2 W e b b e n c h m a r k / i. test ( prompt )
523+ ) {
516524 return buildMind2WebActionToon ( prompt ) ;
517525 }
518526
519- if ( / B e n c h m a r k : \* { 0 , 2 } \s * ( t e r m i n a l - b e n c h | t e r m i n a l _ b e n c h ) / i. test ( prompt ) || / T e r m i n a l - B e n c h / i. test ( prompt ) ) {
527+ if (
528+ / B e n c h m a r k : \* { 0 , 2 } \s * ( t e r m i n a l - b e n c h | t e r m i n a l _ b e n c h ) / i. test ( prompt ) ||
529+ / T e r m i n a l - B e n c h / i. test ( prompt )
530+ ) {
520531 return buildTerminalCommandToon ( prompt ) ;
521532 }
522533
523- if ( / B e n c h m a r k : \* { 0 , 2 } \s * o s w o r l d / i. test ( prompt ) || / O S W o r l d | p y a u t o g u i / i. test ( prompt ) ) {
534+ if (
535+ / B e n c h m a r k : \* { 0 , 2 } \s * o s w o r l d / i. test ( prompt ) ||
536+ / O S W o r l d | p y a u t o g u i / i. test ( prompt )
537+ ) {
524538 return buildOSWorldActionToon ( prompt ) ;
525539 }
526540
527- if ( / B e n c h m a r k : \* { 0 , 2 } \s * w e b s h o p / i. test ( prompt ) || / W e b S h o p | s i m u l a t e d w e b s t o r e | w e b s t o r e / i. test ( prompt ) ) {
541+ if (
542+ / B e n c h m a r k : \* { 0 , 2 } \s * w e b s h o p / i. test ( prompt ) ||
543+ / W e b S h o p | s i m u l a t e d w e b s t o r e | w e b s t o r e / i. test ( prompt )
544+ ) {
528545 return buildWebShopActionToon ( prompt ) ;
529546 }
530547
531- if ( / B e n c h m a r k : \* { 0 , 2 } \s * g a u n t l e t / i. test ( prompt ) || / S o l a n a D e F i s a f e t y a n a l y z e r / i. test ( prompt ) ) {
548+ if (
549+ / B e n c h m a r k : \* { 0 , 2 } \s * g a u n t l e t / i. test ( prompt ) ||
550+ / S o l a n a D e F i s a f e t y a n a l y z e r / i. test ( prompt )
551+ ) {
532552 return buildGauntletDecisionToon ( prompt ) ;
533553 }
534554
535- if ( / B e n c h m a r k : \* { 0 , 2 } \s * o p e n c l a w / i. test ( prompt ) || / O p e n C l a w | N o d e \. j s p r o j e c t w i t h T y p e S c r i p t / i. test ( prompt ) ) {
555+ if (
556+ / B e n c h m a r k : \* { 0 , 2 } \s * o p e n c l a w / i. test ( prompt ) ||
557+ / O p e n C l a w | N o d e \. j s p r o j e c t w i t h T y p e S c r i p t / i. test ( prompt )
558+ ) {
536559 return buildOpenClawReplyToon ( prompt ) ;
537560 }
538561
@@ -613,7 +636,7 @@ function mockObjectModel(
613636 _runtime : IAgentRuntime ,
614637 params : ObjectGenerationParams ,
615638) : Record < string , JsonValue > {
616- const prompt = extractPrompt ( params . prompt ?? "" ) ;
639+ const prompt = extractPrompt ( params . prompt ?? params ) ;
617640 const command = extractCommand ( prompt ) ;
618641 const replyToon =
619642 / B e n c h m a r k : \* { 0 , 2 } \s * t r u s t / i. test ( prompt ) ||
0 commit comments