@steipete/summarize-core 0.10.0 → 0.11.1
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 +20 -9
- 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 +16 -16
- package/dist/esm/content/link-preview/content/firecrawl.js.map +1 -1
- package/dist/esm/content/link-preview/content/html.js +29 -27
- package/dist/esm/content/link-preview/content/html.js.map +1 -1
- package/dist/esm/content/link-preview/content/index.js +141 -88
- 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 +17 -17
- 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 +22 -22
- package/dist/esm/content/transcript/cache.js.map +1 -1
- package/dist/esm/content/transcript/index.js +34 -24
- 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 +31 -31
- package/dist/esm/content/transcript/parse.js.map +1 -1
- package/dist/esm/content/transcript/providers/generic.js +74 -78
- package/dist/esm/content/transcript/providers/generic.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/apple-flow.js +36 -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 +58 -49
- 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 +29 -29
- package/dist/esm/content/transcript/providers/podcast/rss.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/spotify-flow.js +38 -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 +43 -47
- package/dist/esm/content/transcript/providers/podcast.js.map +1 -1
- package/dist/esm/content/transcript/providers/transcription-start.js +59 -31
- package/dist/esm/content/transcript/providers/transcription-start.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube/api.js +56 -56
- 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 +76 -76
- package/dist/esm/content/transcript/providers/youtube/captions.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube/yt-dlp.js +82 -75
- package/dist/esm/content/transcript/providers/youtube/yt-dlp.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube.js +84 -77
- package/dist/esm/content/transcript/providers/youtube.js.map +1 -1
- package/dist/esm/content/transcript/timestamps.js +8 -8
- package/dist/esm/content/transcript/timestamps.js.map +1 -1
- 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 +16 -16
- package/dist/esm/processes.js.map +1 -1
- package/dist/esm/prompts/cli.js +17 -17
- package/dist/esm/prompts/cli.js.map +1 -1
- package/dist/esm/prompts/file.js +54 -54
- 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 -5
- package/dist/esm/prompts/index.js.map +1 -1
- package/dist/esm/prompts/link-summary.js +65 -65
- 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 +9 -9
- package/dist/esm/prompts/summary-system.js.map +1 -1
- package/dist/esm/shared/contracts.js +1 -1
- package/dist/esm/shared/contracts.js.map +1 -1
- package/dist/esm/transcription/onnx-cli.js +69 -69
- package/dist/esm/transcription/onnx-cli.js.map +1 -1
- 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 +148 -59
- 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 +106 -106
- 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 +64 -64
- 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 +1 -1
- package/dist/types/content/index.d.ts +7 -7
- package/dist/types/content/link-preview/client.d.ts +7 -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 +7 -7
- package/dist/types/content/link-preview/content/html.d.ts +8 -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 +8 -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 +36 -33
- package/dist/types/content/link-preview/types.d.ts +4 -4
- package/dist/types/content/transcript/cache.d.ts +4 -4
- package/dist/types/content/transcript/index.d.ts +7 -7
- package/dist/types/content/transcript/parse.d.ts +1 -1
- 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 +9 -6
- package/dist/types/content/transcript/providers/podcast/results.d.ts +3 -3
- package/dist/types/content/transcript/providers/podcast/rss.d.ts +1 -1
- 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 +14 -8
- package/dist/types/content/transcript/providers/youtube/api.d.ts +1 -1
- package/dist/types/content/transcript/providers/youtube/captions.d.ts +1 -1
- package/dist/types/content/transcript/providers/youtube/yt-dlp.d.ts +11 -8
- package/dist/types/content/transcript/providers/youtube.d.ts +1 -1
- package/dist/types/content/transcript/timestamps.d.ts +1 -1
- package/dist/types/content/transcript/transcription-config.d.ts +15 -0
- package/dist/types/content/transcript/types.d.ts +12 -9
- 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 +2 -2
- 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 -6
- package/dist/types/prompts/link-summary.d.ts +3 -3
- package/dist/types/prompts/summary-lengths.d.ts +1 -1
- package/dist/types/transcription/onnx-cli.d.ts +3 -3
- package/dist/types/transcription/whisper/core.d.ts +6 -3
- 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 +13 -13
package/dist/esm/prompts/cli.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { formatOutputLanguageInstruction } from
|
|
2
|
-
import { buildInstructions, buildTaggedPrompt } from
|
|
3
|
-
import { pickSummaryLengthForCharacters } from
|
|
4
|
-
import { formatPresetLengthGuidance, resolveSummaryLengthSpec } from
|
|
1
|
+
import { formatOutputLanguageInstruction } from "../language.js";
|
|
2
|
+
import { buildInstructions, buildTaggedPrompt } from "./format.js";
|
|
3
|
+
import { pickSummaryLengthForCharacters } from "./link-summary.js";
|
|
4
|
+
import { formatPresetLengthGuidance, resolveSummaryLengthSpec } from "./summary-lengths.js";
|
|
5
5
|
function formatTargetLength(summaryLength) {
|
|
6
|
-
if (typeof summaryLength ===
|
|
6
|
+
if (typeof summaryLength === "string")
|
|
7
7
|
return formatPresetLengthGuidance(summaryLength);
|
|
8
8
|
const max = summaryLength.maxCharacters;
|
|
9
9
|
return `Target length: around ${max.toLocaleString()} characters total (including Markdown and whitespace). This is a soft guideline; prioritize clarity.`;
|
|
10
10
|
}
|
|
11
11
|
export function buildPathSummaryPrompt({ kindLabel, filePath, filename, mediaType, outputLanguage, summaryLength, promptOverride, lengthInstruction, languageInstruction, }) {
|
|
12
|
-
const preset = typeof summaryLength ===
|
|
12
|
+
const preset = typeof summaryLength === "string"
|
|
13
13
|
? summaryLength
|
|
14
14
|
: pickSummaryLengthForCharacters(summaryLength.maxCharacters);
|
|
15
15
|
const directive = resolveSummaryLengthSpec(preset);
|
|
@@ -20,29 +20,29 @@ export function buildPathSummaryPrompt({ kindLabel, filePath, filename, mediaTyp
|
|
|
20
20
|
].filter(Boolean);
|
|
21
21
|
const maxCharactersLine = formatTargetLength(summaryLength);
|
|
22
22
|
const baseInstructions = [
|
|
23
|
-
`You summarize ${kindLabel ===
|
|
23
|
+
`You summarize ${kindLabel === "image" ? "images" : "files"} for curious users.`,
|
|
24
24
|
`Summarize the ${kindLabel} at the path below.`,
|
|
25
|
-
|
|
25
|
+
"Be factual and do not invent details.",
|
|
26
26
|
directive.guidance,
|
|
27
27
|
directive.formatting,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
"Format the answer in Markdown.",
|
|
29
|
+
"Use short paragraphs; use bullet lists only when they improve scanability; avoid rigid templates.",
|
|
30
|
+
"Do not use emojis.",
|
|
31
31
|
maxCharactersLine,
|
|
32
|
-
formatOutputLanguageInstruction(outputLanguage ?? { kind:
|
|
33
|
-
|
|
32
|
+
formatOutputLanguageInstruction(outputLanguage ?? { kind: "auto" }),
|
|
33
|
+
"Return only the summary.",
|
|
34
34
|
]
|
|
35
|
-
.filter((line) => typeof line ===
|
|
36
|
-
.join(
|
|
35
|
+
.filter((line) => typeof line === "string" && line.trim().length > 0)
|
|
36
|
+
.join("\n");
|
|
37
37
|
const instructions = buildInstructions({
|
|
38
38
|
base: baseInstructions,
|
|
39
39
|
overrides: { promptOverride, lengthInstruction, languageInstruction },
|
|
40
40
|
});
|
|
41
|
-
const context = headerLines.join(
|
|
41
|
+
const context = headerLines.join("\n");
|
|
42
42
|
return buildTaggedPrompt({
|
|
43
43
|
instructions,
|
|
44
44
|
context,
|
|
45
|
-
content:
|
|
45
|
+
content: "",
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/prompts/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/prompts/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAwB,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAA4B,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAE5F,SAAS,kBAAkB,CAAC,aAAkC;IAC5D,IAAI,OAAO,aAAa,KAAK,QAAQ;QAAE,OAAO,0BAA0B,CAAC,aAAa,CAAC,CAAC;IACxF,MAAM,GAAG,GAAG,aAAa,CAAC,aAAa,CAAC;IACxC,OAAO,yBAAyB,GAAG,CAAC,cAAc,EAAE,sGAAsG,CAAC;AAC7J,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EACrC,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,cAAc,EACd,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,GAWpB;IACC,MAAM,MAAM,GACV,OAAO,aAAa,KAAK,QAAQ;QAC/B,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,8BAA8B,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,wBAAwB,CAAC,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formatOutputLanguageInstruction } from
|
|
2
|
-
import { buildInstructions, buildTaggedPrompt } from
|
|
3
|
-
import { pickSummaryLengthForCharacters } from
|
|
4
|
-
import { formatPresetLengthGuidance, resolveSummaryLengthSpec } from
|
|
1
|
+
import { formatOutputLanguageInstruction } from "../language.js";
|
|
2
|
+
import { buildInstructions, buildTaggedPrompt } from "./format.js";
|
|
3
|
+
import { pickSummaryLengthForCharacters } from "./link-summary.js";
|
|
4
|
+
import { formatPresetLengthGuidance, resolveSummaryLengthSpec } from "./summary-lengths.js";
|
|
5
5
|
export function buildFileSummaryPrompt({ filename, mediaType, outputLanguage, summaryLength, contentLength, promptOverride, lengthInstruction, languageInstruction, }) {
|
|
6
|
-
const shouldIgnoreSponsors = Boolean(mediaType?.startsWith(
|
|
7
|
-
const contentCharacters = typeof contentLength ===
|
|
8
|
-
const effectiveSummaryLength = typeof summaryLength ===
|
|
6
|
+
const shouldIgnoreSponsors = Boolean(mediaType?.startsWith("audio/") || mediaType?.startsWith("video/"));
|
|
7
|
+
const contentCharacters = typeof contentLength === "number" ? contentLength : null;
|
|
8
|
+
const effectiveSummaryLength = typeof summaryLength === "string"
|
|
9
9
|
? summaryLength
|
|
10
10
|
: contentCharacters &&
|
|
11
11
|
contentCharacters > 0 &&
|
|
12
12
|
summaryLength.maxCharacters > contentCharacters
|
|
13
13
|
? { maxCharacters: contentCharacters }
|
|
14
14
|
: summaryLength;
|
|
15
|
-
const preset = typeof effectiveSummaryLength ===
|
|
15
|
+
const preset = typeof effectiveSummaryLength === "string"
|
|
16
16
|
? effectiveSummaryLength
|
|
17
17
|
: pickSummaryLengthForCharacters(effectiveSummaryLength.maxCharacters);
|
|
18
18
|
const directive = resolveSummaryLengthSpec(preset);
|
|
19
|
-
const presetLengthLine = typeof effectiveSummaryLength ===
|
|
20
|
-
const maxCharactersLine = typeof effectiveSummaryLength ===
|
|
21
|
-
?
|
|
19
|
+
const presetLengthLine = typeof effectiveSummaryLength === "string" ? formatPresetLengthGuidance(preset) : "";
|
|
20
|
+
const maxCharactersLine = typeof effectiveSummaryLength === "string"
|
|
21
|
+
? ""
|
|
22
22
|
: `Target length: up to ${effectiveSummaryLength.maxCharacters.toLocaleString()} characters total (including Markdown and whitespace). Hard limit: do not exceed it.`;
|
|
23
23
|
const contentLengthLine = contentCharacters && contentCharacters > 0
|
|
24
24
|
? `Extracted content length: ${contentCharacters.toLocaleString()} characters. Hard limit: never exceed this length. If the requested length is larger, do not pad—finish early rather than adding filler.`
|
|
25
|
-
:
|
|
25
|
+
: "";
|
|
26
26
|
const headerLines = [
|
|
27
27
|
filename ? `Filename: ${filename}` : null,
|
|
28
28
|
mediaType ? `Media type: ${mediaType}` : null,
|
|
29
29
|
].filter(Boolean);
|
|
30
30
|
const baseInstructions = [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
"Hard rules: never mention sponsor/ads; never output quotation marks of any kind (straight or curly), even for titles.",
|
|
32
|
+
"Never include quotation marks in the output. Apostrophes in contractions are OK. If a title or excerpt would normally use quotes, remove them and optionally italicize the text instead.",
|
|
33
|
+
"You summarize files for curious users.",
|
|
34
|
+
"Summarize the attached file.",
|
|
35
|
+
"Be factual and do not invent details.",
|
|
36
36
|
shouldIgnoreSponsors
|
|
37
|
-
?
|
|
38
|
-
:
|
|
37
|
+
? "Omit sponsor messages, ads, promos, and calls-to-action (including podcast ad reads), even if they appear in the transcript. 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."
|
|
38
|
+
: "",
|
|
39
39
|
directive.guidance,
|
|
40
40
|
directive.formatting,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
"Format the answer in Markdown.",
|
|
42
|
+
"Use short paragraphs; use bullet lists only when they improve scanability; avoid rigid templates.",
|
|
43
|
+
"If a standout line is present, include 1-2 short exact excerpts (max 25 words each) formatted as Markdown italics using single asterisks only. Do not use quotation marks of any kind (straight or curly). Remove any quotation marks from excerpts. If you cannot format an italic excerpt, omit it. Never include ad/sponsor/boilerplate excerpts and do not mention them.",
|
|
44
|
+
"Do not use emojis.",
|
|
45
45
|
presetLengthLine,
|
|
46
46
|
maxCharactersLine,
|
|
47
47
|
contentLengthLine,
|
|
48
|
-
formatOutputLanguageInstruction(outputLanguage ?? { kind:
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
formatOutputLanguageInstruction(outputLanguage ?? { kind: "auto" }),
|
|
49
|
+
"Final check: remove any sponsor/ad references or mentions of skipping/ignoring content. Remove any quotation marks. Ensure standout excerpts are italicized; otherwise omit them.",
|
|
50
|
+
"Return only the summary.",
|
|
51
51
|
]
|
|
52
|
-
.filter((line) => typeof line ===
|
|
53
|
-
.join(
|
|
52
|
+
.filter((line) => typeof line === "string" && line.trim().length > 0)
|
|
53
|
+
.join("\n");
|
|
54
54
|
const instructions = buildInstructions({
|
|
55
55
|
base: baseInstructions,
|
|
56
56
|
overrides: { promptOverride, lengthInstruction, languageInstruction },
|
|
57
57
|
});
|
|
58
|
-
const context = headerLines.join(
|
|
58
|
+
const context = headerLines.join("\n");
|
|
59
59
|
return buildTaggedPrompt({
|
|
60
60
|
instructions,
|
|
61
61
|
context,
|
|
62
|
-
content:
|
|
62
|
+
content: "",
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
export function buildFileTextSummaryPrompt({ filename, originalMediaType, contentMediaType, outputLanguage, summaryLength, contentLength, content, promptOverride, lengthInstruction, languageInstruction, }) {
|
|
66
|
-
const shouldIgnoreSponsors = Boolean(originalMediaType?.startsWith(
|
|
67
|
-
const effectiveSummaryLength = typeof summaryLength ===
|
|
66
|
+
const shouldIgnoreSponsors = Boolean(originalMediaType?.startsWith("audio/") || originalMediaType?.startsWith("video/"));
|
|
67
|
+
const effectiveSummaryLength = typeof summaryLength === "string"
|
|
68
68
|
? summaryLength
|
|
69
69
|
: summaryLength.maxCharacters > contentLength
|
|
70
70
|
? { maxCharacters: contentLength }
|
|
71
71
|
: summaryLength;
|
|
72
|
-
const preset = typeof effectiveSummaryLength ===
|
|
72
|
+
const preset = typeof effectiveSummaryLength === "string"
|
|
73
73
|
? effectiveSummaryLength
|
|
74
74
|
: pickSummaryLengthForCharacters(effectiveSummaryLength.maxCharacters);
|
|
75
75
|
const directive = resolveSummaryLengthSpec(preset);
|
|
76
|
-
const presetLengthLine = typeof effectiveSummaryLength ===
|
|
77
|
-
const maxCharactersLine = typeof effectiveSummaryLength ===
|
|
78
|
-
?
|
|
76
|
+
const presetLengthLine = typeof effectiveSummaryLength === "string" ? formatPresetLengthGuidance(preset) : "";
|
|
77
|
+
const maxCharactersLine = typeof effectiveSummaryLength === "string"
|
|
78
|
+
? ""
|
|
79
79
|
: `Target length: up to ${effectiveSummaryLength.maxCharacters.toLocaleString()} characters total (including Markdown and whitespace). Hard limit: do not exceed it.`;
|
|
80
80
|
const headerLines = [
|
|
81
81
|
filename ? `Filename: ${filename}` : null,
|
|
@@ -84,34 +84,34 @@ export function buildFileTextSummaryPrompt({ filename, originalMediaType, conten
|
|
|
84
84
|
`Extracted content length: ${contentLength.toLocaleString()} characters. Hard limit: never exceed this length. If the requested length is larger, do not pad—finish early rather than adding filler.`,
|
|
85
85
|
].filter(Boolean);
|
|
86
86
|
const baseInstructions = [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
"Hard rules: never mention sponsor/ads; never output quotation marks of any kind (straight or curly), even for titles.",
|
|
88
|
+
"Never include quotation marks in the output. Apostrophes in contractions are OK. If a title or excerpt would normally use quotes, remove them and optionally italicize the text instead.",
|
|
89
|
+
"You summarize files for curious users.",
|
|
90
|
+
"Summarize the file content below.",
|
|
91
|
+
"Be factual and do not invent details.",
|
|
92
92
|
shouldIgnoreSponsors
|
|
93
|
-
?
|
|
94
|
-
:
|
|
93
|
+
? "Omit sponsor messages, ads, promos, and calls-to-action (including podcast ad reads), even if they appear in the transcript. 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."
|
|
94
|
+
: "",
|
|
95
95
|
directive.guidance,
|
|
96
96
|
directive.formatting,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
"Format the answer in Markdown.",
|
|
98
|
+
"Use short paragraphs; use bullet lists only when they improve scanability; avoid rigid templates.",
|
|
99
|
+
"If a standout line is present, include 1-2 short exact excerpts (max 25 words each) formatted as Markdown italics using single asterisks only. Do not use quotation marks of any kind (straight or curly). Remove any quotation marks from excerpts. If you cannot format an italic excerpt, omit it. Never include ad/sponsor/boilerplate excerpts and do not mention them.",
|
|
100
|
+
"Do not use emojis.",
|
|
101
101
|
presetLengthLine,
|
|
102
102
|
maxCharactersLine,
|
|
103
|
-
formatOutputLanguageInstruction(outputLanguage ?? { kind:
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
formatOutputLanguageInstruction(outputLanguage ?? { kind: "auto" }),
|
|
104
|
+
"Final check: remove any sponsor/ad references or mentions of skipping/ignoring content. Remove any quotation marks. Ensure standout excerpts are italicized; otherwise omit them.",
|
|
105
|
+
"Return only the summary.",
|
|
106
106
|
]
|
|
107
|
-
.filter((line) => typeof line ===
|
|
108
|
-
.join(
|
|
107
|
+
.filter((line) => typeof line === "string" && line.trim().length > 0)
|
|
108
|
+
.join("\n");
|
|
109
109
|
const instructions = buildInstructions({
|
|
110
110
|
base: baseInstructions,
|
|
111
111
|
overrides: { promptOverride, lengthInstruction, languageInstruction },
|
|
112
112
|
});
|
|
113
|
-
const context = headerLines.join(
|
|
114
|
-
const contentText = typeof content ===
|
|
113
|
+
const context = headerLines.join("\n");
|
|
114
|
+
const contentText = typeof content === "string" ? content : "";
|
|
115
115
|
return buildTaggedPrompt({
|
|
116
116
|
instructions,
|
|
117
117
|
context,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/prompts/file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/prompts/file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAwB,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAA4B,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAE5F,MAAM,UAAU,sBAAsB,CAAC,EACrC,QAAQ,EACR,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,GAUpB;IACC,MAAM,oBAAoB,GAAG,OAAO,CAClC,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,IAAI,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,CACnE,CAAC;IACF,MAAM,iBAAiB,GAAG,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;IACnF,MAAM,sBAAsB,GAC1B,OAAO,aAAa,KAAK,QAAQ;QAC/B,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,iBAAiB;YACf,iBAAiB,GAAG,CAAC;YACrB,aAAa,CAAC,aAAa,GAAG,iBAAiB;YACjD,CAAC,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE;YACtC,CAAC,CAAC,aAAa,CAAC;IACtB,MAAM,MAAM,GACV,OAAO,sBAAsB,KAAK,QAAQ;QACxC,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,8BAA8B,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAC3E,MAAM,SAAS,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,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AAC,CAAC,CAAC,EAAE,CAAC;IAE/D,OAAO,iBAAiB,CAAC;QACvB,YAAY;QACZ,OAAO;QACP,OAAO,EAAE,WAAW;KACrB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -15,12 +15,12 @@ export function buildInstructions({ base, overrides, }) {
|
|
|
15
15
|
const languageInstruction = overrides?.languageInstruction?.trim();
|
|
16
16
|
if (languageInstruction)
|
|
17
17
|
lines.push(languageInstruction);
|
|
18
|
-
return lines.join(
|
|
18
|
+
return lines.join("\n");
|
|
19
19
|
}
|
|
20
20
|
export function buildTaggedPrompt({ instructions, context, content, }) {
|
|
21
21
|
const safeInstructions = instructions.trim();
|
|
22
22
|
const safeContext = context.trim();
|
|
23
|
-
const safeContent = typeof content ===
|
|
23
|
+
const safeContent = typeof content === "string" ? content : "";
|
|
24
24
|
return `<instructions>\n${safeInstructions}\n</instructions>\n\n<context>\n${safeContext}\n</context>\n\n<content>\n${safeContent}\n</content>\n`;
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/prompts/format.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,SAAS,GAIV;IACC,MAAM,KAAK,GAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/prompts/format.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,SAAS,GAIV;IACC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;IACnD,IAAI,QAAQ,EAAE,CAAC;QACb,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAChC,IAAI,WAAW;YAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,iBAAiB,GAAG,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;IAC/D,IAAI,iBAAiB;QAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAErD,MAAM,mBAAmB,GAAG,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC;IACnE,IAAI,mBAAmB;QAAE,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAEzD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAChC,YAAY,EACZ,OAAO,EACP,OAAO,GAKR;IACC,MAAM,gBAAgB,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,WAAW,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/D,OAAO,mBAAmB,gBAAgB,mCAAmC,WAAW,8BAA8B,WAAW,gBAAgB,CAAC;AACpJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { buildPathSummaryPrompt } from
|
|
2
|
-
export { buildFileSummaryPrompt, buildFileTextSummaryPrompt } from
|
|
3
|
-
export { buildLinkSummaryPrompt, estimateMaxCompletionTokensForCharacters, pickSummaryLengthForCharacters, SUMMARY_LENGTH_TO_TOKENS, } from
|
|
4
|
-
export { formatPresetLengthGuidance, resolveSummaryLengthSpec, SUMMARY_LENGTH_MAX_CHARACTERS, SUMMARY_LENGTH_SPECS, SUMMARY_LENGTH_TARGET_CHARACTERS, } from
|
|
5
|
-
export { SUMMARY_SYSTEM_PROMPT } from
|
|
1
|
+
export { buildPathSummaryPrompt } from "./cli.js";
|
|
2
|
+
export { buildFileSummaryPrompt, buildFileTextSummaryPrompt } from "./file.js";
|
|
3
|
+
export { buildLinkSummaryPrompt, estimateMaxCompletionTokensForCharacters, pickSummaryLengthForCharacters, SUMMARY_LENGTH_TO_TOKENS, } from "./link-summary.js";
|
|
4
|
+
export { formatPresetLengthGuidance, resolveSummaryLengthSpec, SUMMARY_LENGTH_MAX_CHARACTERS, SUMMARY_LENGTH_SPECS, SUMMARY_LENGTH_TARGET_CHARACTERS, } from "./summary-lengths.js";
|
|
5
|
+
export { SUMMARY_SYSTEM_PROMPT } from "./summary-system.js";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EACL,sBAAsB,EACtB,wCAAwC,EACxC,8BAA8B,EAE9B,wBAAwB,GAEzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,EAC7B,oBAAoB,EACpB,gCAAgC,GACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
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);
|
|
@@ -20,7 +20,7 @@ export function estimateMaxCompletionTokensForCharacters(maxCharacters) {
|
|
|
20
20
|
}
|
|
21
21
|
const formatCount = (value) => value.toLocaleString();
|
|
22
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() ??
|
|
23
|
+
const slidesText = slides?.text?.trim() ?? "";
|
|
24
24
|
const contentWithSlides = slidesText.length > 0
|
|
25
25
|
? `${content}\n\nSlide timeline (transcript excerpts):\n${slidesText}`
|
|
26
26
|
: content;
|
|
@@ -36,96 +36,96 @@ export function buildLinkSummaryPrompt({ url, title, siteName, description, cont
|
|
|
36
36
|
contextLines.push(`Page description: ${description}`);
|
|
37
37
|
}
|
|
38
38
|
if (truncated) {
|
|
39
|
-
contextLines.push(
|
|
39
|
+
contextLines.push("Note: Content truncated to the first portion available.");
|
|
40
40
|
}
|
|
41
|
-
const contextHeader = contextLines.join(
|
|
41
|
+
const contextHeader = contextLines.join("\n");
|
|
42
42
|
const audienceLine = hasTranscript
|
|
43
|
-
?
|
|
44
|
-
:
|
|
45
|
-
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"
|
|
46
46
|
? summaryLength
|
|
47
47
|
: contentCharacters > 0 && summaryLength.maxCharacters > contentCharacters
|
|
48
48
|
? { maxCharacters: contentCharacters }
|
|
49
49
|
: summaryLength;
|
|
50
|
-
const preset = typeof effectiveSummaryLength ===
|
|
50
|
+
const preset = typeof effectiveSummaryLength === "string"
|
|
51
51
|
? effectiveSummaryLength
|
|
52
52
|
: pickSummaryLengthForCharacters(effectiveSummaryLength.maxCharacters);
|
|
53
53
|
const directive = resolveSummaryLengthSpec(preset);
|
|
54
54
|
const formattingLine = slides && slides.count > 0
|
|
55
|
-
?
|
|
55
|
+
? "Use the slide format below. Do not add extra sections or list items outside the intro and slides."
|
|
56
56
|
: directive.formatting;
|
|
57
|
-
const presetLengthLine = typeof effectiveSummaryLength ===
|
|
58
|
-
const needsHeadings = preset ===
|
|
59
|
-
preset ===
|
|
60
|
-
(typeof effectiveSummaryLength !==
|
|
57
|
+
const presetLengthLine = typeof effectiveSummaryLength === "string" ? formatPresetLengthGuidance(preset) : "";
|
|
58
|
+
const needsHeadings = preset === "xl" ||
|
|
59
|
+
preset === "xxl" ||
|
|
60
|
+
(typeof effectiveSummaryLength !== "string" &&
|
|
61
61
|
effectiveSummaryLength.maxCharacters >= HEADING_LENGTH_CHAR_THRESHOLD);
|
|
62
62
|
const headingInstruction = slides && slides.count > 0
|
|
63
|
-
?
|
|
63
|
+
? "Do not create a dedicated Slides section or list."
|
|
64
64
|
: needsHeadings
|
|
65
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 ===
|
|
68
|
-
?
|
|
66
|
+
: "";
|
|
67
|
+
const maxCharactersLine = typeof effectiveSummaryLength === "string"
|
|
68
|
+
? ""
|
|
69
69
|
: `Target length: up to ${formatCount(effectiveSummaryLength.maxCharacters)} characters total (including Markdown and whitespace). Hard limit: do not exceed it.`;
|
|
70
70
|
const contentLengthLine = contentCharacters > 0
|
|
71
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.`
|
|
72
|
-
:
|
|
72
|
+
: "";
|
|
73
73
|
const shareLines = shares.map((share) => {
|
|
74
74
|
const handle = share.handle && share.handle.length > 0 ? `@${share.handle}` : share.author;
|
|
75
75
|
const metrics = [];
|
|
76
|
-
if (typeof share.likeCount ===
|
|
76
|
+
if (typeof share.likeCount === "number" && share.likeCount > 0) {
|
|
77
77
|
metrics.push(`${formatCount(share.likeCount)} likes`);
|
|
78
78
|
}
|
|
79
|
-
if (typeof share.reshareCount ===
|
|
79
|
+
if (typeof share.reshareCount === "number" && share.reshareCount > 0) {
|
|
80
80
|
metrics.push(`${formatCount(share.reshareCount)} reshares`);
|
|
81
81
|
}
|
|
82
|
-
if (typeof share.replyCount ===
|
|
82
|
+
if (typeof share.replyCount === "number" && share.replyCount > 0) {
|
|
83
83
|
metrics.push(`${formatCount(share.replyCount)} replies`);
|
|
84
84
|
}
|
|
85
|
-
const metricsSuffix = metrics.length > 0 ? ` [${metrics.join(
|
|
86
|
-
const timestamp = share.timestamp ? ` (${share.timestamp})` :
|
|
85
|
+
const metricsSuffix = metrics.length > 0 ? ` [${metrics.join(", ")}]` : "";
|
|
86
|
+
const timestamp = share.timestamp ? ` (${share.timestamp})` : "";
|
|
87
87
|
return `- ${handle}${timestamp}${metricsSuffix}: ${share.text}`;
|
|
88
88
|
});
|
|
89
89
|
const shareGuidance = shares.length > 0
|
|
90
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.'
|
|
91
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.';
|
|
92
|
-
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
93
|
const timestampInstruction = hasTranscriptTimestamps && !(slides && slides.count > 0)
|
|
94
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
|
-
:
|
|
95
|
+
: "";
|
|
96
96
|
const slideMarkers = slides && slides.count > 0
|
|
97
|
-
? Array.from({ length: slides.count }, (_, index) => `[slide:${index + 1}]`).join(
|
|
98
|
-
:
|
|
97
|
+
? Array.from({ length: slides.count }, (_, index) => `[slide:${index + 1}]`).join(" ")
|
|
98
|
+
: "";
|
|
99
99
|
const slideTemplate = slides && slides.count > 0
|
|
100
100
|
? [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
].join(
|
|
110
|
-
:
|
|
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
111
|
const slideInstruction = slides && slides.count > 0
|
|
112
112
|
? [
|
|
113
113
|
slideTemplate,
|
|
114
|
-
|
|
114
|
+
"Repeat the 3-line slide block for every marker below, in order.",
|
|
115
115
|
'Every slide must include a headline line that starts with "## ".',
|
|
116
|
-
|
|
116
|
+
"If there is no obvious title, create a short 2-6 word headline from the slide content.",
|
|
117
117
|
'Never output "Title:" or "Slide 1/10".',
|
|
118
118
|
`Required markers (use each exactly once, in order): ${slideMarkers}`,
|
|
119
|
-
].join(
|
|
120
|
-
:
|
|
121
|
-
const listGuidanceLine =
|
|
122
|
-
const quoteGuidanceLine =
|
|
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
123
|
const sponsorInstruction = hasTranscript || (slides && slides.count > 0)
|
|
124
|
-
?
|
|
125
|
-
:
|
|
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
|
+
: "";
|
|
126
126
|
const baseInstructions = [
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
"Hard rules: never mention sponsor/ads; use straight quotation marks only (no curly quotes).",
|
|
128
|
+
"Apostrophes in contractions are OK.",
|
|
129
129
|
audienceLine,
|
|
130
130
|
sponsorInstruction,
|
|
131
131
|
directive.guidance,
|
|
@@ -134,29 +134,29 @@ export function buildLinkSummaryPrompt({ url, title, siteName, description, cont
|
|
|
134
134
|
presetLengthLine,
|
|
135
135
|
maxCharactersLine,
|
|
136
136
|
contentLengthLine,
|
|
137
|
-
formatOutputLanguageInstruction(outputLanguage ?? { kind:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
142
|
listGuidanceLine,
|
|
143
143
|
quoteGuidanceLine,
|
|
144
|
-
|
|
145
|
-
|
|
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
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
147
|
timestampInstruction,
|
|
148
148
|
shareGuidance,
|
|
149
149
|
slideInstruction,
|
|
150
150
|
]
|
|
151
|
-
.filter((line) => typeof line ===
|
|
152
|
-
.join(
|
|
151
|
+
.filter((line) => typeof line === "string" && line.trim().length > 0)
|
|
152
|
+
.join("\n");
|
|
153
153
|
const instructions = buildInstructions({
|
|
154
154
|
base: baseInstructions,
|
|
155
155
|
overrides: { promptOverride, lengthInstruction, languageInstruction },
|
|
156
156
|
});
|
|
157
157
|
const context = [contextHeader, shareBlock]
|
|
158
|
-
.filter((line) => typeof line ===
|
|
159
|
-
.join(
|
|
158
|
+
.filter((line) => typeof line === "string" && line.trim().length > 0)
|
|
159
|
+
.join("\n");
|
|
160
160
|
return buildTaggedPrompt({
|
|
161
161
|
instructions,
|
|
162
162
|
context,
|
|
@@ -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,iBAAiB,EAAE,iBAAiB,EAAwB,MAAM,aAAa,CAAC;AACzF,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAIpC,MAAM,UAAU,8BAA8B,CAAC,aAAqB;IAClE,IAAI,aAAa,IAAI,6BAA6B,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IACzE,IAAI,aAAa,IAAI,6BAA6B,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC;IAC3E,IAAI,aAAa,IAAI,6BAA6B,CAAC,IAAI;QAAE,OAAO,MAAM,CAAC;IACvE,IAAI,aAAa,IAAI,6BAA6B,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACnE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,wCAAwC,CAAC,aAAqB;IAC5E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,cAA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