@utilix-tech/sdk 0.31.0 → 0.33.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/CHANGELOG.md +8 -0
- package/README.md +10 -6
- package/dist/{ai_agent-B-c59NXD.d.cts → ai_agent-C1zudGgT.d.cts} +24 -2
- package/dist/{ai_agent-B-c59NXD.d.ts → ai_agent-C1zudGgT.d.ts} +24 -2
- package/dist/{chunk-AFEZ6N4A.js → chunk-H2USEUHD.js} +67 -1
- package/dist/{chunk-LXKIPPDG.js → chunk-UUT5HNST.js} +121 -1
- package/dist/{chunk-265NPGKH.js → chunk-W3J7GZVQ.js} +25 -1
- package/dist/{chunk-GDIZWDBY.js → chunk-ZPQOE7KD.js} +78 -1
- package/dist/{code-DaRvff2v.d.ts → code-BK-x8hVx.d.cts} +51 -2
- package/dist/{code-DaRvff2v.d.cts → code-BK-x8hVx.d.ts} +51 -2
- package/dist/index.cjs +287 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{text-D1fySkCB.d.cts → text-CA-zuD0C.d.cts} +34 -2
- package/dist/{text-D1fySkCB.d.ts → text-CA-zuD0C.d.ts} +34 -2
- package/dist/tools/ai_agent.cjs +24 -0
- package/dist/tools/ai_agent.d.cts +1 -1
- package/dist/tools/ai_agent.d.ts +1 -1
- package/dist/tools/ai_agent.js +1 -1
- package/dist/tools/code.cjs +120 -0
- package/dist/tools/code.d.cts +1 -1
- package/dist/tools/code.d.ts +1 -1
- package/dist/tools/code.js +1 -1
- package/dist/tools/text.cjs +66 -0
- package/dist/tools/text.d.cts +1 -1
- package/dist/tools/text.d.ts +1 -1
- package/dist/tools/text.js +1 -1
- package/dist/tools/units.cjs +77 -0
- package/dist/tools/units.d.cts +1 -1
- package/dist/tools/units.d.ts +1 -1
- package/dist/tools/units.js +1 -1
- package/dist/{units-DQYLZd1n.d.cts → units-BhoxdHhs.d.cts} +42 -2
- package/dist/{units-DQYLZd1n.d.ts → units-BhoxdHhs.d.ts} +42 -2
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
* - passive-voice-detector: detectPassiveVoice
|
|
23
23
|
* - readability-score: scoreReadability
|
|
24
24
|
* - filler-word-detector: detectFillerWords
|
|
25
|
+
* - sentence-length-distribution: analyzeSentenceLengths
|
|
25
26
|
*/
|
|
26
27
|
interface WordCountResult {
|
|
27
28
|
words: number;
|
|
@@ -327,6 +328,34 @@ declare function calculateStringDistance(a: string, b: string, options?: {
|
|
|
327
328
|
}): StringDistanceResult | {
|
|
328
329
|
error: string;
|
|
329
330
|
};
|
|
331
|
+
interface SentenceLengthBucket {
|
|
332
|
+
label: string;
|
|
333
|
+
min: number;
|
|
334
|
+
max: number;
|
|
335
|
+
count: number;
|
|
336
|
+
}
|
|
337
|
+
interface SentenceLengthDistribution {
|
|
338
|
+
sentenceCount: number;
|
|
339
|
+
lengths: number[];
|
|
340
|
+
minLength: number;
|
|
341
|
+
maxLength: number;
|
|
342
|
+
meanLength: number;
|
|
343
|
+
medianLength: number;
|
|
344
|
+
stdDev: number;
|
|
345
|
+
coefficientOfVariation: number;
|
|
346
|
+
consistency: string;
|
|
347
|
+
buckets: SentenceLengthBucket[];
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Split text into sentences and report a histogram of sentence lengths (in
|
|
351
|
+
* words), plus mean/median/standard-deviation stats and a coefficient of
|
|
352
|
+
* variation, which is a distinct signal from the Flesch/Fog readability
|
|
353
|
+
* scores: two paragraphs can share the same reading grade while one alternates
|
|
354
|
+
* short and long sentences and the other stays uniform. Sentence splitting
|
|
355
|
+
* uses simple terminal-punctuation matching, so it can miscount abbreviations
|
|
356
|
+
* (e.g. "Dr.") as sentence boundaries.
|
|
357
|
+
*/
|
|
358
|
+
declare function analyzeSentenceLengths(text: string): SentenceLengthDistribution;
|
|
330
359
|
|
|
331
360
|
type text_AsciiFont = AsciiFont;
|
|
332
361
|
type text_AsciiOptions = AsciiOptions;
|
|
@@ -359,6 +388,8 @@ type text_PassiveVoiceResult = PassiveVoiceResult;
|
|
|
359
388
|
type text_PassiveVoiceSentence = PassiveVoiceSentence;
|
|
360
389
|
type text_ReadabilityResult = ReadabilityResult;
|
|
361
390
|
type text_ReadabilityScore = ReadabilityScore;
|
|
391
|
+
type text_SentenceLengthBucket = SentenceLengthBucket;
|
|
392
|
+
type text_SentenceLengthDistribution = SentenceLengthDistribution;
|
|
362
393
|
type text_SlugSeparator = SlugSeparator;
|
|
363
394
|
type text_StringDistanceMode = StringDistanceMode;
|
|
364
395
|
type text_StringDistanceResult = StringDistanceResult;
|
|
@@ -366,6 +397,7 @@ type text_TableOptions = TableOptions;
|
|
|
366
397
|
type text_TextAnalysis = TextAnalysis;
|
|
367
398
|
type text_WordCountResult = WordCountResult;
|
|
368
399
|
declare const text_addBorder: typeof addBorder;
|
|
400
|
+
declare const text_analyzeSentenceLengths: typeof analyzeSentenceLengths;
|
|
369
401
|
declare const text_analyzeText: typeof analyzeText;
|
|
370
402
|
declare const text_applyOp: typeof applyOp;
|
|
371
403
|
declare const text_applyOps: typeof applyOps;
|
|
@@ -419,7 +451,7 @@ declare const text_textToMorse: typeof textToMorse;
|
|
|
419
451
|
declare const text_unescapeString: typeof unescapeString;
|
|
420
452
|
declare const text_wordFrequency: typeof wordFrequency;
|
|
421
453
|
declare namespace text {
|
|
422
|
-
export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
|
|
454
|
+
export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
|
|
423
455
|
}
|
|
424
456
|
|
|
425
|
-
export {
|
|
457
|
+
export { detectFillerWords as $, type AsciiFont as A, type StringDistanceResult as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, ESCAPE_MODES as E, type FillerCategory as F, type TextAnalysis as G, addBorder as H, analyzeSentenceLengths as I, analyzeText as J, applyOp as K, LINE_OPS as L, MORSE_CODE as M, applyOps as N, calculateStringDistance as O, type ParsedDiff as P, centerText as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, convertAll as U, convertCase as V, type WordCountResult as W, countWords as X, csvToHtml as Y, csvToMarkdown as Z, detectDelimiter as _, type AsciiOptions as a, detectPassiveVoice as a0, diffLines as a1, diffLinesSimple as a2, diffStats as a3, escapeAll as a4, escapeString as a5, extractHeadings as a6, formatReadingTime as a7, generate as a8, generateDiff as a9, textToAscii as aA, textToMorse as aB, unescapeString as aC, wordFrequency as aD, generateHtmlTable as aa, generateMarkdownTable as ab, generateParagraphs as ac, generateSentences as ad, generateWords as ae, getAvailableFonts as af, getMorseForChar as ag, getMorseTiming as ah, htmlToMarkdown as ai, isValidMorse as aj, markdownToHtml as ak, morseToText as al, numberToOrdinal as am, numberToRoman as an, numberToWords as ao, ordinalWords as ap, parseDiff as aq, parseTableData as ar, readabilityScore as as, renderMarkdown as at, romanToNumber as au, scoreReadability as av, sentenceCount as aw, slugify as ax, slugifyAll as ay, syllableCount as az, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, type EscapeMode as j, type FillerMatch as k, type FillerWordResult as l, type LineOp as m, type LineType as n, type LoremUnit as o, type MarkdownResult as p, type MorseOptions as q, type ParsedTable as r, type PassiveVoiceMatch as s, text as t, type PassiveVoiceResult as u, type PassiveVoiceSentence as v, type ReadabilityScore as w, type SentenceLengthDistribution as x, type SlugSeparator as y, type StringDistanceMode as z };
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
* - passive-voice-detector: detectPassiveVoice
|
|
23
23
|
* - readability-score: scoreReadability
|
|
24
24
|
* - filler-word-detector: detectFillerWords
|
|
25
|
+
* - sentence-length-distribution: analyzeSentenceLengths
|
|
25
26
|
*/
|
|
26
27
|
interface WordCountResult {
|
|
27
28
|
words: number;
|
|
@@ -327,6 +328,34 @@ declare function calculateStringDistance(a: string, b: string, options?: {
|
|
|
327
328
|
}): StringDistanceResult | {
|
|
328
329
|
error: string;
|
|
329
330
|
};
|
|
331
|
+
interface SentenceLengthBucket {
|
|
332
|
+
label: string;
|
|
333
|
+
min: number;
|
|
334
|
+
max: number;
|
|
335
|
+
count: number;
|
|
336
|
+
}
|
|
337
|
+
interface SentenceLengthDistribution {
|
|
338
|
+
sentenceCount: number;
|
|
339
|
+
lengths: number[];
|
|
340
|
+
minLength: number;
|
|
341
|
+
maxLength: number;
|
|
342
|
+
meanLength: number;
|
|
343
|
+
medianLength: number;
|
|
344
|
+
stdDev: number;
|
|
345
|
+
coefficientOfVariation: number;
|
|
346
|
+
consistency: string;
|
|
347
|
+
buckets: SentenceLengthBucket[];
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Split text into sentences and report a histogram of sentence lengths (in
|
|
351
|
+
* words), plus mean/median/standard-deviation stats and a coefficient of
|
|
352
|
+
* variation, which is a distinct signal from the Flesch/Fog readability
|
|
353
|
+
* scores: two paragraphs can share the same reading grade while one alternates
|
|
354
|
+
* short and long sentences and the other stays uniform. Sentence splitting
|
|
355
|
+
* uses simple terminal-punctuation matching, so it can miscount abbreviations
|
|
356
|
+
* (e.g. "Dr.") as sentence boundaries.
|
|
357
|
+
*/
|
|
358
|
+
declare function analyzeSentenceLengths(text: string): SentenceLengthDistribution;
|
|
330
359
|
|
|
331
360
|
type text_AsciiFont = AsciiFont;
|
|
332
361
|
type text_AsciiOptions = AsciiOptions;
|
|
@@ -359,6 +388,8 @@ type text_PassiveVoiceResult = PassiveVoiceResult;
|
|
|
359
388
|
type text_PassiveVoiceSentence = PassiveVoiceSentence;
|
|
360
389
|
type text_ReadabilityResult = ReadabilityResult;
|
|
361
390
|
type text_ReadabilityScore = ReadabilityScore;
|
|
391
|
+
type text_SentenceLengthBucket = SentenceLengthBucket;
|
|
392
|
+
type text_SentenceLengthDistribution = SentenceLengthDistribution;
|
|
362
393
|
type text_SlugSeparator = SlugSeparator;
|
|
363
394
|
type text_StringDistanceMode = StringDistanceMode;
|
|
364
395
|
type text_StringDistanceResult = StringDistanceResult;
|
|
@@ -366,6 +397,7 @@ type text_TableOptions = TableOptions;
|
|
|
366
397
|
type text_TextAnalysis = TextAnalysis;
|
|
367
398
|
type text_WordCountResult = WordCountResult;
|
|
368
399
|
declare const text_addBorder: typeof addBorder;
|
|
400
|
+
declare const text_analyzeSentenceLengths: typeof analyzeSentenceLengths;
|
|
369
401
|
declare const text_analyzeText: typeof analyzeText;
|
|
370
402
|
declare const text_applyOp: typeof applyOp;
|
|
371
403
|
declare const text_applyOps: typeof applyOps;
|
|
@@ -419,7 +451,7 @@ declare const text_textToMorse: typeof textToMorse;
|
|
|
419
451
|
declare const text_unescapeString: typeof unescapeString;
|
|
420
452
|
declare const text_wordFrequency: typeof wordFrequency;
|
|
421
453
|
declare namespace text {
|
|
422
|
-
export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
|
|
454
|
+
export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_ESCAPE_MODES as ESCAPE_MODES, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
|
|
423
455
|
}
|
|
424
456
|
|
|
425
|
-
export {
|
|
457
|
+
export { detectFillerWords as $, type AsciiFont as A, type StringDistanceResult as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, ESCAPE_MODES as E, type FillerCategory as F, type TextAnalysis as G, addBorder as H, analyzeSentenceLengths as I, analyzeText as J, applyOp as K, LINE_OPS as L, MORSE_CODE as M, applyOps as N, calculateStringDistance as O, type ParsedDiff as P, centerText as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, convertAll as U, convertCase as V, type WordCountResult as W, countWords as X, csvToHtml as Y, csvToMarkdown as Z, detectDelimiter as _, type AsciiOptions as a, detectPassiveVoice as a0, diffLines as a1, diffLinesSimple as a2, diffStats as a3, escapeAll as a4, escapeString as a5, extractHeadings as a6, formatReadingTime as a7, generate as a8, generateDiff as a9, textToAscii as aA, textToMorse as aB, unescapeString as aC, wordFrequency as aD, generateHtmlTable as aa, generateMarkdownTable as ab, generateParagraphs as ac, generateSentences as ad, generateWords as ae, getAvailableFonts as af, getMorseForChar as ag, getMorseTiming as ah, htmlToMarkdown as ai, isValidMorse as aj, markdownToHtml as ak, morseToText as al, numberToOrdinal as am, numberToRoman as an, numberToWords as ao, ordinalWords as ap, parseDiff as aq, parseTableData as ar, readabilityScore as as, renderMarkdown as at, romanToNumber as au, scoreReadability as av, sentenceCount as aw, slugify as ax, slugifyAll as ay, syllableCount as az, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, type EscapeMode as j, type FillerMatch as k, type FillerWordResult as l, type LineOp as m, type LineType as n, type LoremUnit as o, type MarkdownResult as p, type MorseOptions as q, type ParsedTable as r, type PassiveVoiceMatch as s, text as t, type PassiveVoiceResult as u, type PassiveVoiceSentence as v, type ReadabilityScore as w, type SentenceLengthDistribution as x, type SlugSeparator as y, type StringDistanceMode as z };
|
package/dist/tools/ai_agent.cjs
CHANGED
|
@@ -946,6 +946,29 @@ function vectorSimilarity(a, b) {
|
|
|
946
946
|
magnitudeB: round6(magB)
|
|
947
947
|
};
|
|
948
948
|
}
|
|
949
|
+
function formatFewShotExamples(examples, format = "numbered", delimiter = "---") {
|
|
950
|
+
const valid = (examples ?? []).filter((e) => e?.input?.trim() && e?.output?.trim());
|
|
951
|
+
if (valid.length === 0) {
|
|
952
|
+
return { formatted: "", exampleCount: 0, format };
|
|
953
|
+
}
|
|
954
|
+
let formatted;
|
|
955
|
+
if (format === "xml") {
|
|
956
|
+
formatted = valid.map((e) => `<example>
|
|
957
|
+
<input>${e.input.trim()}</input>
|
|
958
|
+
<output>${e.output.trim()}</output>
|
|
959
|
+
</example>`).join("\n\n");
|
|
960
|
+
} else if (format === "delimiter") {
|
|
961
|
+
formatted = valid.map((e) => `Input: ${e.input.trim()}
|
|
962
|
+
Output: ${e.output.trim()}`).join(`
|
|
963
|
+
${delimiter}
|
|
964
|
+
`);
|
|
965
|
+
} else {
|
|
966
|
+
formatted = valid.map((e, i) => `Example ${i + 1}:
|
|
967
|
+
Input: ${e.input.trim()}
|
|
968
|
+
Output: ${e.output.trim()}`).join("\n\n");
|
|
969
|
+
}
|
|
970
|
+
return { formatted, exampleCount: valid.length, format };
|
|
971
|
+
}
|
|
949
972
|
|
|
950
973
|
exports.MODEL_PRICING = MODEL_PRICING;
|
|
951
974
|
exports.chunkText = chunkText;
|
|
@@ -966,6 +989,7 @@ exports.extractKeywords = extractKeywords;
|
|
|
966
989
|
exports.extractTables = extractTables;
|
|
967
990
|
exports.extractUrls = extractUrls;
|
|
968
991
|
exports.flattenJson = flattenJson;
|
|
992
|
+
exports.formatFewShotExamples = formatFewShotExamples;
|
|
969
993
|
exports.mergeJson = mergeJson;
|
|
970
994
|
exports.redactPii = redactPii;
|
|
971
995
|
exports.repairJson = repairJson;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ChunkStrategy, b as CompressHtmlResult, c as CompressJsonResult, d as CompressMarkdownResult, e as CostEstimate, D as DedupeResult, f as DedupeStrategy, g as DiffEntry2, h as DiffOp2, i as DiffResult2, E as Entity2, j as EntityType2, k as ExtractJsonResult, l as ExtractKeywordsResult, m as ExtractUrlsResult, I as InjectionDetectResult,
|
|
1
|
+
export { C as ChunkStrategy, b as CompressHtmlResult, c as CompressJsonResult, d as CompressMarkdownResult, e as CostEstimate, D as DedupeResult, f as DedupeStrategy, g as DiffEntry2, h as DiffOp2, i as DiffResult2, E as Entity2, j as EntityType2, k as ExtractJsonResult, l as ExtractKeywordsResult, m as ExtractUrlsResult, F as FewShotExample, n as FewShotFormat, o as FewShotFormatResult, I as InjectionDetectResult, p as InjectionFinding, J as JsonBlock, q as JsonRepairResult, K as Keyword, M as MODEL_PRICING, r as MergeResult, s as MergeStrategy, t as ModelPricing, P as PiiDetectResult, u as PiiFinding, v as PiiType, R as RankedChunk, w as RelevanceResult, S as SanitizeResult, x as SecretDetectResult, y as SecretFinding, z as SecretType, A as SummaryResult, T as TableResult2, B as TextChunk, G as TokenEstimate, H as TokenEstimateResult, L as TrimResult, N as TrimStrategy, U as UrlMatch, V as ValidationError, O as ValidationResult, Q as VectorSimilarityResult, W as chunkText, X as compressHtml, Y as compressJson, Z as compressMarkdown, _ as deduplicateLines, $ as detectPii, a0 as detectPromptInjection, a1 as detectSecrets, a2 as diffJson, a3 as estimateCost, a4 as estimateTokens, a5 as expandQuery, a6 as extractEntities, a7 as extractJson, a8 as extractKeywords, a9 as extractTables, aa as extractUrls, ab as flattenJson, ac as formatFewShotExamples, ad as mergeJson, ae as redactPii, af as repairJson, ag as rerankChunks, ah as sanitizeHtml, ai as scoreRelevance, aj as summarizeForLlm, ak as trimToTokens, al as unflattenJson, am as validateJsonSchema, an as vectorSimilarity } from '../ai_agent-C1zudGgT.cjs';
|
package/dist/tools/ai_agent.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ChunkStrategy, b as CompressHtmlResult, c as CompressJsonResult, d as CompressMarkdownResult, e as CostEstimate, D as DedupeResult, f as DedupeStrategy, g as DiffEntry2, h as DiffOp2, i as DiffResult2, E as Entity2, j as EntityType2, k as ExtractJsonResult, l as ExtractKeywordsResult, m as ExtractUrlsResult, I as InjectionDetectResult,
|
|
1
|
+
export { C as ChunkStrategy, b as CompressHtmlResult, c as CompressJsonResult, d as CompressMarkdownResult, e as CostEstimate, D as DedupeResult, f as DedupeStrategy, g as DiffEntry2, h as DiffOp2, i as DiffResult2, E as Entity2, j as EntityType2, k as ExtractJsonResult, l as ExtractKeywordsResult, m as ExtractUrlsResult, F as FewShotExample, n as FewShotFormat, o as FewShotFormatResult, I as InjectionDetectResult, p as InjectionFinding, J as JsonBlock, q as JsonRepairResult, K as Keyword, M as MODEL_PRICING, r as MergeResult, s as MergeStrategy, t as ModelPricing, P as PiiDetectResult, u as PiiFinding, v as PiiType, R as RankedChunk, w as RelevanceResult, S as SanitizeResult, x as SecretDetectResult, y as SecretFinding, z as SecretType, A as SummaryResult, T as TableResult2, B as TextChunk, G as TokenEstimate, H as TokenEstimateResult, L as TrimResult, N as TrimStrategy, U as UrlMatch, V as ValidationError, O as ValidationResult, Q as VectorSimilarityResult, W as chunkText, X as compressHtml, Y as compressJson, Z as compressMarkdown, _ as deduplicateLines, $ as detectPii, a0 as detectPromptInjection, a1 as detectSecrets, a2 as diffJson, a3 as estimateCost, a4 as estimateTokens, a5 as expandQuery, a6 as extractEntities, a7 as extractJson, a8 as extractKeywords, a9 as extractTables, aa as extractUrls, ab as flattenJson, ac as formatFewShotExamples, ad as mergeJson, ae as redactPii, af as repairJson, ag as rerankChunks, ah as sanitizeHtml, ai as scoreRelevance, aj as summarizeForLlm, ak as trimToTokens, al as unflattenJson, am as validateJsonSchema, an as vectorSimilarity } from '../ai_agent-C1zudGgT.js';
|
package/dist/tools/ai_agent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MODEL_PRICING, chunkText, compressHtml, compressJson, compressMarkdown, deduplicateLines, detectPii, detectPromptInjection, detectSecrets, diffJson, estimateCost, estimateTokens, expandQuery, extractEntities, extractJson, extractKeywords, extractTables, extractUrls, flattenJson, mergeJson, redactPii, repairJson, rerankChunks, sanitizeHtml, scoreRelevance, summarizeForLlm, trimToTokens, unflattenJson, validateJsonSchema, vectorSimilarity } from '../chunk-
|
|
1
|
+
export { MODEL_PRICING, chunkText, compressHtml, compressJson, compressMarkdown, deduplicateLines, detectPii, detectPromptInjection, detectSecrets, diffJson, estimateCost, estimateTokens, expandQuery, extractEntities, extractJson, extractKeywords, extractTables, extractUrls, flattenJson, formatFewShotExamples, mergeJson, redactPii, repairJson, rerankChunks, sanitizeHtml, scoreRelevance, summarizeForLlm, trimToTokens, unflattenJson, validateJsonSchema, vectorSimilarity } from '../chunk-W3J7GZVQ.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/code.cjs
CHANGED
|
@@ -2689,9 +2689,128 @@ function detectRedos(pattern) {
|
|
|
2689
2689
|
findings: unique
|
|
2690
2690
|
};
|
|
2691
2691
|
}
|
|
2692
|
+
var DEFAULT_COMMIT_TYPES = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test"];
|
|
2693
|
+
var _DEFAULT_MAX_HEADER_LENGTH = 100;
|
|
2694
|
+
var _COMMIT_HEADER_RE = /^([A-Za-z][A-Za-z0-9-]*)(\(([^()]*)\))?(!)?: (.+)$/;
|
|
2695
|
+
var _COMMIT_FOOTER_LINE_RE = /^([A-Za-z][A-Za-z0-9-]*|BREAKING CHANGE)(: ?| #)(.*)$/;
|
|
2696
|
+
var _COMMIT_BREAKING_LOOKALIKE_RE = /^([A-Za-z][A-Za-z -]*?)(: | #)(.*)$/;
|
|
2697
|
+
var _COMMIT_BREAKING_TOKEN_RE = /^breaking[- ]change$/i;
|
|
2698
|
+
function lintConventionalCommit(message, options = {}) {
|
|
2699
|
+
if (typeof message !== "string" || message.trim() === "") {
|
|
2700
|
+
return { error: "message is required" };
|
|
2701
|
+
}
|
|
2702
|
+
if (message.length > 2e4) {
|
|
2703
|
+
return { error: "message too long (max 20,000 chars)" };
|
|
2704
|
+
}
|
|
2705
|
+
const types = options.types && options.types.length > 0 ? options.types : DEFAULT_COMMIT_TYPES;
|
|
2706
|
+
const maxHeaderLength = options.maxHeaderLength ?? _DEFAULT_MAX_HEADER_LENGTH;
|
|
2707
|
+
const findings = [];
|
|
2708
|
+
const lines = message.replace(/\r\n/g, "\n").split("\n");
|
|
2709
|
+
const header = lines[0];
|
|
2710
|
+
const match = header.match(_COMMIT_HEADER_RE);
|
|
2711
|
+
const parsed = {
|
|
2712
|
+
header,
|
|
2713
|
+
type: null,
|
|
2714
|
+
scope: null,
|
|
2715
|
+
breaking: false,
|
|
2716
|
+
description: null,
|
|
2717
|
+
body: null,
|
|
2718
|
+
footers: []
|
|
2719
|
+
};
|
|
2720
|
+
if (!match) {
|
|
2721
|
+
findings.push({
|
|
2722
|
+
rule: "header-format",
|
|
2723
|
+
severity: "error",
|
|
2724
|
+
message: "Header must match '<type>[(scope)][!]: <description>', e.g. 'feat(auth): add OAuth2 login'. A single space must follow the colon."
|
|
2725
|
+
});
|
|
2726
|
+
return { message, valid: false, parsed, findings };
|
|
2727
|
+
}
|
|
2728
|
+
const [, type, scopeGroup, scope, bang, description] = match;
|
|
2729
|
+
parsed.type = type;
|
|
2730
|
+
if (scopeGroup !== void 0) {
|
|
2731
|
+
const scopeContent = (scope ?? "").trim();
|
|
2732
|
+
if (scopeContent === "") {
|
|
2733
|
+
findings.push({ rule: "scope-empty", severity: "error", message: "Scope parentheses are present but empty; either remove the parentheses or put a scope inside them, e.g. fix(parser):." });
|
|
2734
|
+
} else {
|
|
2735
|
+
parsed.scope = scopeContent;
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
const trimmedDescription = description.trim();
|
|
2739
|
+
if (trimmedDescription === "") {
|
|
2740
|
+
findings.push({ rule: "subject-empty", severity: "error", message: "The description after the colon must not be empty." });
|
|
2741
|
+
} else {
|
|
2742
|
+
parsed.description = trimmedDescription;
|
|
2743
|
+
if (trimmedDescription.endsWith(".")) {
|
|
2744
|
+
findings.push({ rule: "subject-full-stop", severity: "warning", message: "The description should not end with a period." });
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
if (!types.includes(type.toLowerCase())) {
|
|
2748
|
+
findings.push({
|
|
2749
|
+
rule: "type-unknown",
|
|
2750
|
+
severity: "warning",
|
|
2751
|
+
message: `'${type}' is not one of the recognized types (${types.join(", ")}). This is only a convention, not a spec requirement, so a custom type is fine if your team has agreed on it.`
|
|
2752
|
+
});
|
|
2753
|
+
}
|
|
2754
|
+
if (type !== type.toLowerCase()) {
|
|
2755
|
+
findings.push({ rule: "type-case", severity: "warning", message: "The type is conventionally lower-case. The spec itself is not case-sensitive about this, but nearly every tool and team defaults to lower-case." });
|
|
2756
|
+
}
|
|
2757
|
+
if (header.length > maxHeaderLength) {
|
|
2758
|
+
findings.push({ rule: "header-max-length", severity: "warning", message: `Header is ${header.length} characters, longer than the recommended maximum of ${maxHeaderLength}.` });
|
|
2759
|
+
}
|
|
2760
|
+
let breaking = bang === "!";
|
|
2761
|
+
if (lines.length > 1) {
|
|
2762
|
+
if (lines[1].trim() !== "") {
|
|
2763
|
+
findings.push({ rule: "missing-blank-line-before-body", severity: "error", message: "A blank line must separate the header from the body or footer." });
|
|
2764
|
+
}
|
|
2765
|
+
const rest = lines.slice(1).join("\n");
|
|
2766
|
+
const paragraphs = rest.split(/\n{2,}/).map((p) => p.trim()).filter((p) => p !== "");
|
|
2767
|
+
let footerParagraph = null;
|
|
2768
|
+
if (paragraphs.length > 0) {
|
|
2769
|
+
const last = paragraphs[paragraphs.length - 1];
|
|
2770
|
+
const lastLines = last.split("\n");
|
|
2771
|
+
if (lastLines.every((l) => _COMMIT_FOOTER_LINE_RE.test(l.trim()))) {
|
|
2772
|
+
footerParagraph = last;
|
|
2773
|
+
paragraphs.pop();
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
parsed.body = paragraphs.length > 0 ? paragraphs.join("\n\n") : null;
|
|
2777
|
+
if (footerParagraph) {
|
|
2778
|
+
for (const line of footerParagraph.split("\n")) {
|
|
2779
|
+
const fm = line.trim().match(_COMMIT_FOOTER_LINE_RE);
|
|
2780
|
+
if (!fm) continue;
|
|
2781
|
+
const [, token, , value] = fm;
|
|
2782
|
+
parsed.footers.push({ token, value: value.trim() });
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
for (const f of parsed.footers) {
|
|
2786
|
+
if (_COMMIT_BREAKING_TOKEN_RE.test(f.token) && f.token !== "BREAKING CHANGE" && f.token !== "BREAKING-CHANGE") {
|
|
2787
|
+
findings.push({ rule: "breaking-change-casing", severity: "error", message: `Found '${f.token}:' as a footer, but the spec requires the breaking-change token to be exactly 'BREAKING CHANGE' or 'BREAKING-CHANGE' (uppercase).` });
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
for (const p of paragraphs) {
|
|
2791
|
+
for (const line of p.split("\n")) {
|
|
2792
|
+
const bm = line.trim().match(_COMMIT_BREAKING_LOOKALIKE_RE);
|
|
2793
|
+
if (bm && _COMMIT_BREAKING_TOKEN_RE.test(bm[1]) && bm[1] !== "BREAKING CHANGE") {
|
|
2794
|
+
findings.push({ rule: "breaking-change-casing", severity: "error", message: `Found '${bm[1]}' near the end of the message, but it wasn't recognized as a breaking-change footer. The spec requires the exact uppercase token 'BREAKING CHANGE' (or 'BREAKING-CHANGE'), immediately followed by ': '.` });
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
const breakingFooter = parsed.footers.find((f) => f.token === "BREAKING CHANGE" || f.token === "BREAKING-CHANGE");
|
|
2800
|
+
if (breakingFooter) {
|
|
2801
|
+
breaking = true;
|
|
2802
|
+
if (breakingFooter.value === "") {
|
|
2803
|
+
findings.push({ rule: "breaking-change-empty", severity: "error", message: "A 'BREAKING CHANGE:' footer must be followed by a description of the breaking change." });
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
parsed.breaking = breaking;
|
|
2807
|
+
const valid = !findings.some((f) => f.severity === "error");
|
|
2808
|
+
return { message, valid, parsed, findings };
|
|
2809
|
+
}
|
|
2692
2810
|
|
|
2693
2811
|
exports.ALL_FLAGS = ALL_FLAGS;
|
|
2694
2812
|
exports.CHEATSHEET = CHEATSHEET;
|
|
2813
|
+
exports.DEFAULT_COMMIT_TYPES = DEFAULT_COMMIT_TYPES;
|
|
2695
2814
|
exports.MIME_TABLE = MIME_TABLE;
|
|
2696
2815
|
exports.OPERATIONS = OPERATIONS;
|
|
2697
2816
|
exports.SQL_DEFAULT_OPTIONS = SQL_DEFAULT_OPTIONS;
|
|
@@ -2716,6 +2835,7 @@ exports.getHtmlStats = getHtmlStats;
|
|
|
2716
2835
|
exports.getJsStats = getJsStats;
|
|
2717
2836
|
exports.getMethodColor = getMethodColor;
|
|
2718
2837
|
exports.isValidTag = isValidTag;
|
|
2838
|
+
exports.lintConventionalCommit = lintConventionalCommit;
|
|
2719
2839
|
exports.lookupMime = lookupMime;
|
|
2720
2840
|
exports.minifyCss = minifyCss;
|
|
2721
2841
|
exports.minifyGql = minifyGql;
|
package/dist/tools/code.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as CssResult, D as DockerImageRef, E as EnvEntry,
|
|
1
|
+
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as ConventionalCommitFinding, f as ConventionalCommitFooter, g as ConventionalCommitOptions, h as ConventionalCommitParsed, i as ConventionalCommitResult, j as ConventionalCommitSeverity, k as CssResult, D as DEFAULT_COMMIT_TYPES, l as DockerImageRef, E as EnvEntry, m as EnvParseResult, G as GitCommandConfig, n as GitCommandResult, o as GitOperation, p as GithubUrlInfo, q as GithubUrlType, r as GqlFormatResult, H as HtmlFormatResult, s as HtmlMinifyOptions, t as HtmlMinifyResult, J as JsMinifyOptions, u as JsMinifyResult, M as MIME_TABLE, v as MatchResult, w as MimeEntry, x as MimeLookupResult, O as OPERATIONS, P as ParsedSpec, R as RedosFinding, y as RedosResult, z as RedosSeverity, B as RegexError, F as RegexFlag, I as RegexMatch, K as RegexResult, L as RegexSuccess, S as SQL_DEFAULT_OPTIONS, N as Segment, Q as SpecVersion, T as SqlDialect, U as SqlFormatOptions, V as TestPatternResult, W as buildDockerPull, X as buildDockerRun, Y as buildGitCommand, Z as collapseHtmlWhitespace, _ as collapseJsWhitespace, $ as countProperties, a0 as countRules, a1 as detectDialect, a2 as detectOperationType, a3 as detectRedos, a4 as envToExport, a5 as envToJson, a6 as formatCss, a7 as formatGql, a8 as formatHtml, a9 as formatSql, aa as getEndpointsByTag, ab as getHtmlStats, ac as getJsStats, ad as getMethodColor, ae as isValidTag, af as lintConventionalCommit, ag as lookupMime, ah as minifyCss, ai as minifyGql, aj as minifyHtml, ak as minifyJs, al as minifySql, am as normalizeRef, an as parseDockerImage, ao as parseEnv, ap as parseGitCommand, aq as parseGithubUrl, ar as parseSpec, as as removeConsoleCalls, at as removeEmptyAttributes, au as removeHtmlComments, av as removeJsComments, aw as removeRedundantAttributes, ax as searchCheatsheet, ay as searchEndpoints, az as splitStatements, aA as testPattern, aB as testRegex, aC as validateEnvKey } from '../code-BK-x8hVx.cjs';
|
package/dist/tools/code.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as CssResult, D as DockerImageRef, E as EnvEntry,
|
|
1
|
+
export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as ConventionalCommitFinding, f as ConventionalCommitFooter, g as ConventionalCommitOptions, h as ConventionalCommitParsed, i as ConventionalCommitResult, j as ConventionalCommitSeverity, k as CssResult, D as DEFAULT_COMMIT_TYPES, l as DockerImageRef, E as EnvEntry, m as EnvParseResult, G as GitCommandConfig, n as GitCommandResult, o as GitOperation, p as GithubUrlInfo, q as GithubUrlType, r as GqlFormatResult, H as HtmlFormatResult, s as HtmlMinifyOptions, t as HtmlMinifyResult, J as JsMinifyOptions, u as JsMinifyResult, M as MIME_TABLE, v as MatchResult, w as MimeEntry, x as MimeLookupResult, O as OPERATIONS, P as ParsedSpec, R as RedosFinding, y as RedosResult, z as RedosSeverity, B as RegexError, F as RegexFlag, I as RegexMatch, K as RegexResult, L as RegexSuccess, S as SQL_DEFAULT_OPTIONS, N as Segment, Q as SpecVersion, T as SqlDialect, U as SqlFormatOptions, V as TestPatternResult, W as buildDockerPull, X as buildDockerRun, Y as buildGitCommand, Z as collapseHtmlWhitespace, _ as collapseJsWhitespace, $ as countProperties, a0 as countRules, a1 as detectDialect, a2 as detectOperationType, a3 as detectRedos, a4 as envToExport, a5 as envToJson, a6 as formatCss, a7 as formatGql, a8 as formatHtml, a9 as formatSql, aa as getEndpointsByTag, ab as getHtmlStats, ac as getJsStats, ad as getMethodColor, ae as isValidTag, af as lintConventionalCommit, ag as lookupMime, ah as minifyCss, ai as minifyGql, aj as minifyHtml, ak as minifyJs, al as minifySql, am as normalizeRef, an as parseDockerImage, ao as parseEnv, ap as parseGitCommand, aq as parseGithubUrl, ar as parseSpec, as as removeConsoleCalls, at as removeEmptyAttributes, au as removeHtmlComments, av as removeJsComments, aw as removeRedundantAttributes, ax as searchCheatsheet, ay as searchEndpoints, az as splitStatements, aA as testPattern, aB as testRegex, aC as validateEnvKey } from '../code-BK-x8hVx.js';
|
package/dist/tools/code.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ALL_FLAGS, CHEATSHEET, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, detectRedos, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey } from '../chunk-
|
|
1
|
+
export { ALL_FLAGS, CHEATSHEET, DEFAULT_COMMIT_TYPES, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, detectRedos, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lintConventionalCommit, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey } from '../chunk-UUT5HNST.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/text.cjs
CHANGED
|
@@ -2538,6 +2538,71 @@ function calculateStringDistance(a, b, options) {
|
|
|
2538
2538
|
const similarity = maxLength === 0 ? 1 : Math.round((1 - distance / maxLength) * 1e4) / 1e4;
|
|
2539
2539
|
return { a, b, distance, similarity, maxLength, mode };
|
|
2540
2540
|
}
|
|
2541
|
+
function splitIntoSentencesForLengthDist(text) {
|
|
2542
|
+
const matches = text.match(/[^.!?]+[.!?]*/g);
|
|
2543
|
+
if (!matches) return [];
|
|
2544
|
+
return matches.map((s) => s.trim()).filter((s) => s.length > 0);
|
|
2545
|
+
}
|
|
2546
|
+
function countWordsInSentence(sentence) {
|
|
2547
|
+
return (sentence.match(/[a-zA-Z']+/g) ?? []).length;
|
|
2548
|
+
}
|
|
2549
|
+
function analyzeSentenceLengths(text) {
|
|
2550
|
+
const sentences = splitIntoSentencesForLengthDist(text);
|
|
2551
|
+
const lengths = sentences.map(countWordsInSentence).filter((n) => n > 0);
|
|
2552
|
+
if (lengths.length === 0) {
|
|
2553
|
+
return {
|
|
2554
|
+
sentenceCount: 0,
|
|
2555
|
+
lengths: [],
|
|
2556
|
+
minLength: 0,
|
|
2557
|
+
maxLength: 0,
|
|
2558
|
+
meanLength: 0,
|
|
2559
|
+
medianLength: 0,
|
|
2560
|
+
stdDev: 0,
|
|
2561
|
+
coefficientOfVariation: 0,
|
|
2562
|
+
consistency: "No sentences to analyze",
|
|
2563
|
+
buckets: []
|
|
2564
|
+
};
|
|
2565
|
+
}
|
|
2566
|
+
const sentenceCount2 = lengths.length;
|
|
2567
|
+
const minLength = Math.min(...lengths);
|
|
2568
|
+
const maxLength = Math.max(...lengths);
|
|
2569
|
+
const meanLength = lengths.reduce((a, b) => a + b, 0) / sentenceCount2;
|
|
2570
|
+
const sorted = [...lengths].sort((a, b) => a - b);
|
|
2571
|
+
const mid = Math.floor(sorted.length / 2);
|
|
2572
|
+
const medianLength = sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
|
|
2573
|
+
const variance = lengths.reduce((sum, n) => sum + (n - meanLength) ** 2, 0) / sentenceCount2;
|
|
2574
|
+
const stdDev = Math.sqrt(variance);
|
|
2575
|
+
const coefficientOfVariation = meanLength > 0 ? stdDev / meanLength : 0;
|
|
2576
|
+
let consistency;
|
|
2577
|
+
if (coefficientOfVariation < 0.3) consistency = "Consistent \u2014 sentence lengths vary little";
|
|
2578
|
+
else if (coefficientOfVariation < 0.6) consistency = "Moderate variation in sentence length";
|
|
2579
|
+
else consistency = "Highly variable sentence length";
|
|
2580
|
+
const bucketWidth = 5;
|
|
2581
|
+
const bucketCount = Math.max(1, Math.ceil(maxLength / bucketWidth));
|
|
2582
|
+
const buckets = [];
|
|
2583
|
+
for (let i = 0; i < bucketCount; i++) {
|
|
2584
|
+
const min = i * bucketWidth + 1;
|
|
2585
|
+
const max = (i + 1) * bucketWidth;
|
|
2586
|
+
buckets.push({ label: `${min}-${max}`, min, max, count: 0 });
|
|
2587
|
+
}
|
|
2588
|
+
for (const len of lengths) {
|
|
2589
|
+
const idx = Math.min(Math.floor((len - 1) / bucketWidth), bucketCount - 1);
|
|
2590
|
+
buckets[idx].count++;
|
|
2591
|
+
}
|
|
2592
|
+
const round2 = (n) => Math.round(n * 100) / 100;
|
|
2593
|
+
return {
|
|
2594
|
+
sentenceCount: sentenceCount2,
|
|
2595
|
+
lengths,
|
|
2596
|
+
minLength,
|
|
2597
|
+
maxLength,
|
|
2598
|
+
meanLength: round2(meanLength),
|
|
2599
|
+
medianLength: round2(medianLength),
|
|
2600
|
+
stdDev: round2(stdDev),
|
|
2601
|
+
coefficientOfVariation: round2(coefficientOfVariation),
|
|
2602
|
+
consistency,
|
|
2603
|
+
buckets
|
|
2604
|
+
};
|
|
2605
|
+
}
|
|
2541
2606
|
|
|
2542
2607
|
exports.CASE_FORMATS = CASE_FORMATS;
|
|
2543
2608
|
exports.DEFAULT_CONVERT_OPTIONS = DEFAULT_CONVERT_OPTIONS;
|
|
@@ -2545,6 +2610,7 @@ exports.ESCAPE_MODES = ESCAPE_MODES;
|
|
|
2545
2610
|
exports.LINE_OPS = LINE_OPS;
|
|
2546
2611
|
exports.MORSE_CODE = MORSE_CODE;
|
|
2547
2612
|
exports.addBorder = addBorder;
|
|
2613
|
+
exports.analyzeSentenceLengths = analyzeSentenceLengths;
|
|
2548
2614
|
exports.analyzeText = analyzeText;
|
|
2549
2615
|
exports.applyOp = applyOp;
|
|
2550
2616
|
exports.applyOps = applyOps;
|
package/dist/tools/text.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AsciiFont, a as AsciiOptions, C as CASE_FORMATS, b as CaseFormat, c as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, d as DiffFile, e as DiffHunk, f as DiffLine, g as DiffResult, h as DiffType, i as DiffViewerLine, E as ESCAPE_MODES, j as EscapeMode, F as FillerCategory, k as FillerMatch, l as FillerWordResult, L as LINE_OPS, m as LineOp, n as LineType, o as LoremUnit, M as MORSE_CODE, p as MarkdownResult, q as MorseOptions, P as ParsedDiff, r as ParsedTable, s as PassiveVoiceMatch, u as PassiveVoiceResult, v as PassiveVoiceSentence, R as ReadabilityResult, w as ReadabilityScore, S as
|
|
1
|
+
export { A as AsciiFont, a as AsciiOptions, C as CASE_FORMATS, b as CaseFormat, c as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, d as DiffFile, e as DiffHunk, f as DiffLine, g as DiffResult, h as DiffType, i as DiffViewerLine, E as ESCAPE_MODES, j as EscapeMode, F as FillerCategory, k as FillerMatch, l as FillerWordResult, L as LINE_OPS, m as LineOp, n as LineType, o as LoremUnit, M as MORSE_CODE, p as MarkdownResult, q as MorseOptions, P as ParsedDiff, r as ParsedTable, s as PassiveVoiceMatch, u as PassiveVoiceResult, v as PassiveVoiceSentence, R as ReadabilityResult, w as ReadabilityScore, S as SentenceLengthBucket, x as SentenceLengthDistribution, y as SlugSeparator, z as StringDistanceMode, B as StringDistanceResult, T as TableOptions, G as TextAnalysis, W as WordCountResult, H as addBorder, I as analyzeSentenceLengths, J as analyzeText, K as applyOp, N as applyOps, O as calculateStringDistance, Q as centerText, U as convertAll, V as convertCase, X as countWords, Y as csvToHtml, Z as csvToMarkdown, _ as detectDelimiter, $ as detectFillerWords, a0 as detectPassiveVoice, a1 as diffLines, a2 as diffLinesSimple, a3 as diffStats, a4 as escapeAll, a5 as escapeString, a6 as extractHeadings, a7 as formatReadingTime, a8 as generate, a9 as generateDiff, aa as generateHtmlTable, ab as generateMarkdownTable, ac as generateParagraphs, ad as generateSentences, ae as generateWords, af as getAvailableFonts, ag as getMorseForChar, ah as getMorseTiming, ai as htmlToMarkdown, aj as isValidMorse, ak as markdownToHtml, al as morseToText, am as numberToOrdinal, an as numberToRoman, ao as numberToWords, ap as ordinalWords, aq as parseDiff, ar as parseTableData, as as readabilityScore, at as renderMarkdown, au as romanToNumber, av as scoreReadability, aw as sentenceCount, ax as slugify, ay as slugifyAll, az as syllableCount, aA as textToAscii, aB as textToMorse, aC as unescapeString, aD as wordFrequency } from '../text-CA-zuD0C.cjs';
|
package/dist/tools/text.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AsciiFont, a as AsciiOptions, C as CASE_FORMATS, b as CaseFormat, c as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, d as DiffFile, e as DiffHunk, f as DiffLine, g as DiffResult, h as DiffType, i as DiffViewerLine, E as ESCAPE_MODES, j as EscapeMode, F as FillerCategory, k as FillerMatch, l as FillerWordResult, L as LINE_OPS, m as LineOp, n as LineType, o as LoremUnit, M as MORSE_CODE, p as MarkdownResult, q as MorseOptions, P as ParsedDiff, r as ParsedTable, s as PassiveVoiceMatch, u as PassiveVoiceResult, v as PassiveVoiceSentence, R as ReadabilityResult, w as ReadabilityScore, S as
|
|
1
|
+
export { A as AsciiFont, a as AsciiOptions, C as CASE_FORMATS, b as CaseFormat, c as ConvertOptions, D as DEFAULT_CONVERT_OPTIONS, d as DiffFile, e as DiffHunk, f as DiffLine, g as DiffResult, h as DiffType, i as DiffViewerLine, E as ESCAPE_MODES, j as EscapeMode, F as FillerCategory, k as FillerMatch, l as FillerWordResult, L as LINE_OPS, m as LineOp, n as LineType, o as LoremUnit, M as MORSE_CODE, p as MarkdownResult, q as MorseOptions, P as ParsedDiff, r as ParsedTable, s as PassiveVoiceMatch, u as PassiveVoiceResult, v as PassiveVoiceSentence, R as ReadabilityResult, w as ReadabilityScore, S as SentenceLengthBucket, x as SentenceLengthDistribution, y as SlugSeparator, z as StringDistanceMode, B as StringDistanceResult, T as TableOptions, G as TextAnalysis, W as WordCountResult, H as addBorder, I as analyzeSentenceLengths, J as analyzeText, K as applyOp, N as applyOps, O as calculateStringDistance, Q as centerText, U as convertAll, V as convertCase, X as countWords, Y as csvToHtml, Z as csvToMarkdown, _ as detectDelimiter, $ as detectFillerWords, a0 as detectPassiveVoice, a1 as diffLines, a2 as diffLinesSimple, a3 as diffStats, a4 as escapeAll, a5 as escapeString, a6 as extractHeadings, a7 as formatReadingTime, a8 as generate, a9 as generateDiff, aa as generateHtmlTable, ab as generateMarkdownTable, ac as generateParagraphs, ad as generateSentences, ae as generateWords, af as getAvailableFonts, ag as getMorseForChar, ah as getMorseTiming, ai as htmlToMarkdown, aj as isValidMorse, ak as markdownToHtml, al as morseToText, am as numberToOrdinal, an as numberToRoman, ao as numberToWords, ap as ordinalWords, aq as parseDiff, ar as parseTableData, as as readabilityScore, at as renderMarkdown, au as romanToNumber, av as scoreReadability, aw as sentenceCount, ax as slugify, ay as slugifyAll, az as syllableCount, aA as textToAscii, aB as textToMorse, aC as unescapeString, aD as wordFrequency } from '../text-CA-zuD0C.js';
|
package/dist/tools/text.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CASE_FORMATS, DEFAULT_CONVERT_OPTIONS, ESCAPE_MODES, LINE_OPS, MORSE_CODE, addBorder, analyzeText, applyOp, applyOps, calculateStringDistance, centerText, convertAll, convertCase, countWords, csvToHtml, csvToMarkdown, detectDelimiter, detectFillerWords, detectPassiveVoice, diffLines, diffLinesSimple, diffStats, escapeAll, escapeString, extractHeadings, formatReadingTime, generate, generateDiff, generateHtmlTable, generateMarkdownTable, generateParagraphs, generateSentences, generateWords, getAvailableFonts, getMorseForChar, getMorseTiming, htmlToMarkdown, isValidMorse, markdownToHtml, morseToText, numberToOrdinal, numberToRoman, numberToWords, ordinalWords, parseDiff, parseTableData, readabilityScore, renderMarkdown, romanToNumber, scoreReadability, sentenceCount, slugify, slugifyAll, syllableCount, textToAscii, textToMorse, unescapeString, wordFrequency } from '../chunk-
|
|
1
|
+
export { CASE_FORMATS, DEFAULT_CONVERT_OPTIONS, ESCAPE_MODES, LINE_OPS, MORSE_CODE, addBorder, analyzeSentenceLengths, analyzeText, applyOp, applyOps, calculateStringDistance, centerText, convertAll, convertCase, countWords, csvToHtml, csvToMarkdown, detectDelimiter, detectFillerWords, detectPassiveVoice, diffLines, diffLinesSimple, diffStats, escapeAll, escapeString, extractHeadings, formatReadingTime, generate, generateDiff, generateHtmlTable, generateMarkdownTable, generateParagraphs, generateSentences, generateWords, getAvailableFonts, getMorseForChar, getMorseTiming, htmlToMarkdown, isValidMorse, markdownToHtml, morseToText, numberToOrdinal, numberToRoman, numberToWords, ordinalWords, parseDiff, parseTableData, readabilityScore, renderMarkdown, romanToNumber, scoreReadability, sentenceCount, slugify, slugifyAll, syllableCount, textToAscii, textToMorse, unescapeString, wordFrequency } from '../chunk-H2USEUHD.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|