@triplef/agent 1.0.8 → 1.0.9
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.
|
@@ -17,21 +17,21 @@ type ImageTaskTemplate = (typeof IMAGE_TASK_TEMPLATES)[number];
|
|
|
17
17
|
declare function isImageTaskTemplate(template: string): template is ImageTaskTemplate;
|
|
18
18
|
declare const IntentSchema: z.ZodObject<{
|
|
19
19
|
template: z.ZodEnum<{
|
|
20
|
+
text: "text";
|
|
21
|
+
summary: "summary";
|
|
20
22
|
article: "article";
|
|
23
|
+
evaluation: "evaluation";
|
|
24
|
+
merge: "merge";
|
|
21
25
|
news: "news";
|
|
26
|
+
stockmarketitem: "stockmarketitem";
|
|
27
|
+
stockmarketlist: "stockmarketlist";
|
|
22
28
|
describe: "describe";
|
|
23
29
|
compare: "compare";
|
|
24
30
|
ocr: "ocr";
|
|
25
|
-
summary: "summary";
|
|
26
|
-
evaluation: "evaluation";
|
|
27
31
|
product: "product";
|
|
28
32
|
shoplist: "shoplist";
|
|
29
33
|
imagelist: "imagelist";
|
|
30
34
|
videolist: "videolist";
|
|
31
|
-
stockmarketitem: "stockmarketitem";
|
|
32
|
-
stockmarketlist: "stockmarketlist";
|
|
33
|
-
merge: "merge";
|
|
34
|
-
text: "text";
|
|
35
35
|
}>;
|
|
36
36
|
prompt: z.ZodDefault<z.ZodString>;
|
|
37
37
|
tools: z.ZodArray<z.ZodEnum<{
|
|
@@ -91,6 +91,7 @@ declare const IntentSchema: z.ZodObject<{
|
|
|
91
91
|
clarificationQuestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
92
|
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
93
|
contentLanguages: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
94
|
+
contentCreator: z.ZodDefault<z.ZodString>;
|
|
94
95
|
plan: z.ZodDefault<z.ZodObject<{
|
|
95
96
|
images: z.ZodOptional<z.ZodObject<{
|
|
96
97
|
resize: z.ZodDefault<z.ZodBoolean>;
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VariantName, I as IntentResult, T as TemplateName, F as FormatZodShapeOptions } from '../format-zod-shape.types-
|
|
2
|
-
export { D as DEFAULT_VARIANT_ID } from '../format-zod-shape.types-
|
|
1
|
+
import { V as VariantName, I as IntentResult, T as TemplateName, F as FormatZodShapeOptions } from '../format-zod-shape.types-BByqTKpk.js';
|
|
2
|
+
export { D as DEFAULT_VARIANT_ID } from '../format-zod-shape.types-BByqTKpk.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';
|
|
@@ -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- 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.";
|
|
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- When the user restricts the playlist to a specific creator or channel (e.g. \"from the channel katame\", \"drop everything else\"), include ONLY videos whose channel field matches that name \u2014 case-insensitively, and partial matches count (\"katame\" matches channel \"Katame Chill\"). Return only the matching videos, however few remain, and say so in the subtitle; never fill the playlist with videos from other channels.\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- When the user restricted results to a named creator and nothing from that creator was retrieved, say so plainly (e.g. 'No videos from <creator> found') \u2014 never present other channels' videos instead.\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 {
|
|
@@ -269,7 +269,7 @@ declare function buildLocalizationRule(language?: string): string;
|
|
|
269
269
|
|
|
270
270
|
declare const MEDIA_COUNTS = "MEDIA COUNTS\n- Respect imageTargetCount and videoTargetCount from the tool context.\n- If the user requested a number, that number is the maximum.\n- Otherwise assume the default target supplied by the pipeline (default is 6 when the user did not request a specific number).\n- hero media counts toward the total.\n- Never exceed available URLs.";
|
|
271
271
|
|
|
272
|
-
declare const MEDIA_RULES = "MEDIA RULES\n- Media-list templates (imagelist, videolist, shoplist) have NO hero media, and product has an image-only banner with NO hero video \u2014 their mode rules override every hero-related rule below.\n- Use every provided image/video URL
|
|
272
|
+
declare const MEDIA_RULES = "MEDIA RULES\n- Media-list templates (imagelist, videolist, shoplist) have NO hero media, and product has an image-only banner with NO hero video \u2014 their mode rules override every hero-related rule below.\n- Use every provided image/video URL that matches the request's explicit restrictions (platform, creator, count) \u2014 restrictions outrank completeness: a short list of correct items is always right, a padded list of off-target items is a failure.\n- The system removes duplicate media by content hash (images) and canonical provider ID or title (videos). Do not worry if the raw tool results contain duplicates; choose one representative for each unique piece of content.\n- CREATOR/CHANNEL RESTRICTION: when the user restricted content to a named creator or channel, exclude every media item whose channel or source does not match that name \u2014 match case-insensitively, and partial names count (\"katame\" matches channel \"Katame Chill\"). availableVideos entries carry a channel field for this check; toolContext echoes the restricted name as contentCreator when one applies.\n- heroVideoUrl takes priority over heroImageUrl when both exist.\n- Fill galleryItems and videoGalleryItems from the supplied media without exceeding imageTargetCount or videoTargetCount.\n- Gallery entries require all mandatory fields.\n- Prefer high-resolution images.\n- Reject untrusted image hosts, thumbnails, private URLs, data URIs, and tracking assets. Uploaded user images served from our own storage are always trusted. Videos must come from embeddable providers only: YouTube, Vimeo, Dailymotion, Loom, Wistia, or direct video files.\n- URL fields must point to real public webpages, never scripts, APIs, assets, or tracking endpoints.\n- Images and videos are independent; never omit image galleries because videos exist.\n- Every image MUST have a non-empty imageAlt and a non-empty title. If the tool result provides none, derive a concise title and alt from the query/topic/context.\n- Every video gallery item MUST have a non-empty title and a non-empty caption. If the tool result provides none, derive concise values from the query/topic/context.\n- Do not include the same video twice (same trailer, official video, or clip) in heroVideoUrl and videoGalleryItems combined. YouTube watch/shorts/embed/youtu.be variants of the same video count as duplicates.\n- Do not include the same image twice (the same photo, cover, or artwork served smaller, larger, or with different query parameters) in heroImageUrl and galleryItems combined.\n- Every media URL may appear exactly once in the response: a URL used in heroImageUrl, heroVideoUrl, galleryItems, or videoGalleryItems must not reappear in any other media field or aside element.\n\nMEDIA POOLS\n- Images come only from the image pool: imageSearch results (plus uploaded user images, except on image-self-analysis tasks, where the gallery is cloud reference images only). Every image URL in heroImageUrl, galleryItems, image lists, and relatedStories thumbnails must come from the image pool \u2014 never from news thumbnails, article pages, or source links.\n- Image-self-analysis templates (describe, compare, ocr) are the exception to \"use every provided image\": their cloud imageSearch entries are reference candidates governed by the IMAGE TASK rules \u2014 picked by search-result evidence only, unpicked candidates go to discardedReferences, not the gallery, and spending rules never apply to them.\n- heroVideoUrl may take the best vetted video from videoSearch or from links inside web/news article results; videoGalleryItems and video list items must come from videoSearch results only.\n- shopping results fill shopOffers; reviews and places results only inform business-reputation or local-availability notes in prose \u2014 no dedicated output field exists for them.\n- *WebSearch, webFetch, and news results provide general information: prose, sources, cards, and relatedStories links.\n- Spend each pool entry at most once: when a tool result is used in one field it must not reappear in any other field.\n\nASIDE ELEMENTS\n- relatedStories, cards, and similar secondary elements are asides. They exist to pique the user's interest, never to repeat primary content.\n- An aside must not reuse any URL, link, image, or video that already appears in the primary elements (hero media, galleries, sectionContent, or sources).\n- An aside must not restate text from the primary elements (title, subtitle, summary, lead, keyFindings). Write fresh teaser copy for every aside.\n- If no distinct material remains for asides after the primary elements are filled, omit the aside elements entirely.\n- internationalCoverage entries come only from internationalArticles/internationalVideos (other-language finds) and must never use a URL from the primary elements; primary content never draws from the international pools.";
|
|
273
273
|
|
|
274
274
|
declare const MERGE_TOPIC_RULE = "MERGE TOPIC\n- This is a merge request: the latest user message embeds the previous requests and answers to consolidate ([MERGE REQUEST] sections and the ADDITIONAL INSTRUCTION). The response MUST cover ALL of those combined topics \u2014 same-topic material merges into one consolidated part, unrelated pieces are explicitly marked as unrelated and still rendered.\n- Never add topics beyond the combined ones, and never pull material from any other conversation turn.";
|
|
275
275
|
declare const MERGE_MEDIA_RULES = "MERGE MEDIA\n- The media and sources embedded in the merged message (the previous answers being consolidated) ARE the material \u2014 treat them as vetted and available, just like current tool results.\n- The \"videoSearch results only\" rule and the \"history URLs are never media\" rule are WAIVED for merge requests: consolidate the embedded video lists, image galleries, and source lists into the merged video-gallery, gallery, and sources snippets.\n- Still deduplicate (by canonical provider ID or title for videos, by URL for images), keep every unique URL, and never reuse a URL in two fields.\n- NOTHING IS DROPPED: count the unique media URLs in the embedded material \u2014 the merged video gallery and image gallery must contain every one of them as its own entry (plus fresh media from current tool results). Material media belongs in the galleries; listing it only in the sources is a contract violation.\n- URLs that do not appear in the embedded material or in current tool results are never invented.";
|
package/dist/prompts/index.mjs
CHANGED
|
@@ -176,8 +176,9 @@ var EMBEDDABLE_VIDEO_PROVIDER_CLAUSE = `Only return URLs from supported embeddab
|
|
|
176
176
|
// src/prompts/shared/media-rules.prompt.ts
|
|
177
177
|
var MEDIA_RULES = `MEDIA RULES
|
|
178
178
|
- Media-list templates (imagelist, videolist, shoplist) have NO hero media, and product has an image-only banner with NO hero video \u2014 their mode rules override every hero-related rule below.
|
|
179
|
-
- Use every provided image/video URL
|
|
179
|
+
- Use every provided image/video URL that matches the request's explicit restrictions (platform, creator, count) \u2014 restrictions outrank completeness: a short list of correct items is always right, a padded list of off-target items is a failure.
|
|
180
180
|
- The system removes duplicate media by content hash (images) and canonical provider ID or title (videos). Do not worry if the raw tool results contain duplicates; choose one representative for each unique piece of content.
|
|
181
|
+
- CREATOR/CHANNEL RESTRICTION: when the user restricted content to a named creator or channel, exclude every media item whose channel or source does not match that name \u2014 match case-insensitively, and partial names count ("katame" matches channel "Katame Chill"). availableVideos entries carry a channel field for this check; toolContext echoes the restricted name as contentCreator when one applies.
|
|
181
182
|
- heroVideoUrl takes priority over heroImageUrl when both exist.
|
|
182
183
|
- Fill galleryItems and videoGalleryItems from the supplied media without exceeding imageTargetCount or videoTargetCount.
|
|
183
184
|
- Gallery entries require all mandatory fields.
|
|
@@ -1260,6 +1261,7 @@ function buildToolExecutePrompt(intent) {
|
|
|
1260
1261
|
const timestamp = formatCurrentTimestamp();
|
|
1261
1262
|
const imageCountLine = intent?.imageCount ? `imageCount: retrieve ${intent.imageCount} image(s). Only pass this count to *ImageSearch tools; if omitted, each tool defaults to ${DEFAULT_MEDIA_COUNT}.` : "";
|
|
1262
1263
|
const videoCountLine = intent?.videoCount ? `videoCount: retrieve ${intent.videoCount} video(s). Only pass this count to *VideoSearch tools; if omitted, each tool defaults to ${DEFAULT_MEDIA_COUNT}.` : "";
|
|
1264
|
+
const creatorLine = intent?.contentCreator ? `Creator restriction: the user restricted content to the creator/channel "${intent.contentCreator}" (name copied verbatim from the request). Include this name verbatim in every *VideoSearch and *WebSearch query for this task \u2014 never correct, extend, translate, or rebrand it.` : "";
|
|
1263
1265
|
const countInstruction = intent?.imageCount ? "For *ImageSearch tools, pass count equal to imageCount." : intent?.videoCount ? "For *VideoSearch tools, pass count equal to videoCount." : `Do not pass a count to search tools unless imageCount or videoCount is provided above; each tool will default to ${DEFAULT_MEDIA_COUNT}.`;
|
|
1264
1266
|
const freshnessRules = `FRESHNESS (applies to every search query you emit):
|
|
1265
1267
|
- Current date and time: ${timestamp}.
|
|
@@ -1277,6 +1279,7 @@ ${freshnessRules}
|
|
|
1277
1279
|
${langInstruction ? `${langInstruction}
|
|
1278
1280
|
` : ""}${imageCountLine ? `${imageCountLine}
|
|
1279
1281
|
` : ""}${videoCountLine ? `${videoCountLine}
|
|
1282
|
+
` : ""}${creatorLine ? `${creatorLine}
|
|
1280
1283
|
` : ""}${stockmarketNote ? `${stockmarketNote}
|
|
1281
1284
|
` : ""}Your ONLY job is to call every mandatory tool with an appropriate input.
|
|
1282
1285
|
Do not answer the user, do not explain, and do not produce JSON in this step.
|
|
@@ -1466,6 +1469,9 @@ var IntentSchema = z.object({
|
|
|
1466
1469
|
contentLanguages: z.array(z.string()).default([]).describe(
|
|
1467
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.`
|
|
1468
1471
|
),
|
|
1472
|
+
contentCreator: z.string().default("").describe(
|
|
1473
|
+
'The creator, channel, or publisher the user explicitly restricted the CONTENT to (e.g. "katame" in "japanese dark trap from the channel katame \u2014 drop everything else", "Vox" in "only videos by Vox"). Set ONLY on an explicit creator/channel restriction with exclusive intent; copy the name verbatim exactly as the user wrote it \u2014 never correct, extend, or translate it. Default "": no creator restriction.'
|
|
1474
|
+
),
|
|
1469
1475
|
plan: z.object({
|
|
1470
1476
|
images: ImagePlanSchema.optional().describe("Image processing plan. Only present when images are attached.")
|
|
1471
1477
|
}).default({}).describe("Execution plan for the response step.")
|
|
@@ -2151,6 +2157,7 @@ Video item rules:
|
|
|
2151
2157
|
- Do not include the same video twice (same music video, trailer, or clip), even from different search tools.
|
|
2152
2158
|
- Cross-check every candidate videoUrl against the earlier videolist responses in the conversation before including it.
|
|
2153
2159
|
- When the user asks for videos from a specific platform (e.g. "on YouTube"), include ONLY videos from that platform.
|
|
2160
|
+
- When the user restricts the playlist to a specific creator or channel (e.g. "from the channel katame", "drop everything else"), include ONLY videos whose channel field matches that name \u2014 case-insensitively, and partial matches count ("katame" matches channel "Katame Chill"). Return only the matching videos, however few remain, and say so in the subtitle; never fill the playlist with videos from other channels.
|
|
2154
2161
|
|
|
2155
2162
|
Do NOT include:
|
|
2156
2163
|
- Long descriptions, articles, sections, key findings, or conclusions \u2014 the user wants videos, not prose.
|
|
@@ -2159,6 +2166,7 @@ Do NOT include:
|
|
|
2159
2166
|
|
|
2160
2167
|
No-results rule:
|
|
2161
2168
|
- 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.
|
|
2169
|
+
- When the user restricted results to a named creator and nothing from that creator was retrieved, say so plainly (e.g. 'No videos from <creator> found') \u2014 never present other channels' videos instead.
|
|
2162
2170
|
- Do not invent video URLs to fill the playlist when no results were retrieved.
|
|
2163
2171
|
- 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.
|
|
2164
2172
|
- The dashboard does not render sources for this template. Do not include a sources field.`;
|
|
@@ -2574,6 +2582,12 @@ var EXPLICIT_PROVIDER_RULES = `EXPLICIT PROVIDER MENTIONS (override the "every e
|
|
|
2574
2582
|
- If the user explicitly names a search engine, provider, or platform by name (e.g. "on YouTube", "via Serper", "search Bright Data"), include ONLY that provider's matching tool(s) \u2014 never every tool of that type.
|
|
2575
2583
|
- The mention must be explicit: "videos of X" still means every enabled *VideoSearch tool; "YouTube videos of X" means youtubeVideoSearch only.
|
|
2576
2584
|
- If the named provider's tool is not in the enabled catalog, fall back to the enabled equivalent of that type.`;
|
|
2585
|
+
var CREATOR_RESTRICTION_RULES = `CREATOR RESTRICTION (contentCreator)
|
|
2586
|
+
- When the user explicitly names a creator, channel, label, or publisher with exclusive intent \u2014 "from the channel X", "only videos by X", "from X, drop everything else" \u2014 set contentCreator to that name, copied verbatim exactly as the user wrote it.
|
|
2587
|
+
- Both signals are required: a named creator AND exclusivity. A bare topic mention ("katame style beats", "videos like Vox") sets no restriction.
|
|
2588
|
+
- Genre, mood, or style words are never creators ("dark trap", "lofi beats" \u2192 leave contentCreator empty).
|
|
2589
|
+
- Never correct, extend, translate, or guess the name \u2014 "katame" stays "katame", never "Katame Chill". Later steps match it against the channel names in the results.
|
|
2590
|
+
- contentCreator narrows WHO may supply the content; it never changes WHICH tools are selected \u2014 tool choice still follows the other rules, and a named platform still narrows providers per EXPLICIT PROVIDER MENTIONS.`;
|
|
2577
2591
|
var TOOL_SELECTION_MODEL = `TOOL SELECTION MODEL
|
|
2578
2592
|
Tool selection is MULTI-SET COMPOSITION.
|
|
2579
2593
|
Rules:
|
|
@@ -2729,6 +2743,8 @@ ${TOOL_NAME_RULES}
|
|
|
2729
2743
|
|
|
2730
2744
|
${EXPLICIT_PROVIDER_RULES}
|
|
2731
2745
|
|
|
2746
|
+
${CREATOR_RESTRICTION_RULES}
|
|
2747
|
+
|
|
2732
2748
|
${TOOL_SELECTION_MODEL}
|
|
2733
2749
|
|
|
2734
2750
|
${WHEN_TO_USE_TOOLS_RULES}
|
|
@@ -2959,6 +2975,7 @@ RULES:
|
|
|
2959
2975
|
- If the request is ambiguous set needsClarification=true and provide a concise question in the language identified by the "language" field. The question must offer the most likely interpretations as options.
|
|
2960
2976
|
- imageCount: set only when the user explicitly requests a number of images, or asks for more images without a number (then ${MORE_MEDIA_COUNT}); otherwise omit \u2014 the system uses the configured reference-pool default (Settings Sources) for describe/compare/ocr and ${DEFAULT_MEDIA_COUNT} for other templates.
|
|
2961
2977
|
- videoCount: set only when the user explicitly requests a number of videos, or asks for more videos without a number (then ${MORE_MEDIA_COUNT}); otherwise omit \u2014 the system defaults to ${DEFAULT_MEDIA_COUNT}.
|
|
2978
|
+
- contentCreator: set only on an explicit creator/channel restriction with exclusive intent (per CREATOR RESTRICTION above) \u2014 the name copied verbatim; otherwise omit or leave empty.
|
|
2962
2979
|
- plan.images.resize should be true when images are present, unless the user explicitly asks for full resolution.
|
|
2963
2980
|
- plan.images.variants should only include variants that would materially improve the analysis. Leave empty if the original is sufficient.
|
|
2964
2981
|
- language: detect from the latest user message. ${INTENT_LANGUAGE_FIELD_RULE} Never default to English. If genuinely undetectable, omit the field. ALL human-readable text must be in that language.
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
3
|
+
import { F as FormatZodShapeOptions } from '../format-zod-shape.types-BByqTKpk.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-BByqTKpk.js';
|
|
5
5
|
|
|
6
6
|
declare const BLOCKED_IMAGE_HOSTS: Set<string>;
|
|
7
7
|
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -512,6 +512,9 @@ var IntentSchema = z.object({
|
|
|
512
512
|
contentLanguages: z.array(z.string()).default([]).describe(
|
|
513
513
|
`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.`
|
|
514
514
|
),
|
|
515
|
+
contentCreator: z.string().default("").describe(
|
|
516
|
+
'The creator, channel, or publisher the user explicitly restricted the CONTENT to (e.g. "katame" in "japanese dark trap from the channel katame \u2014 drop everything else", "Vox" in "only videos by Vox"). Set ONLY on an explicit creator/channel restriction with exclusive intent; copy the name verbatim exactly as the user wrote it \u2014 never correct, extend, or translate it. Default "": no creator restriction.'
|
|
517
|
+
),
|
|
515
518
|
plan: z.object({
|
|
516
519
|
images: ImagePlanSchema.optional().describe("Image processing plan. Only present when images are attached.")
|
|
517
520
|
}).default({}).describe("Execution plan for the response step.")
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
+
"version": "1.0.9",
|
|
5
5
|
"packageManager": "pnpm@12.17.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|