@steipete/summarize-core 0.9.0 → 0.11.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/README.md +0 -1
- package/dist/esm/content/index.js +5 -5
- package/dist/esm/content/index.js.map +1 -1
- package/dist/esm/content/link-preview/client.js +23 -8
- package/dist/esm/content/link-preview/client.js.map +1 -1
- package/dist/esm/content/link-preview/content/article.js +84 -83
- package/dist/esm/content/link-preview/content/article.js.map +1 -1
- package/dist/esm/content/link-preview/content/cleaner.js +23 -20
- package/dist/esm/content/link-preview/content/cleaner.js.map +1 -1
- package/dist/esm/content/link-preview/content/constants.js.map +1 -1
- package/dist/esm/content/link-preview/content/fetcher.js +46 -40
- package/dist/esm/content/link-preview/content/fetcher.js.map +1 -1
- package/dist/esm/content/link-preview/content/firecrawl.js +18 -17
- package/dist/esm/content/link-preview/content/firecrawl.js.map +1 -1
- package/dist/esm/content/link-preview/content/html.js +31 -28
- package/dist/esm/content/link-preview/content/html.js.map +1 -1
- package/dist/esm/content/link-preview/content/index.js +173 -90
- package/dist/esm/content/link-preview/content/index.js.map +1 -1
- package/dist/esm/content/link-preview/content/jsonld.js +12 -12
- package/dist/esm/content/link-preview/content/jsonld.js.map +1 -1
- package/dist/esm/content/link-preview/content/parsers.js +20 -20
- package/dist/esm/content/link-preview/content/parsers.js.map +1 -1
- package/dist/esm/content/link-preview/content/podcast-utils.js +34 -34
- package/dist/esm/content/link-preview/content/podcast-utils.js.map +1 -1
- package/dist/esm/content/link-preview/content/readability.js +16 -15
- package/dist/esm/content/link-preview/content/readability.js.map +1 -1
- package/dist/esm/content/link-preview/content/twitter-utils.js +24 -11
- package/dist/esm/content/link-preview/content/twitter-utils.js.map +1 -1
- package/dist/esm/content/link-preview/content/types.js +1 -1
- package/dist/esm/content/link-preview/content/types.js.map +1 -1
- package/dist/esm/content/link-preview/content/utils.js +30 -22
- package/dist/esm/content/link-preview/content/utils.js.map +1 -1
- package/dist/esm/content/link-preview/content/video.js +19 -19
- package/dist/esm/content/link-preview/content/video.js.map +1 -1
- package/dist/esm/content/link-preview/content/visibility.js +121 -0
- package/dist/esm/content/link-preview/content/visibility.js.map +1 -0
- package/dist/esm/content/link-preview/content/youtube.js +10 -10
- package/dist/esm/content/link-preview/content/youtube.js.map +1 -1
- package/dist/esm/content/link-preview/deps.js +16 -16
- package/dist/esm/content/link-preview/deps.js.map +1 -1
- package/dist/esm/content/link-preview/fetch-with-timeout.js +4 -4
- package/dist/esm/content/link-preview/fetch-with-timeout.js.map +1 -1
- package/dist/esm/content/link-preview/types.js +1 -1
- package/dist/esm/content/link-preview/types.js.map +1 -1
- package/dist/esm/content/transcript/cache.js +47 -22
- package/dist/esm/content/transcript/cache.js.map +1 -1
- package/dist/esm/content/transcript/index.js +71 -25
- package/dist/esm/content/transcript/index.js.map +1 -1
- package/dist/esm/content/transcript/normalize.js +10 -10
- package/dist/esm/content/transcript/normalize.js.map +1 -1
- package/dist/esm/content/transcript/parse.js +125 -13
- package/dist/esm/content/transcript/parse.js.map +1 -1
- package/dist/esm/content/transcript/providers/generic.js +112 -81
- package/dist/esm/content/transcript/providers/generic.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/apple-flow.js +38 -36
- package/dist/esm/content/transcript/providers/podcast/apple-flow.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/apple.js +5 -5
- package/dist/esm/content/transcript/providers/podcast/apple.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/constants.js +2 -2
- package/dist/esm/content/transcript/providers/podcast/constants.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/itunes.js +44 -42
- package/dist/esm/content/transcript/providers/podcast/itunes.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/json.js +4 -4
- package/dist/esm/content/transcript/providers/podcast/json.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/media.js +66 -56
- package/dist/esm/content/transcript/providers/podcast/media.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/results.js +2 -2
- package/dist/esm/content/transcript/providers/podcast/results.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/rss.js +42 -28
- package/dist/esm/content/transcript/providers/podcast/rss.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/spotify-flow.js +39 -38
- package/dist/esm/content/transcript/providers/podcast/spotify-flow.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/spotify.js +32 -32
- package/dist/esm/content/transcript/providers/podcast/spotify.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast.js +52 -43
- package/dist/esm/content/transcript/providers/podcast.js.map +1 -1
- package/dist/esm/content/transcript/providers/transcription-start.js +78 -0
- package/dist/esm/content/transcript/providers/transcription-start.js.map +1 -0
- package/dist/esm/content/transcript/providers/youtube/api.js +74 -57
- package/dist/esm/content/transcript/providers/youtube/api.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube/apify.js +7 -7
- package/dist/esm/content/transcript/providers/youtube/apify.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube/captions.js +112 -74
- package/dist/esm/content/transcript/providers/youtube/captions.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube/yt-dlp.js +161 -101
- package/dist/esm/content/transcript/providers/youtube/yt-dlp.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube.js +97 -80
- package/dist/esm/content/transcript/providers/youtube.js.map +1 -1
- package/dist/esm/content/transcript/timestamps.js +79 -0
- package/dist/esm/content/transcript/timestamps.js.map +1 -0
- package/dist/esm/content/transcript/transcription-config.js +14 -0
- package/dist/esm/content/transcript/transcription-config.js.map +1 -0
- package/dist/esm/content/transcript/utils.js +35 -35
- package/dist/esm/content/transcript/utils.js.map +1 -1
- package/dist/esm/content/url.js +59 -28
- package/dist/esm/content/url.js.map +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/language.js +77 -77
- package/dist/esm/language.js.map +1 -1
- package/dist/esm/openai/base-url.js +35 -0
- package/dist/esm/openai/base-url.js.map +1 -0
- package/dist/esm/processes.js +121 -0
- package/dist/esm/processes.js.map +1 -0
- package/dist/esm/prompts/cli.js +17 -17
- package/dist/esm/prompts/cli.js.map +1 -1
- package/dist/esm/prompts/file.js +56 -40
- package/dist/esm/prompts/file.js.map +1 -1
- package/dist/esm/prompts/format.js +2 -2
- package/dist/esm/prompts/format.js.map +1 -1
- package/dist/esm/prompts/index.js +5 -4
- package/dist/esm/prompts/index.js.map +1 -1
- package/dist/esm/prompts/link-summary.js +96 -46
- package/dist/esm/prompts/link-summary.js.map +1 -1
- package/dist/esm/prompts/summary-lengths.js +10 -10
- package/dist/esm/prompts/summary-lengths.js.map +1 -1
- package/dist/esm/prompts/summary-system.js +13 -0
- package/dist/esm/prompts/summary-system.js.map +1 -0
- package/dist/esm/shared/contracts.js +1 -1
- package/dist/esm/shared/contracts.js.map +1 -1
- package/dist/esm/transcription/onnx-cli.js +319 -0
- package/dist/esm/transcription/onnx-cli.js.map +1 -0
- package/dist/esm/transcription/whisper/constants.js +3 -3
- package/dist/esm/transcription/whisper/constants.js.map +1 -1
- package/dist/esm/transcription/whisper/core.js +209 -52
- package/dist/esm/transcription/whisper/core.js.map +1 -1
- package/dist/esm/transcription/whisper/fal.js +14 -14
- package/dist/esm/transcription/whisper/fal.js.map +1 -1
- package/dist/esm/transcription/whisper/ffmpeg.js +134 -82
- package/dist/esm/transcription/whisper/ffmpeg.js.map +1 -1
- package/dist/esm/transcription/whisper/groq.js +46 -0
- package/dist/esm/transcription/whisper/groq.js.map +1 -0
- package/dist/esm/transcription/whisper/openai.js +19 -13
- package/dist/esm/transcription/whisper/openai.js.map +1 -1
- package/dist/esm/transcription/whisper/utils.js +19 -19
- package/dist/esm/transcription/whisper/utils.js.map +1 -1
- package/dist/esm/transcription/whisper/whisper-cpp.js +68 -58
- package/dist/esm/transcription/whisper/whisper-cpp.js.map +1 -1
- package/dist/esm/transcription/whisper.js +4 -4
- package/dist/esm/transcription/whisper.js.map +1 -1
- package/dist/types/content/cache/types.d.ts +25 -1
- package/dist/types/content/index.d.ts +7 -7
- package/dist/types/content/link-preview/client.d.ts +9 -4
- package/dist/types/content/link-preview/content/cleaner.d.ts +1 -0
- package/dist/types/content/link-preview/content/fetcher.d.ts +2 -2
- package/dist/types/content/link-preview/content/firecrawl.d.ts +8 -7
- package/dist/types/content/link-preview/content/html.d.ts +9 -8
- package/dist/types/content/link-preview/content/index.d.ts +3 -3
- package/dist/types/content/link-preview/content/twitter-utils.d.ts +1 -0
- package/dist/types/content/link-preview/content/types.d.ts +13 -8
- package/dist/types/content/link-preview/content/utils.d.ts +3 -3
- package/dist/types/content/link-preview/content/video.d.ts +1 -1
- package/dist/types/content/link-preview/content/visibility.d.ts +1 -0
- package/dist/types/content/link-preview/deps.d.ts +44 -28
- package/dist/types/content/link-preview/types.d.ts +10 -4
- package/dist/types/content/transcript/cache.d.ts +9 -6
- package/dist/types/content/transcript/index.d.ts +9 -6
- package/dist/types/content/transcript/parse.d.ts +7 -0
- package/dist/types/content/transcript/providers/generic.d.ts +1 -1
- package/dist/types/content/transcript/providers/podcast/apple-flow.d.ts +2 -2
- package/dist/types/content/transcript/providers/podcast/flow-context.d.ts +4 -4
- package/dist/types/content/transcript/providers/podcast/media.d.ts +10 -6
- package/dist/types/content/transcript/providers/podcast/results.d.ts +3 -3
- package/dist/types/content/transcript/providers/podcast/rss.d.ts +2 -0
- package/dist/types/content/transcript/providers/podcast/spotify-flow.d.ts +2 -2
- package/dist/types/content/transcript/providers/podcast/spotify.d.ts +2 -2
- package/dist/types/content/transcript/providers/podcast.d.ts +5 -5
- package/dist/types/content/transcript/providers/transcription-start.d.ts +32 -0
- package/dist/types/content/transcript/providers/youtube/api.d.ts +7 -2
- package/dist/types/content/transcript/providers/youtube/captions.d.ts +6 -1
- package/dist/types/content/transcript/providers/youtube/yt-dlp.d.ts +13 -6
- package/dist/types/content/transcript/providers/youtube.d.ts +1 -1
- package/dist/types/content/transcript/timestamps.d.ts +5 -0
- package/dist/types/content/transcript/transcription-config.d.ts +15 -0
- package/dist/types/content/transcript/types.d.ts +15 -7
- package/dist/types/content/transcript/utils.d.ts +1 -1
- package/dist/types/content/url.d.ts +5 -3
- package/dist/types/index.d.ts +5 -4
- package/dist/types/language.d.ts +4 -4
- package/dist/types/openai/base-url.d.ts +14 -0
- package/dist/types/processes.d.ts +50 -0
- package/dist/types/prompts/cli.d.ts +3 -3
- package/dist/types/prompts/file.d.ts +2 -2
- package/dist/types/prompts/index.d.ts +6 -5
- package/dist/types/prompts/link-summary.d.ts +9 -4
- package/dist/types/prompts/summary-lengths.d.ts +1 -1
- package/dist/types/prompts/summary-system.d.ts +1 -0
- package/dist/types/transcription/onnx-cli.d.ts +25 -0
- package/dist/types/transcription/whisper/core.d.ts +10 -3
- package/dist/types/transcription/whisper/ffmpeg.d.ts +5 -0
- package/dist/types/transcription/whisper/groq.d.ts +2 -0
- package/dist/types/transcription/whisper/openai.d.ts +6 -1
- package/dist/types/transcription/whisper/types.d.ts +1 -1
- package/dist/types/transcription/whisper/whisper-cpp.d.ts +1 -1
- package/dist/types/transcription/whisper.d.ts +5 -5
- package/package.json +24 -18
- package/LICENSE +0 -21
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { formatOutputLanguageInstruction } from
|
|
2
|
-
import { buildInstructions, buildTaggedPrompt } from
|
|
3
|
-
import { formatPresetLengthGuidance, resolveSummaryLengthSpec, SUMMARY_LENGTH_MAX_CHARACTERS, SUMMARY_LENGTH_TO_TOKENS, } from
|
|
1
|
+
import { formatOutputLanguageInstruction } from "../language.js";
|
|
2
|
+
import { buildInstructions, buildTaggedPrompt } from "./format.js";
|
|
3
|
+
import { formatPresetLengthGuidance, resolveSummaryLengthSpec, SUMMARY_LENGTH_MAX_CHARACTERS, SUMMARY_LENGTH_TO_TOKENS, } from "./summary-lengths.js";
|
|
4
4
|
const HEADING_LENGTH_CHAR_THRESHOLD = 6000;
|
|
5
5
|
export { SUMMARY_LENGTH_TO_TOKENS };
|
|
6
6
|
export function pickSummaryLengthForCharacters(maxCharacters) {
|
|
7
7
|
if (maxCharacters <= SUMMARY_LENGTH_MAX_CHARACTERS.short)
|
|
8
|
-
return
|
|
8
|
+
return "short";
|
|
9
9
|
if (maxCharacters <= SUMMARY_LENGTH_MAX_CHARACTERS.medium)
|
|
10
|
-
return
|
|
10
|
+
return "medium";
|
|
11
11
|
if (maxCharacters <= SUMMARY_LENGTH_MAX_CHARACTERS.long)
|
|
12
|
-
return
|
|
12
|
+
return "long";
|
|
13
13
|
if (maxCharacters <= SUMMARY_LENGTH_MAX_CHARACTERS.xl)
|
|
14
|
-
return
|
|
15
|
-
return
|
|
14
|
+
return "xl";
|
|
15
|
+
return "xxl";
|
|
16
16
|
}
|
|
17
17
|
export function estimateMaxCompletionTokensForCharacters(maxCharacters) {
|
|
18
18
|
const estimate = Math.ceil(maxCharacters / 4);
|
|
19
19
|
return Math.max(256, estimate);
|
|
20
20
|
}
|
|
21
21
|
const formatCount = (value) => value.toLocaleString();
|
|
22
|
-
export function buildLinkSummaryPrompt({ url, title, siteName, description, content, truncated, hasTranscript, outputLanguage, summaryLength, shares, promptOverride, lengthInstruction, languageInstruction, }) {
|
|
23
|
-
const
|
|
22
|
+
export function buildLinkSummaryPrompt({ url, title, siteName, description, content, truncated, hasTranscript, hasTranscriptTimestamps = false, slides, outputLanguage, summaryLength, shares, promptOverride, lengthInstruction, languageInstruction, }) {
|
|
23
|
+
const slidesText = slides?.text?.trim() ?? "";
|
|
24
|
+
const contentWithSlides = slidesText.length > 0
|
|
25
|
+
? `${content}\n\nSlide timeline (transcript excerpts):\n${slidesText}`
|
|
26
|
+
: content;
|
|
27
|
+
const contentCharacters = contentWithSlides.length;
|
|
24
28
|
const contextLines = [`Source URL: ${url}`];
|
|
25
29
|
if (title) {
|
|
26
|
-
contextLines.push(`
|
|
30
|
+
contextLines.push(`Page name: ${title}`);
|
|
27
31
|
}
|
|
28
32
|
if (siteName) {
|
|
29
33
|
contextLines.push(`Site: ${siteName}`);
|
|
@@ -32,85 +36,131 @@ export function buildLinkSummaryPrompt({ url, title, siteName, description, cont
|
|
|
32
36
|
contextLines.push(`Page description: ${description}`);
|
|
33
37
|
}
|
|
34
38
|
if (truncated) {
|
|
35
|
-
contextLines.push(
|
|
39
|
+
contextLines.push("Note: Content truncated to the first portion available.");
|
|
36
40
|
}
|
|
37
|
-
const contextHeader = contextLines.join(
|
|
41
|
+
const contextHeader = contextLines.join("\n");
|
|
38
42
|
const audienceLine = hasTranscript
|
|
39
|
-
?
|
|
40
|
-
:
|
|
41
|
-
const effectiveSummaryLength = typeof summaryLength ===
|
|
43
|
+
? "You summarize online videos for curious Twitter users who want to know whether the clip is worth watching."
|
|
44
|
+
: "You summarize online articles for curious Twitter users who want the gist before deciding to dive in.";
|
|
45
|
+
const effectiveSummaryLength = typeof summaryLength === "string"
|
|
42
46
|
? summaryLength
|
|
43
47
|
: contentCharacters > 0 && summaryLength.maxCharacters > contentCharacters
|
|
44
48
|
? { maxCharacters: contentCharacters }
|
|
45
49
|
: summaryLength;
|
|
46
|
-
const preset = typeof effectiveSummaryLength ===
|
|
50
|
+
const preset = typeof effectiveSummaryLength === "string"
|
|
47
51
|
? effectiveSummaryLength
|
|
48
52
|
: pickSummaryLengthForCharacters(effectiveSummaryLength.maxCharacters);
|
|
49
53
|
const directive = resolveSummaryLengthSpec(preset);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
const formattingLine = slides && slides.count > 0
|
|
55
|
+
? "Use the slide format below. Do not add extra sections or list items outside the intro and slides."
|
|
56
|
+
: directive.formatting;
|
|
57
|
+
const presetLengthLine = typeof effectiveSummaryLength === "string" ? formatPresetLengthGuidance(preset) : "";
|
|
58
|
+
const needsHeadings = preset === "xl" ||
|
|
59
|
+
preset === "xxl" ||
|
|
60
|
+
(typeof effectiveSummaryLength !== "string" &&
|
|
54
61
|
effectiveSummaryLength.maxCharacters >= HEADING_LENGTH_CHAR_THRESHOLD);
|
|
55
|
-
const headingInstruction =
|
|
56
|
-
?
|
|
57
|
-
:
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
const headingInstruction = slides && slides.count > 0
|
|
63
|
+
? "Do not create a dedicated Slides section or list."
|
|
64
|
+
: needsHeadings
|
|
65
|
+
? 'Use Markdown headings with the "### " prefix to break sections. Include at least 3 headings and start with a heading. Do not use bold for headings.'
|
|
66
|
+
: "";
|
|
67
|
+
const maxCharactersLine = typeof effectiveSummaryLength === "string"
|
|
68
|
+
? ""
|
|
60
69
|
: `Target length: up to ${formatCount(effectiveSummaryLength.maxCharacters)} characters total (including Markdown and whitespace). Hard limit: do not exceed it.`;
|
|
61
70
|
const contentLengthLine = contentCharacters > 0
|
|
62
71
|
? `Extracted content length: ${formatCount(contentCharacters)} characters. Hard limit: never exceed this length. If the requested length is larger, do not pad—finish early rather than adding filler.`
|
|
63
|
-
:
|
|
72
|
+
: "";
|
|
64
73
|
const shareLines = shares.map((share) => {
|
|
65
74
|
const handle = share.handle && share.handle.length > 0 ? `@${share.handle}` : share.author;
|
|
66
75
|
const metrics = [];
|
|
67
|
-
if (typeof share.likeCount ===
|
|
76
|
+
if (typeof share.likeCount === "number" && share.likeCount > 0) {
|
|
68
77
|
metrics.push(`${formatCount(share.likeCount)} likes`);
|
|
69
78
|
}
|
|
70
|
-
if (typeof share.reshareCount ===
|
|
79
|
+
if (typeof share.reshareCount === "number" && share.reshareCount > 0) {
|
|
71
80
|
metrics.push(`${formatCount(share.reshareCount)} reshares`);
|
|
72
81
|
}
|
|
73
|
-
if (typeof share.replyCount ===
|
|
82
|
+
if (typeof share.replyCount === "number" && share.replyCount > 0) {
|
|
74
83
|
metrics.push(`${formatCount(share.replyCount)} replies`);
|
|
75
84
|
}
|
|
76
|
-
const metricsSuffix = metrics.length > 0 ? ` [${metrics.join(
|
|
77
|
-
const timestamp = share.timestamp ? ` (${share.timestamp})` :
|
|
85
|
+
const metricsSuffix = metrics.length > 0 ? ` [${metrics.join(", ")}]` : "";
|
|
86
|
+
const timestamp = share.timestamp ? ` (${share.timestamp})` : "";
|
|
78
87
|
return `- ${handle}${timestamp}${metricsSuffix}: ${share.text}`;
|
|
79
88
|
});
|
|
80
89
|
const shareGuidance = shares.length > 0
|
|
81
90
|
? 'You are also given quotes from people who recently shared this link. When these quotes contain substantive commentary, append a brief subsection titled "What sharers are saying" with one or two bullet points summarizing the key reactions. If they are generic reshares with no commentary, omit that subsection.'
|
|
82
91
|
: 'You are not given any quotes from people who shared this link. Do not fabricate reactions or add a "What sharers are saying" subsection.';
|
|
83
|
-
const shareBlock = shares.length > 0 ? `Tweets from sharers:\n${shareLines.join(
|
|
92
|
+
const shareBlock = shares.length > 0 ? `Tweets from sharers:\n${shareLines.join("\n")}` : "";
|
|
93
|
+
const timestampInstruction = hasTranscriptTimestamps && !(slides && slides.count > 0)
|
|
94
|
+
? 'Add a "Key moments" section with 3-6 bullets (2-4 if the summary is short). Start each bullet with a [mm:ss] (or [hh:mm:ss]) timestamp from the transcript. Keep the rest of the summary readable and follow the normal formatting guidance; do not prepend timestamps outside the Key moments section. Do not invent timestamps or use ranges.'
|
|
95
|
+
: "";
|
|
96
|
+
const slideMarkers = slides && slides.count > 0
|
|
97
|
+
? Array.from({ length: slides.count }, (_, index) => `[slide:${index + 1}]`).join(" ")
|
|
98
|
+
: "";
|
|
99
|
+
const slideTemplate = slides && slides.count > 0
|
|
100
|
+
? [
|
|
101
|
+
"Slide format example (follow this pattern; markers on their own lines):",
|
|
102
|
+
"Intro paragraph.",
|
|
103
|
+
"[slide:1]",
|
|
104
|
+
"## Example headline",
|
|
105
|
+
"Example sentence.",
|
|
106
|
+
"[slide:2]",
|
|
107
|
+
"## Example headline",
|
|
108
|
+
"Example sentence.",
|
|
109
|
+
].join("\n")
|
|
110
|
+
: "";
|
|
111
|
+
const slideInstruction = slides && slides.count > 0
|
|
112
|
+
? [
|
|
113
|
+
slideTemplate,
|
|
114
|
+
"Repeat the 3-line slide block for every marker below, in order.",
|
|
115
|
+
'Every slide must include a headline line that starts with "## ".',
|
|
116
|
+
"If there is no obvious title, create a short 2-6 word headline from the slide content.",
|
|
117
|
+
'Never output "Title:" or "Slide 1/10".',
|
|
118
|
+
`Required markers (use each exactly once, in order): ${slideMarkers}`,
|
|
119
|
+
].join("\n")
|
|
120
|
+
: "";
|
|
121
|
+
const listGuidanceLine = "Use short paragraphs; use bullet lists only when they improve scanability; avoid rigid templates.";
|
|
122
|
+
const quoteGuidanceLine = "Include 1-2 short exact excerpts (max 25 words each) formatted as Markdown italics using single asterisks when there is a strong, non-sponsor line. Use straight quotation marks (no curly) as needed. If no suitable line exists, omit excerpts. Never include ad/sponsor/boilerplate excerpts and do not mention them.";
|
|
123
|
+
const sponsorInstruction = hasTranscript || (slides && slides.count > 0)
|
|
124
|
+
? "Omit sponsor messages, ads, promos, and calls-to-action (including podcast ad reads), even if they appear in the transcript or slide timeline. Do not mention or acknowledge them, and do not say you skipped or ignored anything. Avoid sponsor/ad/promo language, brand names like Squarespace, or CTA phrases like discount code. Treat them as if they do not exist. If a slide segment is purely sponsor/ad content, leave that slide marker with no text."
|
|
125
|
+
: "";
|
|
84
126
|
const baseInstructions = [
|
|
127
|
+
"Hard rules: never mention sponsor/ads; use straight quotation marks only (no curly quotes).",
|
|
128
|
+
"Apostrophes in contractions are OK.",
|
|
85
129
|
audienceLine,
|
|
130
|
+
sponsorInstruction,
|
|
86
131
|
directive.guidance,
|
|
87
|
-
|
|
132
|
+
formattingLine,
|
|
88
133
|
headingInstruction,
|
|
89
134
|
presetLengthLine,
|
|
90
135
|
maxCharactersLine,
|
|
91
136
|
contentLengthLine,
|
|
92
|
-
formatOutputLanguageInstruction(outputLanguage ?? { kind:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
formatOutputLanguageInstruction(outputLanguage ?? { kind: "auto" }),
|
|
138
|
+
"Keep the response compact by avoiding blank lines between sentences or list items; use only the single newlines required by the formatting instructions.",
|
|
139
|
+
"Do not use emojis, disclaimers, or speculation.",
|
|
140
|
+
"Write in direct, factual language.",
|
|
141
|
+
"Format the answer in Markdown and obey the length-specific formatting above.",
|
|
142
|
+
listGuidanceLine,
|
|
143
|
+
quoteGuidanceLine,
|
|
144
|
+
"Base everything strictly on the provided content and never invent details.",
|
|
145
|
+
"Final check: remove any sponsor/ad references or mentions of skipping/ignoring content. Ensure excerpts (if any) are italicized and use only straight quotes.",
|
|
146
|
+
'Final check for slides: every [slide:N] must be immediately followed by a line that starts with "## ". Remove any "Title:" or "Slide" label lines.',
|
|
147
|
+
timestampInstruction,
|
|
99
148
|
shareGuidance,
|
|
149
|
+
slideInstruction,
|
|
100
150
|
]
|
|
101
|
-
.filter((line) => typeof line ===
|
|
102
|
-
.join(
|
|
151
|
+
.filter((line) => typeof line === "string" && line.trim().length > 0)
|
|
152
|
+
.join("\n");
|
|
103
153
|
const instructions = buildInstructions({
|
|
104
154
|
base: baseInstructions,
|
|
105
155
|
overrides: { promptOverride, lengthInstruction, languageInstruction },
|
|
106
156
|
});
|
|
107
157
|
const context = [contextHeader, shareBlock]
|
|
108
|
-
.filter((line) => typeof line ===
|
|
109
|
-
.join(
|
|
158
|
+
.filter((line) => typeof line === "string" && line.trim().length > 0)
|
|
159
|
+
.join("\n");
|
|
110
160
|
return buildTaggedPrompt({
|
|
111
161
|
instructions,
|
|
112
162
|
context,
|
|
113
|
-
content,
|
|
163
|
+
content: contentWithSlides,
|
|
114
164
|
});
|
|
115
165
|
}
|
|
116
166
|
//# sourceMappingURL=link-summary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-summary.js","sourceRoot":"","sources":["../../../src/prompts/link-summary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link-summary.js","sourceRoot":"","sources":["../../../src/prompts/link-summary.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE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ClB,gBAAgB;QAChB,iBAAiB;QACjB,iBAAiB;QACjB,+BAA+B,CAAC,cAAc,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACnE,0JAA0J;QAC1J,iDAAiD;QACjD,oCAAoC;QACpC,8EAA8E;QAC9E,gBAAgB;QAChB,iBAAiB;QACjB,4EAA4E;QAC5E,+JAA+J;QAC/J,oJAAoJ;QACpJ,oBAAoB;QACpB,aAAa;QACb,gBAAgB;KACjB;SACE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACpE,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,YAAY,GAAG,iBAAiB,CAAC;QACrC,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,EAA4B;KAChG,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,CAAC,aAAa,EAAE,UAAU,CAAC;SACxC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACpE,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,iBAAiB,CAAC;QACvB,YAAY;QACZ,OAAO;QACP,OAAO,EAAE,iBAAiB;KAC3B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
export const SUMMARY_LENGTH_SPECS = {
|
|
2
2
|
short: {
|
|
3
|
-
guidance:
|
|
4
|
-
formatting:
|
|
3
|
+
guidance: "Write a tight summary that delivers the primary claim plus one high-signal supporting detail.",
|
|
4
|
+
formatting: "Use 1-2 short paragraphs (a single paragraph is fine). Aim for 2-5 sentences total.",
|
|
5
5
|
targetCharacters: 900,
|
|
6
6
|
minCharacters: 600,
|
|
7
7
|
maxCharacters: 1200,
|
|
8
8
|
maxTokens: 768,
|
|
9
9
|
},
|
|
10
10
|
medium: {
|
|
11
|
-
guidance:
|
|
12
|
-
formatting:
|
|
11
|
+
guidance: "Write a clear summary that covers the core claim plus the most important supporting evidence or data points.",
|
|
12
|
+
formatting: "Use 1-3 short paragraphs (2 is typical, but a single paragraph is okay if the content is simple). Aim for 2-3 sentences per paragraph.",
|
|
13
13
|
targetCharacters: 1800,
|
|
14
14
|
minCharacters: 1200,
|
|
15
15
|
maxCharacters: 2500,
|
|
16
16
|
maxTokens: 1536,
|
|
17
17
|
},
|
|
18
18
|
long: {
|
|
19
|
-
guidance:
|
|
20
|
-
formatting:
|
|
19
|
+
guidance: "Write a detailed summary that prioritizes the most important points first, followed by key supporting facts or events, then secondary details or conclusions stated in the source.",
|
|
20
|
+
formatting: "Paragraphs are optional; use up to 3 short paragraphs. Aim for 2-4 sentences per paragraph when you split into paragraphs.",
|
|
21
21
|
targetCharacters: 4200,
|
|
22
22
|
minCharacters: 2500,
|
|
23
23
|
maxCharacters: 6000,
|
|
24
24
|
maxTokens: 3072,
|
|
25
25
|
},
|
|
26
26
|
xl: {
|
|
27
|
-
guidance:
|
|
28
|
-
formatting:
|
|
27
|
+
guidance: "Write a detailed summary that captures the main points, supporting facts, and concrete numbers or quotes when present.",
|
|
28
|
+
formatting: "Use 2-5 short paragraphs. Aim for 2-4 sentences per paragraph.",
|
|
29
29
|
targetCharacters: 9000,
|
|
30
30
|
minCharacters: 6000,
|
|
31
31
|
maxCharacters: 14000,
|
|
32
32
|
maxTokens: 6144,
|
|
33
33
|
},
|
|
34
34
|
xxl: {
|
|
35
|
-
guidance:
|
|
36
|
-
formatting:
|
|
35
|
+
guidance: "Write a comprehensive summary that covers background, main points, evidence, and stated outcomes in the source text; avoid adding implications or recommendations unless explicitly stated.",
|
|
36
|
+
formatting: "Use 3-7 short paragraphs. Aim for 2-4 sentences per paragraph.",
|
|
37
37
|
targetCharacters: 17000,
|
|
38
38
|
minCharacters: 14000,
|
|
39
39
|
maxCharacters: 22000,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary-lengths.js","sourceRoot":"","sources":["../../../src/prompts/summary-lengths.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,oBAAoB,GAA6C;IAC5E,KAAK,EAAE;QACL,QAAQ,EACN,+FAA+F;QACjG,UAAU,EACR,qFAAqF;QACvF,gBAAgB,EAAE,GAAG;QACrB,aAAa,EAAE,GAAG;QAClB,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,GAAG;KACf;IACD,MAAM,EAAE;QACN,QAAQ,EACN,8GAA8G;QAChH,UAAU,EACR,wIAAwI;QAC1I,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,IAAI;QACnB,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,IAAI;KAChB;IACD,IAAI,EAAE;QACJ,QAAQ,EACN,oLAAoL;QACtL,UAAU,EACR,4HAA4H;QAC9H,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,IAAI;QACnB,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,IAAI;KAChB;IACD,EAAE,EAAE;QACF,QAAQ,EACN,wHAAwH;QAC1H,UAAU,EAAE,gEAAgE;QAC5E,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,IAAI;QACnB,aAAa,EAAE,KAAK;QACpB,SAAS,EAAE,IAAI;KAChB;IACD,GAAG,EAAE;QACH,QAAQ,EACN,6LAA6L;QAC/L,UAAU,EAAE,gEAAgE;QAC5E,gBAAgB,EAAE,KAAK;QACvB,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,KAAK;QACpB,SAAS,EAAE,KAAK;KACjB;CACF,
|
|
1
|
+
{"version":3,"file":"summary-lengths.js","sourceRoot":"","sources":["../../../src/prompts/summary-lengths.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,oBAAoB,GAA6C;IAC5E,KAAK,EAAE;QACL,QAAQ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CAC/F,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,CACvD,CAAC;AAEnC,MAAM,CAAC,MAAM,6BAA6B,GAAkC,MAAM,CAAC,WAAW,CAC5F,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CACpD,CAAC;AAEnC,MAAM,UAAU,wBAAwB,CAAC,MAAqB;IAC5D,oGAAoG;IACpG,4DAA4D;IAC5D,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,MAAqB;IAC9D,MAAM,IAAI,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,yBAAyB,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,iCAAiC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,kDAAkD,CAAC;AAC1N,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const SUMMARY_SYSTEM_PROMPT = [
|
|
2
|
+
"You are a precise summarization engine.",
|
|
3
|
+
"Follow the user instructions in <instructions> exactly.",
|
|
4
|
+
"Never mention sponsors/ads/promos or that they were skipped or ignored.",
|
|
5
|
+
"Do not output sponsor/ad/promo language or brand names (for example Squarespace) or CTA phrases (for example discount code).",
|
|
6
|
+
'If the instructions include [slide:N] markers, you must output those markers exactly on their own lines and never output "Slide X" / "Slide X/Y" label lines.',
|
|
7
|
+
'Never output the literal strings "Title:" or "Headline:" anywhere; use Markdown heading syntax (## Heading) instead.',
|
|
8
|
+
"Quotation marks are allowed; use straight quotes only (no curly quotes).",
|
|
9
|
+
"If you include exact excerpts, italicize them in Markdown using single asterisks.",
|
|
10
|
+
"Include 1-2 short exact excerpts (max 25 words each) when the content provides a strong, non-sponsor line.",
|
|
11
|
+
"Never include ad/sponsor/boilerplate excerpts.",
|
|
12
|
+
].join("\n");
|
|
13
|
+
//# sourceMappingURL=summary-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary-system.js","sourceRoot":"","sources":["../../../src/prompts/summary-system.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,yCAAyC;IACzC,yDAAyD;IACzD,yEAAyE;IACzE,8HAA8H;IAC9H,+JAA+J;IAC/J,sHAAsH;IACtH,0EAA0E;IAC1E,mFAAmF;IACnF,4GAA4G;IAC5G,gDAAgD;CACjD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const SUMMARY_LENGTHS = [
|
|
1
|
+
export const SUMMARY_LENGTHS = ["short", "medium", "long", "xl", "xxl"];
|
|
2
2
|
//# sourceMappingURL=contracts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/shared/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAU,
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/shared/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC"}
|