@@ -16,8 +16,9 @@ function extractCode(prompt: string, label: string): string {
1616
1717function buildToonResponse ( fields : Record < string , string | undefined > ) : string {
1818 return Object . entries ( fields )
19- . filter ( ( entry ) : entry is [ string , string ] =>
20- typeof entry [ 1 ] === "string" && entry [ 1 ] . length > 0 ,
19+ . filter (
20+ ( entry ) : entry is [ string , string ] =>
21+ typeof entry [ 1 ] === "string" && entry [ 1 ] . length > 0 ,
2122 )
2223 . map ( ( [ key , value ] ) => {
2324 if ( value . includes ( "\n" ) ) {
@@ -32,7 +33,10 @@ function buildToonResponse(fields: Record<string, string | undefined>): string {
3233}
3334
3435function createBenchmarkActionToon ( prompt : string ) : string {
35- if ( / B e n c h m a r k : \* { 0 , 2 } \s * ( r l m - b e n c h | r l m _ b e n c h ) / i. test ( prompt ) || / R L M b e n c h m a r k t a s k / i. test ( prompt ) ) {
36+ if (
37+ / B e n c h m a r k : \* { 0 , 2 } \s * ( r l m - b e n c h | r l m _ b e n c h ) / i. test ( prompt ) ||
38+ / R L M b e n c h m a r k t a s k / i. test ( prompt )
39+ ) {
3640 const answer =
3741 / a u t h o r i z a t i o n c o d e i s ( [ A - Z 0 - 9 ] { 8 } ) / i. exec ( prompt ) ?. [ 1 ] ??
3842 / e n c r y p t e d k e y s e q u e n c e i s ( [ A - Z 0 - 9 ] { 8 } ) / i. exec ( prompt ) ?. [ 1 ] ??
@@ -48,18 +52,28 @@ function createBenchmarkActionToon(prompt: string): string {
4852 } ) ;
4953 }
5054
51- if ( / B e n c h m a r k : \* { 0 , 2 } \s * g a i a / i. test ( prompt ) || / G A I A b e n c h m a r k t a s k | F I N A L A N S W E R / i. test ( prompt ) ) {
55+ if (
56+ / B e n c h m a r k : \* { 0 , 2 } \s * g a i a / i. test ( prompt ) ||
57+ / G A I A b e n c h m a r k t a s k | F I N A L A N S W E R / i. test ( prompt )
58+ ) {
5259 const arithmetic =
5360 / Q u e s t i o n : \s * (?: w h a t i s \s * ) ? ( - ? \d + ) \s * ( [ + * x - ] ) \s * ( - ? \d + ) / i. exec ( prompt ) ??
54- / Q u e s t i o n : \s * (?: w h a t i s \s * ) ? ( - ? \d + ) \s + ( t i m e s | m u l t i p l i e d b y | p l u s | m i n u s ) \s + ( - ? \d + ) / i. exec ( prompt ) ;
61+ / Q u e s t i o n : \s * (?: w h a t i s \s * ) ? ( - ? \d + ) \s + ( t i m e s | m u l t i p l i e d b y | p l u s | m i n u s ) \s + ( - ? \d + ) / i. exec (
62+ prompt ,
63+ ) ;
5564 let answer = "mock-answer" ;
5665 if ( arithmetic ) {
5766 const left = Number ( arithmetic [ 1 ] ) ;
5867 const right = Number ( arithmetic [ 3 ] ) ;
5968 const op = arithmetic [ 2 ] . toLowerCase ( ) ;
6069 if ( op === "+" || op === "plus" ) answer = String ( left + right ) ;
6170 if ( op === "-" || op === "minus" ) answer = String ( left - right ) ;
62- if ( op === "*" || op === "x" || op === "times" || op === "multiplied by" ) {
71+ if (
72+ op === "*" ||
73+ op === "x" ||
74+ op === "times" ||
75+ op === "multiplied by"
76+ ) {
6377 answer = String ( left * right ) ;
6478 }
6579 }
@@ -70,50 +84,78 @@ function createBenchmarkActionToon(prompt: string): string {
7084 } ) ;
7185 }
7286
73- if ( / B e n c h m a r k : \* { 0 , 2 } \s * ( h y p e r l i q u i d _ b e n c h | h y p e r l i q u i d - b e n c h | h y p e r l i q u i d b e n c h ) / i. test ( prompt ) || / H y p e r l i q u i d D E X | H y p e r l i q u i d B e n c h / i. test ( prompt ) ) {
87+ if (
88+ / B e n c h m a r k : \* { 0 , 2 } \s * ( h y p e r l i q u i d _ b e n c h | h y p e r l i q u i d - b e n c h | h y p e r l i q u i d b e n c h ) / i. test (
89+ prompt ,
90+ ) ||
91+ / H y p e r l i q u i d D E X | H y p e r l i q u i d B e n c h / i. test ( prompt )
92+ ) {
7493 return buildToonResponse ( {
7594 thought : "Returning a deterministic Hyperliquid plan." ,
7695 actions : "REPLY" ,
7796 text : '{"steps":[{"perp_orders":{"orders":[{"coin":"ETH","side":"buy","tif":"ALO","sz":0.01,"reduceOnly":false,"px":"mid-1%"},{"coin":"BTC","side":"sell","tif":"IOC","sz":0.01,"reduceOnly":true,"px":"mid+1%"}]}},{"usd_class_transfer":{"toPerp":true,"usdc":5}},{"set_leverage":{"coin":"ETH","leverage":3,"cross":false}},{"cancel_all":{"coin":"BTC"}}]}' ,
7897 } ) ;
7998 }
8099
81- if ( / B e n c h m a r k : \* { 0 , 2 } \s * ( v e n d i n g - b e n c h | v e n d i n g _ b e n c h ) / i. test ( prompt ) || / V e n d i n g - B e n c h | v e n d i n g m a c h i n e b u s i n e s s / i. test ( prompt ) ) {
82- const action = / p e n d i n g o r d e r s / i. test ( prompt ) && ! / n o p e n d i n g o r d e r s / i. test ( prompt )
83- ? '{"action":"ADVANCE_DAY"}'
84- : '{"action":"PLACE_ORDER","supplier_id":"beverage_dist","items":{"water":12}}' ;
100+ if (
101+ / B e n c h m a r k : \* { 0 , 2 } \s * ( v e n d i n g - b e n c h | v e n d i n g _ b e n c h ) / i. test ( prompt ) ||
102+ / V e n d i n g - B e n c h | v e n d i n g m a c h i n e b u s i n e s s / i. test ( prompt )
103+ ) {
104+ const action =
105+ / p e n d i n g o r d e r s / i. test ( prompt ) && ! / n o p e n d i n g o r d e r s / i. test ( prompt )
106+ ? '{"action":"ADVANCE_DAY"}'
107+ : '{"action":"PLACE_ORDER","supplier_id":"beverage_dist","items":{"water":12}}' ;
85108 return buildToonResponse ( {
86109 thought : "Returning a deterministic Vending-Bench action." ,
87110 actions : "REPLY" ,
88111 text : action ,
89112 } ) ;
90113 }
91114
92- if ( / B e n c h m a r k : \* { 0 , 2 } \s * c l a w b e n c h / i. test ( prompt ) || / C l a w B e n c h | R e v i e w m y i n b o x / i. test ( prompt ) ) {
115+ if (
116+ / B e n c h m a r k : \* { 0 , 2 } \s * c l a w b e n c h / i. test ( prompt ) ||
117+ / C l a w B e n c h | R e v i e w m y i n b o x / i. test ( prompt )
118+ ) {
93119 return buildToonResponse ( {
94120 thought : "Returning deterministic ClawBench inbox triage." ,
95121 actions : "REPLY" ,
96122 text : "Inbox triage complete. Boss Q4 report is urgent and needs an EOD draft response. HR benefits enrollment is action-required before January 20. BigCorp client email needs scheduling for the project timeline call. Newsletter is low priority and the shopping promo should be archived. Draft replies are ready for review; please approve before I send anything." ,
97123 } ) ;
98124 }
99125
100- if ( / B e n c h m a r k : \* { 0 , 2 } \s * a d h d b e n c h / i. test ( prompt ) || / A D H D B e n c h / i. test ( prompt ) ) {
101- const currentMessage = / C u r r e n t u s e r m e s s a g e : \s * ( [ \s \S ] * ?) (?: \n \n | $ ) / i. exec ( prompt ) ?. [ 1 ] ?. toLowerCase ( ) ?? prompt . toLowerCase ( ) ;
126+ if (
127+ / B e n c h m a r k : \* { 0 , 2 } \s * a d h d b e n c h / i. test ( prompt ) ||
128+ / A D H D B e n c h / i. test ( prompt )
129+ ) {
130+ const currentMessage =
131+ / C u r r e n t u s e r m e s s a g e : \s * ( [ \s \S ] * ?) (?: \n \n | $ ) / i
132+ . exec ( prompt ) ?. [ 1 ]
133+ ?. toLowerCase ( ) ?? prompt . toLowerCase ( ) ;
102134 let action = "REPLY" ;
103- if ( / s e n d a m e s s a g e | m e s s a g e t o / . test ( currentMessage ) ) action = "SEND_MESSAGE" ;
135+ if ( / s e n d a m e s s a g e | m e s s a g e t o / . test ( currentMessage ) )
136+ action = "SEND_MESSAGE" ;
104137 else if ( / m u t e t h i s | t o o n o i s y / . test ( currentMessage ) ) action = "MUTE_ROOM" ;
105138 else if ( / u n m u t e / . test ( currentMessage ) ) action = "UNMUTE_ROOM" ;
106139 else if ( / f o l l o w t h e / . test ( currentMessage ) ) action = "FOLLOW_ROOM" ;
107- else if ( / s t o p f o l l o w i n g | u n f o l l o w / . test ( currentMessage ) ) action = "UNFOLLOW_ROOM" ;
140+ else if ( / s t o p f o l l o w i n g | u n f o l l o w / . test ( currentMessage ) )
141+ action = "UNFOLLOW_ROOM" ;
108142 else if ( / f i n d a l l | s e a r c h / . test ( currentMessage ) ) action = "SEARCH_CONTACTS" ;
109- else if ( / m a k e .* a d m i n | u p d a t e r o l e / . test ( currentMessage ) ) action = "UPDATE_ROLE" ;
110- else if ( / r e m i n d m e | t o m o r r o w / . test ( currentMessage ) ) action = "SCHEDULE_FOLLOW_UP" ;
111- else if ( / a d d .* c o n t a c t | n e w c o l l e a g u e / . test ( currentMessage ) ) action = "ADD_CONTACT" ;
112- else if ( / r e m o v e .* c o n t a c t / . test ( currentMessage ) ) action = "REMOVE_CONTACT" ;
113- else if ( / s e t t i n g s | n o t i f i c a t i o n p r e f e r e n c e s / . test ( currentMessage ) ) action = "UPDATE_SETTINGS" ;
114- else if ( / r e s e t | s t a r t f r e s h | c l e a r e v e r y t h i n g / . test ( currentMessage ) ) action = "RESET_SESSION" ;
115- else if ( / p h o n e n u m b e r | c o n t a c t i n f o / . test ( currentMessage ) ) action = "UPDATE_CONTACT_INFO" ;
116- else if ( / g e n e r a t e .* p i c t u r e | i m a g e / . test ( currentMessage ) ) action = "GENERATE_IMAGE" ;
143+ else if ( / m a k e .* a d m i n | u p d a t e r o l e / . test ( currentMessage ) )
144+ action = "UPDATE_ROLE" ;
145+ else if ( / r e m i n d m e | t o m o r r o w / . test ( currentMessage ) )
146+ action = "SCHEDULE_FOLLOW_UP" ;
147+ else if ( / a d d .* c o n t a c t | n e w c o l l e a g u e / . test ( currentMessage ) )
148+ action = "ADD_CONTACT" ;
149+ else if ( / r e m o v e .* c o n t a c t / . test ( currentMessage ) )
150+ action = "REMOVE_CONTACT" ;
151+ else if ( / s e t t i n g s | n o t i f i c a t i o n p r e f e r e n c e s / . test ( currentMessage ) )
152+ action = "UPDATE_SETTINGS" ;
153+ else if ( / r e s e t | s t a r t f r e s h | c l e a r e v e r y t h i n g / . test ( currentMessage ) )
154+ action = "RESET_SESSION" ;
155+ else if ( / p h o n e n u m b e r | c o n t a c t i n f o / . test ( currentMessage ) )
156+ action = "UPDATE_CONTACT_INFO" ;
157+ else if ( / g e n e r a t e .* p i c t u r e | i m a g e / . test ( currentMessage ) )
158+ action = "GENERATE_IMAGE" ;
117159 else if ( / i g n o r e t h a t l a s t / . test ( currentMessage ) ) action = "IGNORE" ;
118160 else if ( / c r e a t e .* p l a n / . test ( currentMessage ) ) action = "CREATE_PLAN" ;
119161 if ( [ "REPLY" , "IGNORE" , "NONE" ] . includes ( action ) ) {
0 commit comments