@blockrun/clawrouter 0.8.12 → 0.8.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2642,12 +2642,16 @@ function normalizeMessagesForThinking(messages) {
2642
2642
  }
2643
2643
  var KIMI_BLOCK_RE = /<[||][^<>]*begin[^<>]*[||]>[\s\S]*?<[||][^<>]*end[^<>]*[||]>/gi;
2644
2644
  var KIMI_TOKEN_RE = /<[||][^<>]*[||]>/g;
2645
+ var DSML_BLOCK_RE = /<[||]DSML[||][^>]*>[\s\S]*?<\/[||]DSML[||][^>]*>/gi;
2646
+ var DSML_TAG_RE = /<\/?[||]DSML[||][^>]*>/gi;
2645
2647
  var THINKING_TAG_RE = /<\s*\/?\s*(?:think(?:ing)?|thought|antthinking)\b[^>]*>/gi;
2646
2648
  var THINKING_BLOCK_RE = /<\s*(?:think(?:ing)?|thought|antthinking)\b[^>]*>[\s\S]*?<\s*\/\s*(?:think(?:ing)?|thought|antthinking)\s*>/gi;
2647
2649
  function stripThinkingTokens(content) {
2648
2650
  if (!content) return content;
2649
2651
  let cleaned = content.replace(KIMI_BLOCK_RE, "");
2650
2652
  cleaned = cleaned.replace(KIMI_TOKEN_RE, "");
2653
+ cleaned = cleaned.replace(DSML_BLOCK_RE, "");
2654
+ cleaned = cleaned.replace(DSML_TAG_RE, "");
2651
2655
  cleaned = cleaned.replace(THINKING_BLOCK_RE, "");
2652
2656
  cleaned = cleaned.replace(THINKING_TAG_RE, "");
2653
2657
  return cleaned;