@triplef/agent 0.1.16 → 0.1.18

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.
@@ -1,5 +1,5 @@
1
- import { V as VariantName, I as IntentResult, T as TemplateName, F as FormatZodShapeOptions } from '../intent.schema-Bp3p7h7P.js';
2
- export { D as DEFAULT_VARIANT_ID } from '../intent.schema-Bp3p7h7P.js';
1
+ import { V as VariantName, I as IntentResult, T as TemplateName, F as FormatZodShapeOptions } from '../format-zod-shape.helper-DTl2uBDp.js';
2
+ export { D as DEFAULT_VARIANT_ID } from '../format-zod-shape.helper-DTl2uBDp.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';
@@ -110,15 +110,18 @@ declare const TEXT_FAMILIARITY_INSTRUCTIONS = "MODE: TEXT \u2014 FAMILIARITY\n\n
110
110
 
111
111
  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.";
112
112
 
113
- declare const BELIEF_INSTRUCTIONS = "You synthesize higher-level beliefs 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 beliefs \u2014 conclusions that are true of the evidence but not merely restated from it. Every belief 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 belief 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- a belief 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 as a belief \u2014 that is not synthesis\n- a belief 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 belief\n\nRespond with JSON only:\n{\n \"beliefs\": [\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 belief carries one\n- evidence indices are the [n] numbers from the EVIDENCE list \u2014 never invent an index\n- return an empty beliefs array when the evidence is too thin to synthesize anything\n- keep each belief to one sentence";
114
- interface BeliefEvidenceItem {
113
+ 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";
114
+ interface ConvictionEvidenceItem {
115
115
  id: string;
116
116
  text: string;
117
117
  category?: string;
118
+ subject?: string;
119
+ kind?: string;
120
+ stability?: string;
118
121
  }
119
- declare function buildBeliefSynthesisPrompt(evidence: readonly BeliefEvidenceItem[]): string;
122
+ declare function buildConvictionSynthesisPrompt(evidence: readonly ConvictionEvidenceItem[]): string;
120
123
 
121
- declare function buildEncyclopediaClassifyPrompt(knownCategories?: readonly string[]): string;
124
+ declare function buildEncyclopediaClassifyPrompt(knownCategories?: readonly string[], knownTopics?: readonly string[]): string;
122
125
 
123
126
  declare function formatProvenanceLine(line: {
124
127
  text: string;
@@ -126,11 +129,15 @@ declare function formatProvenanceLine(line: {
126
129
  createdAt?: string;
127
130
  }): string;
128
131
 
129
- declare const FRICTION_INSTRUCTIONS = "You screen memory records for contradictions.\n\nGiven one RECORD and a list of CANDIDATES (near-neighbor records), decide whether the RECORD contradicts any CANDIDATE.\n\nA contradiction is a genuine semantic conflict:\n- a negation or polarity flip (\"likes X\" vs \"dislikes X\")\n- a superseding update (\"lives in Berlin\" vs \"moved to Munich\")\n- mutually exclusive claims about the same subject\n\nNOT a contradiction:\n- mere redundancy or restatement (that is handled elsewhere)\n- different subjects or unrelated facts\n- a more specific statement that does not actually conflict with a general one\n\nRespond with JSON only:\n{\n \"contradicts\": boolean,\n \"conflictingId\": \"the candidate id that conflicts (omit when contradicts is false)\",\n \"winnerId\": \"the id that is correct \u2014 the record's id or the conflictingId (omit when neither is clearly right)\",\n \"reason\": \"one sentence: the conflict, and why the winner wins when one is named\"\n}\n\nRules:\n- Name a winner only when one side is clearly correct (e.g. the later statement supersedes the earlier). When both could be true or the truth is unclear, omit winnerId so the conflict stays open.\n- Never invent a conflictingId or winnerId that is not in the input.";
132
+ declare const FRICTION_INSTRUCTIONS = "You screen memory records for contradictions.\n\nGiven one RECORD and a list of CANDIDATES (near-neighbor records), decide whether the RECORD contradicts any CANDIDATE.\n\nA contradiction is a genuine semantic conflict:\n- a negation or polarity flip (\"likes X\" vs \"dislikes X\")\n- a superseding update (\"lives in Berlin\" vs \"moved to Munich\")\n- mutually exclusive claims about the same subject\n\nNOT a contradiction:\n- mere redundancy or restatement (that is handled elsewhere)\n- different subjects or unrelated facts\n- a more specific statement that does not actually conflict with a general one\n\nMETADATA \u2014 each record may show \"(subject: \u2026; category: \u2026; kind: \u2026; stability: \u2026)\":\n- subject: a contradiction requires the SAME subject. Candidates about a different subject are never conflicts, however similar they read.\n- stability: \"volatile\" records describe a current state \u2014 a NEWER volatile statement supersedes the older one (name the newer as winner). \"durable\" statements rarely supersede each other: when neither side is clearly right, omit winnerId so the conflict stays open.\n- kind: polarity flips are the expected contradiction for \"preference\" and \"relationship\" records. For \"fact\", \"project\", \"contact\" and \"possession\" records a conflict means one statement is outdated or wrong \u2014 prefer the newer statement when the dates say which is current.\n- category: conflicts almost always live inside one category family; treat a candidate from a clearly different family skeptically, but never dismiss it on category alone.\n\nRespond with JSON only:\n{\n \"contradicts\": boolean,\n \"conflictingId\": \"the candidate id that conflicts (omit when contradicts is false)\",\n \"winnerId\": \"the id that is correct \u2014 the record's id or the conflictingId (omit when neither is clearly right)\",\n \"reason\": \"one sentence: the conflict, and why the winner wins when one is named\"\n}\n\nRules:\n- Name a winner only when one side is clearly correct (e.g. the later statement supersedes the earlier). When both could be true or the truth is unclear, omit winnerId so the conflict stays open.\n- Never invent a conflictingId or winnerId that is not in the input.";
130
133
  interface FrictionFact {
131
134
  id: string;
132
135
  text: string;
133
136
  createdAt?: string;
137
+ subject?: string;
138
+ category?: string;
139
+ kind?: string;
140
+ stability?: string;
134
141
  }
135
142
  declare function buildFrictionPrompt(input: {
136
143
  record: FrictionFact;
@@ -151,6 +158,10 @@ interface ConsolidateProvenanceLine {
151
158
  text: string;
152
159
  role: string;
153
160
  createdAt?: string;
161
+ subject?: string;
162
+ category?: string;
163
+ kind?: string;
164
+ stability?: string;
154
165
  }
155
166
  declare function buildConsolidatePrompt(params: {
156
167
  newFact: ConsolidateProvenanceLine;
@@ -357,4 +368,4 @@ declare const verdictSpineSnippet: TemplateSnippet;
357
368
 
358
369
  declare const videoGallerySnippet: TemplateSnippet;
359
370
 
360
- export { BELIEF_INSTRUCTIONS, COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, type ContentSystemPromptParams, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, FINAL_REMINDER, FRICTION_INSTRUCTIONS, type FrictionFact, HISTORY_URLS_RULES, IMAGELIST_INSTRUCTIONS, IMAGE_TASK_RULE, INTERNATIONAL_COVERAGE_INSTRUCTIONS, ITEM_SHAPES, JSON_RULES, MEDIA_COUNTS, MEDIA_RULES, MEMORY_CLUSTER_INSTRUCTIONS, MEMORY_CONSOLIDATE_INSTRUCTIONS, MEMORY_PROFILE_INSTRUCTIONS, MEMORY_WRITE_INSTRUCTIONS, MERGE_MEDIA_RULES, MERGE_TOPIC_RULE, MULTIMODAL_POLICY, NOISE_RULES, OCR_INSTRUCTIONS, OCR_VERBATIM_INSTRUCTIONS, PRECEDENCE_RULES, PRODUCT_INSTRUCTIONS, RESPONSE_LAYOUTS, type ResponseLayout, SECURITY_RULES, SHOPLIST_INSTRUCTIONS, SNIPPET_TEMPLATE_PRESETS, SOURCE_TRUTH_RULES, SOURCE_VOICE_RULES, STOCKMARKET_ITEM_INSTRUCTIONS, STOCKMARKET_LIST_INSTRUCTIONS, SUMMARY_INSTRUCTIONS, type SnippetTemplatePreset, type SourcePolicyConfig, type StructuredPromptTemplate, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TOOL_RESULTS_RULES, type TemplateSnippet, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildBeliefSynthesisPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildCorrectionPrompt, buildEncyclopediaClassifyPrompt, buildEnrichPrompt, buildExecuteLanguageInstruction, buildExtractionCorrectionPrompt, buildExtractionPrompt, buildFrictionPrompt, buildImageExecutePrompt, buildIntentCorrectionPrompt, buildIntentSelectionPrompt, buildLanguageRule, buildLayoutInstruction, buildLocalizationRule, buildMemoryProbeSection, buildMemoryProfilePrompt, buildMemoryWritePrompt, buildMergeDirective, buildMissingToolsPrompt, buildOutputContract, buildSnippetInstruction, buildSourcePolicyPrompt, buildStockmarketNote, buildStructuredJsonPrompt, buildStructuredPrompt, buildToolExecutePrompt, buildVocabularySection, bylineDatelineSnippet, cardsSnippet, comparisonSchema, comparisonSnippet, composeSnippetKeys, composeSnippetSchema, conclusionSnippet, evaluationPreset, formatCurrentTimestamp, formatProvenanceLine, formatToolAvailabilityCatalog, formatVariantCatalog, gallerySnippet, getSnippetTemplateKeys, getSnippetTemplateSchema, headerArticleSnippet, headerNewsSnippet, heroMediaSnippet, internationalCoverageSnippet, introductionSnippet, isSnippetTemplate, keyFindingsSnippet, languageCorrectionPrompt, leadSnippet, mergePreset, mergedEvaluationsSnippet, newsKeyFindingsSnippet, newsPreset, quoteSnippet, reasoningSnippet, relatedStoriesSnippet, resolveLanguageName, resolveVariantInstructions, responseLayoutSchema, sourcesSnippet, subjectSchema, subjectsSnippet, summarySnippet, verdictSpineSnippet, videoGallerySnippet };
371
+ export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, type ContentSystemPromptParams, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, FINAL_REMINDER, FRICTION_INSTRUCTIONS, type FrictionFact, HISTORY_URLS_RULES, IMAGELIST_INSTRUCTIONS, IMAGE_TASK_RULE, INTERNATIONAL_COVERAGE_INSTRUCTIONS, ITEM_SHAPES, JSON_RULES, MEDIA_COUNTS, MEDIA_RULES, MEMORY_CLUSTER_INSTRUCTIONS, MEMORY_CONSOLIDATE_INSTRUCTIONS, MEMORY_PROFILE_INSTRUCTIONS, MEMORY_WRITE_INSTRUCTIONS, MERGE_MEDIA_RULES, MERGE_TOPIC_RULE, MULTIMODAL_POLICY, NOISE_RULES, OCR_INSTRUCTIONS, OCR_VERBATIM_INSTRUCTIONS, PRECEDENCE_RULES, PRODUCT_INSTRUCTIONS, RESPONSE_LAYOUTS, type ResponseLayout, SECURITY_RULES, SHOPLIST_INSTRUCTIONS, SNIPPET_TEMPLATE_PRESETS, SOURCE_TRUTH_RULES, SOURCE_VOICE_RULES, STOCKMARKET_ITEM_INSTRUCTIONS, STOCKMARKET_LIST_INSTRUCTIONS, SUMMARY_INSTRUCTIONS, type SnippetTemplatePreset, type SourcePolicyConfig, type StructuredPromptTemplate, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TOOL_RESULTS_RULES, type TemplateSnippet, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildConvictionSynthesisPrompt, buildCorrectionPrompt, buildEncyclopediaClassifyPrompt, buildEnrichPrompt, buildExecuteLanguageInstruction, buildExtractionCorrectionPrompt, buildExtractionPrompt, buildFrictionPrompt, buildImageExecutePrompt, buildIntentCorrectionPrompt, buildIntentSelectionPrompt, buildLanguageRule, buildLayoutInstruction, buildLocalizationRule, buildMemoryProbeSection, buildMemoryProfilePrompt, buildMemoryWritePrompt, buildMergeDirective, buildMissingToolsPrompt, buildOutputContract, buildSnippetInstruction, buildSourcePolicyPrompt, buildStockmarketNote, buildStructuredJsonPrompt, buildStructuredPrompt, buildToolExecutePrompt, buildVocabularySection, bylineDatelineSnippet, cardsSnippet, comparisonSchema, comparisonSnippet, composeSnippetKeys, composeSnippetSchema, conclusionSnippet, evaluationPreset, formatCurrentTimestamp, formatProvenanceLine, formatToolAvailabilityCatalog, formatVariantCatalog, gallerySnippet, getSnippetTemplateKeys, getSnippetTemplateSchema, headerArticleSnippet, headerNewsSnippet, heroMediaSnippet, internationalCoverageSnippet, introductionSnippet, isSnippetTemplate, keyFindingsSnippet, languageCorrectionPrompt, leadSnippet, mergePreset, mergedEvaluationsSnippet, newsKeyFindingsSnippet, newsPreset, quoteSnippet, reasoningSnippet, relatedStoriesSnippet, resolveLanguageName, resolveVariantInstructions, responseLayoutSchema, sourcesSnippet, subjectSchema, subjectsSnippet, summarySnippet, verdictSpineSnippet, videoGallerySnippet };