@mux/ai 0.25.0 → 0.26.0

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.d.ts CHANGED
@@ -9,7 +9,7 @@ import '@ai-sdk/google';
9
9
  import '@ai-sdk/openai';
10
10
  import '@mux/mux-node';
11
11
 
12
- var version = "0.25.0";
12
+ var version = "0.26.0";
13
13
 
14
14
  type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error";
15
15
  /**
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // package.json
8
- var version = "0.25.0";
8
+ var version = "0.26.0";
9
9
 
10
10
  // src/lib/language-codes.ts
11
11
  var ISO639_1_TO_3 = {
@@ -5861,6 +5861,15 @@ async function getModerationScores(assetId, options = {}) {
5861
5861
  import { generateText as generateText6, Output as Output6 } from "ai";
5862
5862
  import dedent6 from "dedent";
5863
5863
  import { z as z7 } from "zod";
5864
+
5865
+ // src/lib/markdown-normalization.ts
5866
+ var ESCAPED_LINE_BREAK_REGEX = /\\r\\n|\\n|\\r/g;
5867
+ var MULTIPLE_BLANK_LINES_REGEX = /\n{3,}/g;
5868
+ function normalizeMarkdownDescription(description) {
5869
+ return description.replace(ESCAPED_LINE_BREAK_REGEX, "\n").replace(/([^\n]) {2,}([*-]) (?=\S)/g, "$1\n$2 ").replace(/([.!?:;]) ([*-]) (?=\S)/g, "$1\n$2 ").replace(MULTIPLE_BLANK_LINES_REGEX, "\n\n");
5870
+ }
5871
+
5872
+ // src/workflows/summarization.ts
5864
5873
  var DEFAULT_SUMMARY_KEYWORD_LIMIT = 10;
5865
5874
  var DEFAULT_TITLE_LENGTH = 10;
5866
5875
  var DEFAULT_DESCRIPTION_LENGTH = 50;
@@ -6387,7 +6396,8 @@ async function getSummaryAndTags(assetId, options) {
6387
6396
  }
6388
6397
  }
6389
6398
  const scrubbedTitle = safety.scrub(analysisResponse.result.title, "title");
6390
- const scrubbedDescription = safety.scrub(analysisResponse.result.description, "description");
6399
+ const normalizedDescription = normalizeMarkdownDescription(analysisResponse.result.description);
6400
+ const scrubbedDescription = safety.scrub(normalizedDescription, "description");
6391
6401
  const scrubbedKeywords = (analysisResponse.result.keywords ?? []).map((kw, i) => safety.scrubDetailed(kw, `keywords[${i}]`)).filter((result) => !result.leaked).map((result) => result.text);
6392
6402
  return {
6393
6403
  assetId,