@triplef/agent 1.0.4 → 1.0.5

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.
@@ -92,6 +92,7 @@ declare const IntentSchema: z.ZodObject<{
92
92
  needsClarification: z.ZodDefault<z.ZodBoolean>;
93
93
  clarificationQuestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
94
94
  language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
95
+ contentLanguages: z.ZodDefault<z.ZodArray<z.ZodString>>;
95
96
  plan: z.ZodDefault<z.ZodObject<{
96
97
  images: z.ZodOptional<z.ZodObject<{
97
98
  resize: z.ZodDefault<z.ZodBoolean>;
@@ -1,5 +1,5 @@
1
- import { V as VariantName, I as IntentResult, T as TemplateName, F as FormatZodShapeOptions } from '../format-zod-shape.types-loN2xakw.js';
2
- export { D as DEFAULT_VARIANT_ID } from '../format-zod-shape.types-loN2xakw.js';
1
+ import { V as VariantName, I as IntentResult, T as TemplateName, F as FormatZodShapeOptions } from '../format-zod-shape.types-iJugcVmt.js';
2
+ export { D as DEFAULT_VARIANT_ID } from '../format-zod-shape.types-iJugcVmt.js';
3
3
  import { M as MemoryPoint } from '../memory-point.model-C4wvvjAY.js';
4
4
  import * as zod from 'zod';
5
5
  import { z, ZodTypeAny, ZodType } from 'zod';
@@ -99,7 +99,7 @@ declare const DESCRIBE_CONCISE_INSTRUCTIONS = "MODE: DESCRIBE - CONCISE\n\nGoal:
99
99
 
100
100
  declare const IMAGELIST_INSTRUCTIONS = "MODE: IMAGELIST\n\nGoal: produce a pure image collection \u2014 a titled, captioned gallery of images about the user's topic. The dashboard renders it as an image grid, not an article. The user explicitly asked for images ONLY, so prose must stay minimal.\n\nSTRUCTURE:\n1. category is a short label such as Images, Gallery, Wallpapers, Photos.\n2. title states what the collection shows (e.g. \"Gothic Remake \u2014 Official Screenshots\").\n3. subtitle is ONE short sentence of context (what these images are and where they come from). No paragraphs.\n4. galleryItems is the core deliverable: every suitable image from the image search results.\n\nHistory dedupe (ABSOLUTE):\n- The conversation history may contain earlier imagelist responses (listed under \"Previously shown images\").\n- NEVER include an imageUrl that already appeared in an earlier imagelist response \u2014 the user has already seen it.\n- When the user asks for more images (e.g. \"more\", \"weitere\", \"next\"), return ONLY fresh images that are not in the history.\n- If every retrieved image is already in the history, say so in the subtitle and return an empty galleryItems array.\n\nRequired fields:\n- category: a short label such as Images, Gallery, Wallpapers, Photos.\n- title: the collection title; must not be empty.\n- subtitle: one short sentence of context; empty string if nothing meaningful to add.\n- galleryItems: an array of image objects. This is the entire point of the template \u2014 it MUST contain every suitable retrieved image up to imageTargetCount.\n\nGallery item rules:\n- Each entry needs imageUrl, imageAlt, title, and caption. imageAlt and title MUST be non-empty.\n- imageAlt describes the image content for accessibility (what is visibly depicted).\n- title is a concise label (2-6 words), caption adds one short line of context (source, scene, or subject).\n- If the tool result provides no title/alt, derive concise values from the query and topic. Never leave them empty.\n- Carry over the metadata from availableImages verbatim: width, height, and source (the site name). Omit a field only when the tool result did not provide it.\n- Use ONLY image URLs that appear in the tool results. Never invent or guess URLs.\n- Order images by relevance and visual quality \u2014 strongest first.\n- Do not include near-duplicate images; the system deduplicates by content hash, but still pick the best representative yourself.\n\nOptional fields:\n- sources: an array of source objects with url, title, sourceName, date, and snippet. Use only real retrieved URLs to credit where the images were found.\n\nDo NOT include:\n- Long descriptions, articles, sections, key findings, or conclusions \u2014 the user wants images, not prose.\n- Videos \u2014 the videolist template handles video collections.\n- Hero images \u2014 every image lives in galleryItems so the grid stays uniform.\n\nNo-results rule:\n- If the searches returned no usable images, set title to a concise statement such as 'No images found for <topic>' and use subtitle to explain that the search did not return authoritative image sources. Set galleryItems to an empty array.\n- Do not invent image URLs to fill the gallery when no results were retrieved.\n- Do not refill the gallery with images from the conversation history \u2014 if nothing fresh was retrieved, say so instead of repeating already-shown images.";
101
101
 
102
- declare const INTERNATIONAL_COVERAGE_INSTRUCTIONS = "INTERNATIONAL COVERAGE ASIDE:\n- internationalCoverage: an array of 0\u20133 entries highlighting the most noteworthy results found in languages other than the user's. Fill it ONLY from the internationalArticles and internationalVideos pools in the tool context; omit the field entirely when those pools are absent or empty.\n- Each entry is an object with exactly these keys: \"title\", \"url\", \"sourceName\", \"language\", \"summary\".\n- title: the item's original-language title, copied verbatim \u2014 never translated.\n- url: the item's URL, copied verbatim from its context entry.\n- sourceName: the publishing source or channel name from its context entry.\n- language: the item's two-letter ISO language code copied from its context entry (e.g. \"zh\", \"ru\", \"en\").\n- summary: one or two sentences in the USER'S language stating what this source reports and why it matters.\n- internationalCoverage entries must never reuse a URL that appears in any primary field (sources, hero media, galleries, sectionContent, relatedStories, cards).";
102
+ declare const INTERNATIONAL_COVERAGE_INSTRUCTIONS = "INTERNATIONAL COVERAGE ASIDE:\n- internationalCoverage: an array of 0\u20133 entries highlighting the most noteworthy results found in languages other than the user's. Fill it ONLY from the internationalArticles and internationalVideos pools in the tool context; omit the field entirely when those pools are absent or empty.\n- Each entry is an object with exactly these keys: \"title\", \"url\", \"sourceName\", \"language\", \"summary\".\n- title: the item's original-language title, copied verbatim \u2014 never translated.\n- url: the item's URL, copied verbatim from its context entry.\n- sourceName: the publishing source or channel name from its context entry.\n- language: the item's language code copied verbatim from the \"lang\" field of its context entry (the pipeline pre-detected it \u2014 never invent or guess a code, never use placeholders like \"zxx\").\n- summary: one or two sentences in the USER'S language stating what this source reports and why it matters.\n- internationalCoverage entries must never reuse a URL that appears in any primary field (sources, hero media, galleries, sectionContent, relatedStories, cards).";
103
103
 
104
104
  declare const OCR_INSTRUCTIONS = "MODE: OCR\n\nGoal: produce a JSON object containing the visible text from the attached image(s).\n\nMANDATORY RULES:\n1. Transcribe only the text visible in the image.\n2. If the extracted text contains URLs, social-media handles, brand names, or other named entities AND the user asks you to identify or explain them, you MAY use *WebSearch/webFetch to look them up.\n3. If you use *WebSearch/webFetch, sectionContent MUST:\n - state that you searched the internet because of a visible clue,\n - identify the visible clue,\n - clearly label any conclusion drawn from the internet as an assumption,\n - mention that reference images or sources are attached in the Files panel if applicable.\n4. Only corroborating reference material belongs in the response: cloud reference candidates and retrieved links count as evidence ONLY when their search-result text (title, snippet, source) supports the subject you identified in the uploaded image(s) \u2014 nothing is compared pixel-by-pixel, candidate images arrive as data, never attached to you. List every unpicked candidate in discardedReferences with { \"type\": \"image\", imageUrl, title, reason } or { \"type\": \"link\", url, title, reason } and a one-line reason.\n\nRequired fields:\n- category: a short category label such as Document, Sign, Code, Label.\n- title: a concise, descriptive title for the IMAGE or DOCUMENT (e.g., \"Receipt\", \"Street Sign\", \"Code Snippet\"). NOT a copy of the extracted text.\n- subtitle: an optional one-line summary of what the image shows (empty string if not needed). NOT a copy of the extracted text.\n- sectionContent: the extracted text ONLY, as a single JSON string value. Preserve structure and line breaks by using the escaped newline sequence \\n between lines or paragraphs \u2014 never literal line breaks inside the JSON string.\n- keyFindings: an array of 0\u20135 short observations ABOUT the image/text. Each entry MUST be an object with exactly one key: \"text\".\n\nOptional reference fields (only when you researched visible clues online):\n- sources: an array of source objects with url and title from the tool results.\n- galleryTitle: a short title for the reference images (e.g. \"Reference images\").\n- galleryItems: the cloud reference images you picked as corroborating evidence for the uploaded image(s), from availableImages. Each entry MUST include imageUrl, imageAlt, title, and caption.\n- discardedReferences: an array of the cloud candidates and retrieved links you excluded because they did not match. Each entry is either { \"type\": \"image\", \"imageUrl\", \"title\", \"reason\" } or { \"type\": \"link\", \"url\", \"title\", \"reason\" } with a one-line reason.\n- videoGalleryTitle: optional title for the video gallery (e.g. \"Related videos\").\n- videoGalleryItems: an array of videos from availableVideos that provide useful context about the identified subject (e.g. trailers, gameplay, walkthroughs, official media). Each entry MUST include videoUrl, title, and caption (all non-empty). Carry over duration, channel, date, views, thumbnailUrl, and description verbatim from the availableVideos entry when present. Omit the keys entirely when no videos are available or none are relevant.\n\nRules:\n- Never emit placeholder text such as \"undefined\", \"null\", \"none\", or \"n/a\". Use an empty string or empty array instead.\n- Transcribe only the text visible in the image.\n- If the image contains no readable text, say so briefly in sectionContent \u2014 an honest \"no readable text\" result is valid; never invent text to fill the field.\n- Do not correct spelling or grammar unless instructed.\n- Preserve the original layout when possible.\n- Do not leave sectionContent empty.\n- title and subtitle must describe the image/document. They must NEVER repeat or summarize the extracted text from sectionContent.\n- keyFindings must be short OBSERVATIONS about the image/text. NEVER repeat or summarize the extracted text from sectionContent.\n\nFINAL REMINDER:\n- Transcribe only the text visible in the image.";
105
105
  declare const OCR_VERBATIM_INSTRUCTIONS = "MODE: OCR \u2014 VERBATIM\n\nGoal: produce a JSON object containing the visible text from the attached image(s), transcribed exactly as it appears.\n\nMANDATORY RULES:\n1. Transcribe the visible text exactly as it appears, without reformatting, summarizing, or correcting errors.\n2. If the extracted text contains URLs, social-media handles, brand names, or other named entities AND the user asks you to identify or explain them, you MAY use *WebSearch/webFetch to look them up.\n3. If you use *WebSearch/webFetch, sectionContent MUST:\n - state that you searched the internet because of a visible clue,\n - identify the visible clue,\n - clearly label any conclusion drawn from the internet as an assumption,\n - mention that reference images or sources are attached in the Files panel if applicable.\n4. Only corroborating reference material belongs in the response: cloud reference candidates and retrieved links count as evidence ONLY when their search-result text (title, snippet, source) supports the subject you identified in the uploaded image(s) \u2014 nothing is compared pixel-by-pixel, candidate images arrive as data, never attached to you. List every unpicked candidate in discardedReferences with { \"type\": \"image\", imageUrl, title, reason } or { \"type\": \"link\", url, title, reason } and a one-line reason.\n\nRequired fields:\n- category: a short category label such as Document, Sign, Code, Label.\n- title: a concise, descriptive title for the IMAGE or DOCUMENT. NOT a copy of the extracted text.\n- subtitle: an optional one-line summary of what the image shows (empty string if not needed). NOT a copy of the extracted text.\n- sectionContent: the extracted text ONLY, as a single JSON string value. Preserve the original structure, line breaks, and formatting by using the escaped newline sequence \\n \u2014 never literal line breaks inside the JSON string.\n- keyFindings: an array of 0\u20135 short observations ABOUT the image/text. Each entry MUST be an object with exactly one key: \"text\".\n\nOptional reference fields (only when you researched visible clues online):\n- sources: an array of source objects with url and title from the tool results.\n- galleryTitle: a short title for the reference images (e.g. \"Reference images\").\n- galleryItems: the cloud reference images you picked as corroborating evidence for the uploaded image(s), from availableImages. Each entry MUST include imageUrl, imageAlt, title, and caption.\n- discardedReferences: an array of the cloud candidates and retrieved links you excluded because they did not match. Each entry is either { \"type\": \"image\", \"imageUrl\", \"title\", \"reason\" } or { \"type\": \"link\", \"url\", \"title\", \"reason\" } with a one-line reason.\n- videoGalleryTitle: optional title for the video gallery (e.g. \"Related videos\").\n- videoGalleryItems: an array of videos from availableVideos that provide useful context about the identified subject (e.g. trailers, gameplay, walkthroughs, official media). Each entry MUST include videoUrl, title, and caption (all non-empty). Carry over duration, channel, date, views, thumbnailUrl, and description verbatim from the availableVideos entry when present. Omit the keys entirely when no videos are available or none are relevant.\n\nRules:\n- Never emit placeholder text such as \"undefined\", \"null\", \"none\", or \"n/a\". Use an empty string or empty array instead.\n- Transcribe only the text visible in the image.\n- Transcribe the visible text exactly as it appears, without reformatting, summarizing, or correcting errors.\n- If the image contains no readable text, say so briefly in sectionContent \u2014 an honest \"no readable text\" result is valid; never invent text to fill the field.\n- Preserve the original layout and formatting when possible.\n- Do not leave sectionContent empty.\n- title and subtitle must describe the image/document. They must NEVER repeat or summarize the extracted text from sectionContent.\n- keyFindings must be short OBSERVATIONS about the image/text. NEVER repeat or summarize the extracted text from sectionContent.\n\nFINAL REMINDER:\n- Transcribe only the text visible in the image, exactly as it appears.";
@@ -119,7 +119,7 @@ declare const TEXT_CODING_INSTRUCTIONS = "MODE: TEXT \u2014 CODING\n\nGoal: Resp
119
119
  declare const TEXT_FAMILIARITY_INSTRUCTIONS = "MODE: TEXT \u2014 FAMILIARITY\n\nGoal: Answer a \"do you know / have you heard of X?\" question the way a knowledgeable human would, using streaming text.\n\nRules:\n- By default, output only the response text.\n- Markdown is allowed and encouraged when it improves readability (headings, lists, tables, inline code, bold, italics, etc.).\n- The response will be streamed to the user as it is generated.\n- Use paragraphs, line breaks, and Markdown for clear structure.\n- Do not output HTML unless the user explicitly requests it.\n- Do not include any metadata, wrapper objects, or additional keys unless the user explicitly requests them.\n- Do NOT wrap it in JSON, a \"text\" field, or any other structured format unless the user explicitly asks for it.\n- Answer conversationally: open with a direct acknowledgment (yes/no/roughly), then share what you know in a natural, compact way.\n- When tool results are present, treat them as grounding: prefer them over stale training knowledge and weave fresh facts in naturally, without reciting raw search output.\n- Your COGNITION blocks (when present as system messages) are your own accumulated model of this user: the structured PROFILE is who they are (and your routing map into deeper memory); probed INSIGHTS are topic depth the current request pulled up by path-match. Use both silently for tone and choices \u2014 they are derived working context, never the user's words, so never quote them verbatim as if the user stated them. When the user asks what you know or remember about them \u2014 or when it clearly serves them \u2014 disclose the substance plainly alongside stored memories and offer to correct or delete it.\n- When no tool results are present, answer from your own knowledge and be honest about possible gaps for very recent or niche subjects.\n- Keep it short: one to three compact paragraphs, no report structure, no headings unless the answer genuinely needs them.\n- Close with exactly one short follow-up offer in the user's language: you can look up the latest news, write an in-depth article, or put together an evaluation/review of the subject (e.g. \"Magst du aktuelle News, einen ausf\u00FChrlichen Artikel oder eine Bewertung dazu?\").\n- Do NOT produce the article, news piece, or evaluation now \u2014 the offer is only an offer.";
120
120
  declare const TEXT_OPINION_INSTRUCTIONS = "MODE: TEXT \u2014 OPINION\n\nGoal: Give your own honest judgment on a subject the way a knowledgeable human answers a friend's \"what do you think?\" \u2014 using streaming text.\n\nRules:\n- By default, output only the response text.\n- Markdown is allowed and encouraged when it improves readability (headings, lists, tables, inline code, bold, italics, etc.).\n- The response will be streamed to the user as it is generated.\n- Use paragraphs, line breaks, and Markdown for clear structure.\n- Do not output HTML unless the user explicitly requests it.\n- Do not include any metadata, wrapper objects, or additional keys unless the user explicitly requests them.\n- Do NOT wrap it in JSON, a \"text\" field, or any other structured format unless the user explicitly asks for it.\n- Lead with a direct first-person verdict (\"Yes \u2014 give it a shot\", \"I'd hold off for now\"), then the reasoning behind it. Take a position: never hide behind neutral report language (\"critics say\u2026\", \"opinions are mixed\u2026\") as a substitute for your own judgment \u2014 evidence supports your take, it does not replace it.\n- When tool results are present, treat them as grounding: prefer them over stale training knowledge, weigh the sourced reception and reports openly, and let them shape your verdict. When nothing was retrieved, answer from your own knowledge and note when the subject may have moved on since.\n- Keep it conversational and compact: prose with light Markdown at most \u2014 no headline or title block, no report sections, no score box, no pros/cons artifacts of a review piece.\n- Your COGNITION blocks (when present as system messages) are your accumulated model of this user: use them silently to tailor the verdict to their tastes and situation \u2014 they are derived working context, never the user's words, so never quote them verbatim as if the user stated them.\n- Close with exactly one short follow-up offer in the user's language: you can put together a full structured evaluation/review with pros and cons (e.g. \"Want the full breakdown as a proper review?\").\n- Do NOT produce the structured evaluation now \u2014 the offer is only an offer.";
121
121
 
122
- declare const VIDEOLIST_INSTRUCTIONS = "MODE: VIDEOLIST\n\nGoal: produce a pure video collection \u2014 a titled, captioned playlist of videos about the user's topic. The dashboard renders it as a numbered playlist with embedded players, not an article. The user explicitly asked for videos ONLY (e.g. music videos, trailers, clips), so prose must stay minimal.\n\nSTRUCTURE:\n1. category is a short label such as Videos, Playlist, Music Videos, Trailers.\n2. title states what the playlist contains (e.g. \"Daft Punk \u2014 Music Videos\").\n3. subtitle is ONE short sentence of context (what these videos are and where they come from). No paragraphs.\n4. videoGalleryItems is the core deliverable: every suitable video from the video search results, ordered like a playlist.\n\nRequired fields:\n- category: a short label such as Videos, Playlist, Music Videos, Trailers.\n- title: the playlist title; must not be empty.\n- subtitle: one short sentence of context; empty string if nothing meaningful to add.\n- videoGalleryItems: an array of video objects. This is the entire point of the template \u2014 it MUST contain every suitable retrieved video up to videoTargetCount.\n\nHistory dedupe (ABSOLUTE):\n- The conversation history may contain earlier videolist responses (JSON objects with a videoGalleryItems array).\n- NEVER include a videoUrl that already appeared in an earlier videolist response \u2014 the user has already seen it.\n- When the user asks for more videos (e.g. \"more\", \"weitere\", \"next\"), return ONLY fresh videos that are not in the history.\n- If every retrieved video is already in the history, say so in the subtitle and return an empty videoGalleryItems array.\n\nVideo item rules:\n- Each entry needs videoUrl, title, and caption. title and caption MUST be non-empty.\n- title is the video's real title when known (e.g. the YouTube video title); caption adds one short line of context (channel, release year, or why it fits the request).\n- If the tool result provides no title/caption, derive concise values from the query and topic. Never leave them empty.\n- Carry over the metadata from availableVideos verbatim: duration, channel, date, views, thumbnailUrl, and description. Omit a field only when the tool result did not provide it.\n- Only use direct video pages \u2014 never channel, playlist, user, or profile URLs.\n- Use ONLY video URLs that appear in the tool results. Never invent or guess URLs.\n- Order the videos like a good playlist: most relevant and most popular first.\n- Do not include the same video twice (same music video, trailer, or clip), even from different search tools.\n- Cross-check every candidate videoUrl against the earlier videolist responses in the conversation before including it.\n- When the user asks for videos from a specific platform (e.g. \"on YouTube\"), include ONLY videos from that platform.\n\nDo NOT include:\n- Long descriptions, articles, sections, key findings, or conclusions \u2014 the user wants videos, not prose.\n- Images or image galleries \u2014 the imagelist template handles image collections.\n- Hero videos \u2014 every video lives in videoGalleryItems so the playlist stays uniform.\n\nNo-results rule:\n- If the searches returned no usable videos, set title to a concise statement such as 'No videos found for <topic>' and use subtitle to explain that the search did not return embeddable video sources. Set videoGalleryItems to an empty array.\n- Do not invent video URLs to fill the playlist when no results were retrieved.\n- The dashboard does not render sources for this template. Do not include a sources field.";
122
+ declare const VIDEOLIST_INSTRUCTIONS = "MODE: VIDEOLIST\n\nGoal: produce a pure video collection \u2014 a titled, captioned playlist of videos about the user's topic. The dashboard renders it as a numbered playlist with embedded players, not an article. The user explicitly asked for videos ONLY (e.g. music videos, trailers, clips), so prose must stay minimal.\n\nSTRUCTURE:\n1. category is a short label such as Videos, Playlist, Music Videos, Trailers.\n2. title states what the playlist contains (e.g. \"Daft Punk \u2014 Music Videos\").\n3. subtitle is ONE short sentence of context (what these videos are and where they come from). No paragraphs.\n4. videoGalleryItems is the core deliverable: every suitable video from the video search results, ordered like a playlist.\n\nRequired fields:\n- category: a short label such as Videos, Playlist, Music Videos, Trailers.\n- title: the playlist title; must not be empty.\n- subtitle: one short sentence of context; empty string if nothing meaningful to add.\n- videoGalleryItems: an array of video objects. This is the entire point of the template \u2014 it MUST contain every suitable retrieved video up to videoTargetCount.\n\nHistory dedupe (ABSOLUTE):\n- The conversation history may contain earlier videolist responses (JSON objects with a videoGalleryItems array).\n- NEVER include a videoUrl that already appeared in an earlier videolist response \u2014 the user has already seen it.\n- When the user asks for more videos (e.g. \"more\", \"weitere\", \"next\"), return ONLY fresh videos that are not in the history.\n- If every retrieved video is already in the history, say so in the subtitle and return an empty videoGalleryItems array.\n\nVideo item rules:\n- Each entry needs videoUrl, title, and caption. title and caption MUST be non-empty.\n- title is the video's real title when known (e.g. the YouTube video title); caption adds one short line of context (channel, release year, or why it fits the request).\n- If the tool result provides no title/caption, derive concise values from the query and topic. Never leave them empty.\n- Carry over the metadata from availableVideos verbatim: duration, channel, date, views, thumbnailUrl, and description. Omit a field only when the tool result did not provide it.\n- Only use direct video pages \u2014 never channel, playlist, user, or profile URLs.\n- Use ONLY video URLs that appear in the tool results. Never invent or guess URLs.\n- Order the videos like a good playlist: most relevant and most popular first.\n- Do not include the same video twice (same music video, trailer, or clip), even from different search tools.\n- Cross-check every candidate videoUrl against the earlier videolist responses in the conversation before including it.\n- When the user asks for videos from a specific platform (e.g. \"on YouTube\"), include ONLY videos from that platform.\n\nDo NOT include:\n- Long descriptions, articles, sections, key findings, or conclusions \u2014 the user wants videos, not prose.\n- Images or image galleries \u2014 the imagelist template handles image collections.\n- Hero videos \u2014 every video lives in videoGalleryItems so the playlist stays uniform.\n\nNo-results rule:\n- If the searches returned no usable videos, set title to a concise statement such as 'No videos found for <topic>' and use subtitle to explain that the search did not return embeddable video sources. Set videoGalleryItems to an empty array.\n- Do not invent video URLs to fill the playlist when no results were retrieved.\n- availableVideos empty does NOT mean nothing was found: when availableVideos is empty but internationalVideos is not, the search DID find videos \u2014 in other languages than the user's. Never title it 'No videos found' in that case; use the subtitle to say the fresh results are in other languages and listed in internationalCoverage, and fill internationalCoverage from the internationalVideos pool.\n- The dashboard does not render sources for this template. Do not include a sources field.";
123
123
 
124
124
  declare const CONVICTION_INSTRUCTIONS = "You synthesize higher-level convictions and bridges from a user's memory facts.\n\nGiven a numbered list of EVIDENCE (facts the user stated or asked to remember), synthesize durable, higher-level statements \u2014 conclusions that are true of the evidence but not merely restated from it. Every statement picks its lane (\"target\"), and the choice is PURPOSE-based, never cosmetic:\n\n- \"conviction\" \u2014 a durable conclusion about THE USER (or your own working relationship with them): a pattern in their behavior, a standing judgment the facts support, a trait or tendency you now hold true. Convictions deepen your understanding of the user and yourself; they are YOURS, never statements the user made. (\"the user bought a dog\" + \"the user keeps comparing dog food brands\" + \"the user researches every purchase for days\" \u2192 conviction: \"the user is a deliberate, research-first buyer\")\n- \"bridge\" \u2014 a synthesized claim that CLOSES A GAP between facts: without it, two stored facts look unrelated; with it, they form one coherent story about the user's world. Bridges are the connective tissue of the fact graph. (\"the user bought dog food X\" + \"the user's dog refuses to eat\" \u2192 bridge: \"the dog refuses the brand-X food the user bought\")\n\nA synthesized statement is a synthesis, not a restatement:\n- combine multiple facts into one conclusion (\"learning Rust\" + \"rewriting the payments service\" \u2192 \"the user is migrating the payments service to Rust\")\n- every statement MUST cite the evidence indices that support it (the [n] numbers)\n- never invent facts not present in the evidence\n- never restate a single evidence item verbatim \u2014 that is not synthesis\n- a statement with no supporting evidence is invalid \u2014 omit it\n- when neither a conviction nor a bridge clearly fits, emit nothing for it \u2014 a forced target blurs the lanes and is worse than no statement\n\nEVIDENCE METADATA \u2014 each line may show \"(subject: \u2026; category: \u2026; kind: \u2026; stability: \u2026)\":\n- subject groups the evidence lines about one entity \u2014 convictions about a subject cite that subject's lines\n- durable evidence carries more weight for a conviction; a volatile state alone rarely supports a durable conclusion\n- kind sharpens conclusions: a pattern of \"preference\" evidence supports a taste conclusion; \"decision\" evidence supports a commitment conclusion\n\nRespond with JSON only:\n{\n \"convictions\": [\n { \"text\": \"one self-contained sentence\", \"target\": \"conviction\", \"evidence\": [0, 2, 5] }\n ]\n}\n\nRules:\n- target is exactly \"conviction\" or \"bridge\" \u2014 every statement carries one\n- evidence indices are the [n] numbers from the EVIDENCE list \u2014 never invent an index\n- return an empty convictions array when the evidence is too thin to synthesize anything\n- keep each statement to one sentence";
125
125
  interface ConvictionEvidenceItem {
@@ -600,7 +600,7 @@ var INTERNATIONAL_COVERAGE_INSTRUCTIONS = `INTERNATIONAL COVERAGE ASIDE:
600
600
  - title: the item's original-language title, copied verbatim \u2014 never translated.
601
601
  - url: the item's URL, copied verbatim from its context entry.
602
602
  - sourceName: the publishing source or channel name from its context entry.
603
- - language: the item's two-letter ISO language code copied from its context entry (e.g. "zh", "ru", "en").
603
+ - language: the item's language code copied verbatim from the "lang" field of its context entry (the pipeline pre-detected it \u2014 never invent or guess a code, never use placeholders like "zxx").
604
604
  - summary: one or two sentences in the USER'S language stating what this source reports and why it matters.
605
605
  - internationalCoverage entries must never reuse a URL that appears in any primary field (sources, hero media, galleries, sectionContent, relatedStories, cards).`;
606
606
 
@@ -1466,6 +1466,9 @@ var IntentSchema = z.object({
1466
1466
  language: z.string().nullable().optional().describe(
1467
1467
  "Two-letter ISO language code of the latest user message (e.g. 'en', 'de', 'ja', 'es'). Detect from the user's text."
1468
1468
  ),
1469
+ contentLanguages: z.array(z.string()).default([]).describe(
1470
+ `Two-letter ISO codes of languages the requested CONTENT is expected to be in, beyond the language of the user's message. Set ONLY when the request explicitly targets foreign-language content: "japanese dark trap music" \u2192 ["ja"], "russian news sites" \u2192 ["ru"]. Music/audio topics count \u2014 a mix or song in another language is still the requested content. Default []: foreign-language results then stay a side note, never primary content.`
1471
+ ),
1469
1472
  plan: z.object({
1470
1473
  images: ImagePlanSchema.optional().describe("Image processing plan. Only present when images are attached.")
1471
1474
  }).default({}).describe("Execution plan for the response step.")
@@ -2160,6 +2163,7 @@ Do NOT include:
2160
2163
  No-results rule:
2161
2164
  - If the searches returned no usable videos, set title to a concise statement such as 'No videos found for <topic>' and use subtitle to explain that the search did not return embeddable video sources. Set videoGalleryItems to an empty array.
2162
2165
  - Do not invent video URLs to fill the playlist when no results were retrieved.
2166
+ - availableVideos empty does NOT mean nothing was found: when availableVideos is empty but internationalVideos is not, the search DID find videos \u2014 in other languages than the user's. Never title it 'No videos found' in that case; use the subtitle to say the fresh results are in other languages and listed in internationalCoverage, and fill internationalCoverage from the internationalVideos pool.
2163
2167
  - The dashboard does not render sources for this template. Do not include a sources field.`;
2164
2168
 
2165
2169
  // src/prompts/harness/variant-instructions.registry.ts
@@ -2395,6 +2399,7 @@ When needsClarification=true:
2395
2399
  // src/prompts/harness/intent-selection/language-rules.prompt.ts
2396
2400
  var LANGUAGE_NOISE_IMMUNITY_RULES = `- Individual foreign words, loanwords, scientific or medical terms, brand or proper names, and quoted fragments must NOT change the detected language.
2397
2401
  - Example: "Why do English speakers say 'd\xE9j\xE0 vu'?" \u2192 language "en" (one French phrase inside an English sentence \u2014 not "fr").`;
2402
+ var CONTENT_LANGUAGE_RULE = `- If the user explicitly asks for foreign-language CONTENT (e.g. "japanese dark trap music" from an English speaker, "russian news sites"), fill "contentLanguages" with those ISO codes \u2014 this covers MUSIC and mixes too, not just text. Otherwise leave "contentLanguages" empty.`;
2398
2403
  var INTENT_LANGUAGE_FIELD_RULE = "Judge by the DOMINANT language of the full sentence or paragraph \u2014 individual foreign words, loanwords, scientific or medical terms, brand or proper names, and quoted fragments must NOT change the detected language.";
2399
2404
  function buildIntentLanguageRules(language) {
2400
2405
  const code = language?.trim().toLowerCase() ?? "";
@@ -2406,7 +2411,8 @@ function buildIntentLanguageRules(language) {
2406
2411
  - If the latest user message is in mixed languages, use the language that appears to be primary.
2407
2412
  - Judge the language by the DOMINANT language of the full sentence or paragraph, never by individual words.
2408
2413
  ${LANGUAGE_NOISE_IMMUNITY_RULES}
2409
- - Do not use English for clarification questions, reasoning, or summaries unless the user wrote in English.`;
2414
+ - Do not use English for clarification questions, reasoning, or summaries unless the user wrote in English.
2415
+ ${CONTENT_LANGUAGE_RULE}`;
2410
2416
  }
2411
2417
  const name = resolveLanguageName(code);
2412
2418
  const languageLabel = name === code ? `"${code}"` : `"${code}" (${name})`;
@@ -2419,7 +2425,8 @@ ${LANGUAGE_NOISE_IMMUNITY_RULES}
2419
2425
  - Never default to English unless the browser language is English or the user explicitly requests English.
2420
2426
  - If the user explicitly requests a language, judge it by the DOMINANT language of the full sentence or paragraph, never by individual words.
2421
2427
  ${LANGUAGE_NOISE_IMMUNITY_RULES}
2422
- - Do not use English for clarification questions, reasoning, or summaries unless the browser language is English or the user explicitly requests English.`;
2428
+ - Do not use English for clarification questions, reasoning, or summaries unless the browser language is English or the user explicitly requests English.
2429
+ ${CONTENT_LANGUAGE_RULE}`;
2423
2430
  }
2424
2431
 
2425
2432
  // src/prompts/harness/intent-selection/memory-rules.prompt.ts
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export { E as EncyclopediaDocumentInput, a as EncyclopediaDocumentResult, b as EncyclopediaSearchHit, c as EncyclopediaSearchInput } from '../encyclopedia-search.model-oFW8_rUT.js';
3
- import { F as FormatZodShapeOptions } from '../format-zod-shape.types-loN2xakw.js';
4
- export { B as BROWSER_TOOL_NAMES, D as DEFAULT_VARIANT_ID, E as ENCYCLOPEDIA_TOOL_NAMES, a as IMAGE_TASK_TEMPLATES, b as ImageTaskTemplate, I as IntentResult, c as IntentSchema, M as MEMORY_TOOL_NAMES, d as TOOL_DESCRIPTIONS, e as TOOL_NAMES, T as TemplateName, f as ToolName, g as VARIANT_NAMES, V as VariantName, i as isImageTaskTemplate } from '../format-zod-shape.types-loN2xakw.js';
3
+ import { F as FormatZodShapeOptions } from '../format-zod-shape.types-iJugcVmt.js';
4
+ export { B as BROWSER_TOOL_NAMES, D as DEFAULT_VARIANT_ID, E as ENCYCLOPEDIA_TOOL_NAMES, a as IMAGE_TASK_TEMPLATES, b as ImageTaskTemplate, I as IntentResult, c as IntentSchema, M as MEMORY_TOOL_NAMES, d as TOOL_DESCRIPTIONS, e as TOOL_NAMES, T as TemplateName, f as ToolName, g as VARIANT_NAMES, V as VariantName, i as isImageTaskTemplate } from '../format-zod-shape.types-iJugcVmt.js';
5
5
 
6
6
  declare const BLOCKED_IMAGE_HOSTS: Set<string>;
7
7
 
@@ -515,6 +515,9 @@ var IntentSchema = z.object({
515
515
  language: z.string().nullable().optional().describe(
516
516
  "Two-letter ISO language code of the latest user message (e.g. 'en', 'de', 'ja', 'es'). Detect from the user's text."
517
517
  ),
518
+ contentLanguages: z.array(z.string()).default([]).describe(
519
+ `Two-letter ISO codes of languages the requested CONTENT is expected to be in, beyond the language of the user's message. Set ONLY when the request explicitly targets foreign-language content: "japanese dark trap music" \u2192 ["ja"], "russian news sites" \u2192 ["ru"]. Music/audio topics count \u2014 a mix or song in another language is still the requested content. Default []: foreign-language results then stay a side note, never primary content.`
520
+ ),
518
521
  plan: z.object({
519
522
  images: ImagePlanSchema.optional().describe("Image processing plan. Only present when images are attached.")
520
523
  }).default({}).describe("Execution plan for the response step.")
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@triplef/agent",
3
3
  "description": "tripleF (3F) agent domain — structured-output schemas, prompt builders, and model tools shared across the apps.",
4
- "version": "1.0.4",
5
- "packageManager": "pnpm@12.14.0",
4
+ "version": "1.0.5",
5
+ "packageManager": "pnpm@12.15.0",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "exports": {