@triplef/agent 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/prompts/index.d.ts +8 -5
- package/dist/prompts/index.mjs +96 -52
- package/dist/schemas/index.d.ts +10 -7
- package/dist/schemas/index.mjs +34 -27
- package/dist/tools/index.d.ts +9 -6
- package/dist/tools/index.mjs +13 -9
- package/package.json +15 -15
package/dist/prompts/index.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ declare const SUMMARY_INSTRUCTIONS = "MODE: SUMMARY\n\nGoal: produce a concise,
|
|
|
117
117
|
declare const TEXT_INSTRUCTIONS = "MODE: TEXT\n\nGoal: Respond directly to the user 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.";
|
|
118
118
|
declare const TEXT_CODING_INSTRUCTIONS = "MODE: TEXT \u2014 CODING\n\nGoal: Respond as an expert coding assistant 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- Include complete, runnable code examples when helpful.\n- Explain reasoning, trade-offs, assumptions, and edge cases concisely.";
|
|
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
|
+
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.";
|
|
120
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
123
|
|
|
@@ -218,7 +219,7 @@ declare function buildMemoryProfilePrompt(params: {
|
|
|
218
219
|
maxPayloadChars?: number;
|
|
219
220
|
}): string;
|
|
220
221
|
|
|
221
|
-
declare const MEMORY_WRITE_INSTRUCTIONS = "MEMORY WRITE JOB \u2014 one purpose: decide whether THIS turn yielded anything worth persisting, and store it in the correct lane via the memory-partition-remember or memory-cognition-remember tool.\n\nTwo lanes, never confused:\n- memory-partition = the OBJECTIVE fact store: external-world facts, factual records, project details, and events the user stated, subjects gathered this turn, or facts the user asked you to remember.\n- memory-cognition = the SUBJECTIVE profile store: every preference, interest, trait, or internal state of the user (stated or inferred) \u2014 YOUR understanding of the user, persona learnings included.\n\nYou receive:\n- USER REQUEST: what the user asked.\n- PRIOR MEMORY: facts already stored for this user (may be empty).\n- PROBED THIS TURN: what memory-partition-recall already surfaced for this turn (may be empty) \u2014 already known, never re-store.\n- GATHERED DATA: summarized tool results from this turn (web searches, lookups).\n\nStore into the PARTITION lane (call memory-partition-remember) only when it is durable, objective, and user-specific:\n- A factual record the user states or asks you to track (contact info, a decision, a project detail, an event, their setup \u2014 however phrased, any language).\n- Knowledge about a subject the user cares about that was gathered this turn and extends what is already in PRIOR MEMORY.\n\nROUTING CONSTRAINT (absolute): extract ONLY objective, external facts to the partition. You MUST NOT store user preferences, behavioral traits, or internal states there (\"the user likes\u2026\", \"the user is interested in\u2026\", \"the user prefers\u2026\"). All user profile and persona data is deferred to the cognition tier.\n\nStore into the COGNITION lane (call memory-cognition-remember) whenever the turn yields SUBJECTIVE user data, stated or derived:\n- A preference or interest the user states outright (favorite X, a like or dislike, a style choice) \u2014 stated preferences live HERE, never in the partition.\n- An inferred trait, a standing interest, a working nuance, or a connection between facts the turn supports.\n- Never an objective fact \u2014 those belong in the partition lane.\n\nSTORAGE MECHANICS \u2014 how your memory works (write for the retriever):\n- Each stored record is embedded as a whole AND matched sentence-by-sentence at recall time (multi-variant retrieval). One self-contained fact per call; a single long, dense sentence is fine, but lead with the subject (\"Sam's phone number is 555-1234\", never \"His number is \u2026\").\n- Restating a record verbatim OVERWRITES it in place \u2014 updates are restatements of the full corrected statement, not diffs.\n- tags are the ONLY topic-filter vocabulary at recall \u2014 reuse stable, lowercase topic labels (partition lane only). Tags are NARROW and specific: entity names, product names, game titles (\"amd\", \"stellar blade\", \"stellar blade blood rain\").\n- The macro-taxonomy routes a fact into its family hierarchy (partition lane only), top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE (the NODE is the stored record itself \u2014 never named):\n - category (CLUSTER): ONE lowercase PLURAL family noun \u2014 stocks, games, pets, work, health, finance, contacts \u2026\n - community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category (\"survival games\" under \"games\", \"tv shows\" under \"shows\"); omit when no sub-family applies.\n - subject (HUB): the lowercase SINGULAR main subject entity the fact is about (\"project zomboid\", \"amd\", \"sam\") \u2014 a specific name, never pluralized; always include when the fact is about a specific entity.\n A category or community is NEVER a specific entity, product, company, or game title: \"amd\" is a subject under the category \"stocks\"; \"stellar blade\" is a subject under the category \"games\"; a show/work title like \"breaking-bad\" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.\n- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category \"shows\", community \"tv shows\", hub the show's title or the persona name); never \"family\", \"education\", \"business\", or \"science\" for invented content.\n\nTAXONOMY PROBING (pick first, create if necessary): before naming a
|
|
222
|
+
declare const MEMORY_WRITE_INSTRUCTIONS = "MEMORY WRITE JOB \u2014 one purpose: decide whether THIS turn yielded anything worth persisting, and store it in the correct lane via the memory-partition-remember or memory-cognition-remember tool.\n\nTwo lanes, never confused:\n- memory-partition = the OBJECTIVE fact store: external-world facts, factual records, project details, and events the user stated, subjects gathered this turn, or facts the user asked you to remember.\n- memory-cognition = the SUBJECTIVE profile store: every preference, interest, trait, or internal state of the user (stated or inferred) \u2014 YOUR understanding of the user, persona learnings included.\n\nYou receive:\n- USER REQUEST: what the user asked.\n- PRIOR MEMORY: facts already stored for this user (may be empty).\n- PROBED THIS TURN: what memory-partition-recall already surfaced for this turn (may be empty) \u2014 already known, never re-store.\n- GATHERED DATA: summarized tool results from this turn (web searches, lookups).\n\nStore into the PARTITION lane (call memory-partition-remember) only when it is durable, objective, and user-specific:\n- A factual record the user states or asks you to track (contact info, a decision, a project detail, an event, their setup \u2014 however phrased, any language).\n- Knowledge about a subject the user cares about that was gathered this turn and extends what is already in PRIOR MEMORY.\n\nROUTING CONSTRAINT (absolute): extract ONLY objective, external facts to the partition. You MUST NOT store user preferences, behavioral traits, or internal states there (\"the user likes\u2026\", \"the user is interested in\u2026\", \"the user prefers\u2026\"). All user profile and persona data is deferred to the cognition tier.\n\nStore into the COGNITION lane (call memory-cognition-remember) whenever the turn yields SUBJECTIVE user data, stated or derived:\n- A preference or interest the user states outright (favorite X, a like or dislike, a style choice) \u2014 stated preferences live HERE, never in the partition.\n- An inferred trait, a standing interest, a working nuance, or a connection between facts the turn supports.\n- Never an objective fact \u2014 those belong in the partition lane.\n\nSTORAGE MECHANICS \u2014 how your memory works (write for the retriever):\n- Each stored record is embedded as a whole AND matched sentence-by-sentence at recall time (multi-variant retrieval). One self-contained fact per call; a single long, dense sentence is fine, but lead with the subject (\"Sam's phone number is 555-1234\", never \"His number is \u2026\").\n- Restating a record verbatim OVERWRITES it in place \u2014 updates are restatements of the full corrected statement, not diffs.\n- tags are the ONLY topic-filter vocabulary at recall \u2014 reuse stable, lowercase topic labels (partition lane only). Tags are NARROW and specific: entity names, product names, game titles (\"amd\", \"stellar blade\", \"stellar blade blood rain\").\n- The macro-taxonomy routes a fact into its family hierarchy (partition lane only), top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE (the NODE is the stored record itself \u2014 never named):\n - category (CLUSTER): ONE lowercase PLURAL family noun \u2014 stocks, games, pets, work, health, finance, contacts \u2026\n - community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category (\"survival games\" under \"games\", \"tv shows\" under \"shows\"); omit when no sub-family applies.\n - subject (HUB): the lowercase SINGULAR main subject entity the fact is about (\"project zomboid\", \"amd\", \"sam\") \u2014 a specific name, never pluralized; always include when the fact is about a specific entity.\n A category or community is NEVER a specific entity, product, company, or game title: \"amd\" is a subject under the category \"stocks\"; \"stellar blade\" is a subject under the category \"games\"; a show/work title like \"breaking-bad\" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.\n- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category \"shows\", community \"tv shows\", hub the show's title or the persona name); never \"family\", \"education\", \"business\", or \"science\" for invented content.\n\nTAXONOMY PROBING (pick first, create if necessary): before naming a tier label you are not certain exists, call memory-taxonomy-probe top-down \u2014 cluster \u2192 community \u2192 hub \u2192 node \u2014 and ADOPT a returned candidate by naming it VERBATIM in the remember call (its id becomes the next probe's parentId). CREATE a new label only when every candidate misses the meaning \u2014 then follow the phrasing rules (plural family/sub-family, singular hub, singular node aspect) and optionally pass an \"icon\" from the curated set for the label you create. The known-vocabulary section below already lists likely fits; probing confirms them or finds better ones.\n\nDo NOT store:\n- Public facts merely fetched this turn that do not relate to the user (e.g. generic web results).\n- Anything already covered by PRIOR MEMORY or PROBED THIS TURN \u2014 extend or update it via the remember call; do not repeat.\n- Tool artifacts: URLs, search scores, image metadata, raw JSON keys.\n- Inferred, assumed, or extrapolated details about the user that neither their words nor GATHERED DATA support \u2014 if the user did not state it (or clearly imply it), it is not memory; when in doubt, answer \"none\".\n\nRules:\n- Each remember call stores ONE self-contained statement (stand-alone, understandable weeks later without this conversation's context).\n- Call each remember tool once per distinct durable item \u2014 no more.\n- If nothing durable surfaced, produce a one-word text answer (\"none\") and make NO tool call. An empty memory write is a correct outcome, never a failure.";
|
|
222
223
|
declare function buildMemoryWritePrompt(params: {
|
|
223
224
|
userRequest: string;
|
|
224
225
|
priorMemory?: string;
|
|
@@ -242,9 +243,9 @@ declare function buildResearchTriagePrompt(gaps: Array<{
|
|
|
242
243
|
snippet: string;
|
|
243
244
|
}>, maxPayloadChars?: number): string;
|
|
244
245
|
|
|
245
|
-
declare const TAXONOMY_RECONCILE_INSTRUCTIONS = "TAXONOMY RECONCILIATION \u2014 one purpose: decide whether two EXISTING taxonomy labels of the same tier name the same concept and should merge into one.\n\nThe macro-taxonomy, top-down: CLUSTER (plural family, e.g. \"games\") \u2192 COMMUNITY (plural sub-family, e.g. \"survival-games\") \u2192 HUB (singular subject entity, e.g. \"project zomboid\") \u2192 plus TAG labels (narrow recall vocabulary).\n\nMerge ONLY wording variants of one concept: casing/formatting drift (\"Video Games\" / \"video-games\"), singular/plural drift inside a family tier (\"survival game\" / \"survival-games\"), abbreviation with identical expansion (\"nlp\" / \"natural-language-processing\").\nNEVER merge: two entities that merely share a word (\"apple\" the company vs \"apple\" the fruit), a parent and its child (\"games\" vs \"survival-games\"), a broad tier and a specific entity (\"games\" vs \"project zomboid\"), or two genuinely different topics that happen to look similar. When in doubt, answer DISTINCT \u2014 a missed merge is cleaned up later; a wrong merge destroys both labels' meaning forever.";
|
|
246
|
+
declare const TAXONOMY_RECONCILE_INSTRUCTIONS = "TAXONOMY RECONCILIATION \u2014 one purpose: decide whether two EXISTING taxonomy labels of the same tier name the same concept and should merge into one.\n\nThe macro-taxonomy, top-down: CLUSTER (plural family, e.g. \"games\") \u2192 COMMUNITY (plural sub-family, e.g. \"survival-games\") \u2192 HUB (singular subject entity, e.g. \"project zomboid\") \u2192 NODE (singular aspect under the hub, e.g. \"base building\") \u2192 plus TAG labels (narrow recall vocabulary).\n\nMerge ONLY wording variants of one concept: casing/formatting drift (\"Video Games\" / \"video-games\"), singular/plural drift inside a family tier (\"survival game\" / \"survival-games\"), abbreviation with identical expansion (\"nlp\" / \"natural-language-processing\").\nNEVER merge: two entities that merely share a word (\"apple\" the company vs \"apple\" the fruit), a parent and its child (\"games\" vs \"survival-games\"), a broad tier and a specific entity (\"games\" vs \"project zomboid\"), or two genuinely different topics that happen to look similar. When in doubt, answer DISTINCT \u2014 a missed merge is cleaned up later; a wrong merge destroys both labels' meaning forever.";
|
|
246
247
|
declare function buildTaxonomyPairPrompt(params: {
|
|
247
|
-
kind: 'cluster' | 'community' | 'hub' | 'tag';
|
|
248
|
+
kind: 'cluster' | 'community' | 'hub' | 'node' | 'tag';
|
|
248
249
|
labelA: string;
|
|
249
250
|
labelB: string;
|
|
250
251
|
countA: number;
|
|
@@ -252,7 +253,9 @@ declare function buildTaxonomyPairPrompt(params: {
|
|
|
252
253
|
}): string;
|
|
253
254
|
declare function buildTaxonomyReconcileSystemPrompt(): string;
|
|
254
255
|
|
|
255
|
-
|
|
256
|
+
type ExtractionSourceRole = 'user' | 'assistant';
|
|
257
|
+
|
|
258
|
+
declare function buildExtractionPrompt(vocabulary?: TaxonomyVocabulary, role?: ExtractionSourceRole): string;
|
|
256
259
|
declare function buildExtractionCorrectionPrompt(error: string): string;
|
|
257
260
|
|
|
258
261
|
declare function buildVocabularySection(vocab?: TaxonomyVocabulary): string;
|
|
@@ -423,4 +426,4 @@ declare const verdictSpineSnippet: TemplateSnippet;
|
|
|
423
426
|
|
|
424
427
|
declare const videoGallerySnippet: TemplateSnippet;
|
|
425
428
|
|
|
426
|
-
export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, type ContentSystemPromptParams, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, ENCYCLOPEDIA_INGEST_TRIAGE_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, RESEARCH_FRICTION_QUERY_INSTRUCTIONS, RESEARCH_TRIAGE_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, TAXONOMY_RECONCILE_INSTRUCTIONS, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TOOL_RESULTS_RULES, type TaxonomyVocabulary, type TemplateSnippet, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildCognitionProfileSection, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildConvictionSynthesisPrompt, buildCorrectionPrompt, buildDescribePdfPagePrompt, buildEncyclopediaClassifyPrompt, buildEncyclopediaIngestTriagePrompt, buildEnrichPrompt, buildExecuteLanguageInstruction, buildExtractionCorrectionPrompt, buildExtractionPrompt, buildFrictionPrompt, buildImageExecutePrompt, buildIntentCorrectionPrompt, buildIntentSelectionPrompt, buildLanguageRule, buildLayoutInstruction, buildLocalizationRule, buildMemoryProbeSection, buildMemoryProfilePrompt, buildMemoryWritePrompt, buildMergeDirective, buildMissingToolsPrompt, buildOutputContract, buildResearchFrictionQueryPrompt, buildResearchTriagePrompt, buildSnippetInstruction, buildSourcePolicyPrompt, buildStockmarketNote, buildStructuredJsonPrompt, buildStructuredPrompt, buildSynopsisProbeSection, buildTaxonomyPairPrompt, buildTaxonomyReconcileSystemPrompt, 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 };
|
|
429
|
+
export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, type ContentSystemPromptParams, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, ENCYCLOPEDIA_INGEST_TRIAGE_INSTRUCTIONS, type ExtractionSourceRole, 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, RESEARCH_FRICTION_QUERY_INSTRUCTIONS, RESEARCH_TRIAGE_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, TAXONOMY_RECONCILE_INSTRUCTIONS, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TEXT_OPINION_INSTRUCTIONS, TOOL_RESULTS_RULES, type TaxonomyVocabulary, type TemplateSnippet, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildCognitionProfileSection, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildConvictionSynthesisPrompt, buildCorrectionPrompt, buildDescribePdfPagePrompt, buildEncyclopediaClassifyPrompt, buildEncyclopediaIngestTriagePrompt, buildEnrichPrompt, buildExecuteLanguageInstruction, buildExtractionCorrectionPrompt, buildExtractionPrompt, buildFrictionPrompt, buildImageExecutePrompt, buildIntentCorrectionPrompt, buildIntentSelectionPrompt, buildLanguageRule, buildLayoutInstruction, buildLocalizationRule, buildMemoryProbeSection, buildMemoryProfilePrompt, buildMemoryWritePrompt, buildMergeDirective, buildMissingToolsPrompt, buildOutputContract, buildResearchFrictionQueryPrompt, buildResearchTriagePrompt, buildSnippetInstruction, buildSourcePolicyPrompt, buildStockmarketNote, buildStructuredJsonPrompt, buildStructuredPrompt, buildSynopsisProbeSection, buildTaxonomyPairPrompt, buildTaxonomyReconcileSystemPrompt, 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 };
|
package/dist/prompts/index.mjs
CHANGED
|
@@ -2105,6 +2105,17 @@ ${TEXT_BASE_INSTRUCTIONS}
|
|
|
2105
2105
|
- Keep it short: one to three compact paragraphs, no report structure, no headings unless the answer genuinely needs them.
|
|
2106
2106
|
- 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\xFChrlichen Artikel oder eine Bewertung dazu?").
|
|
2107
2107
|
- Do NOT produce the article, news piece, or evaluation now \u2014 the offer is only an offer.`;
|
|
2108
|
+
var TEXT_OPINION_INSTRUCTIONS = `MODE: TEXT \u2014 OPINION
|
|
2109
|
+
|
|
2110
|
+
Goal: 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.
|
|
2111
|
+
|
|
2112
|
+
${TEXT_BASE_INSTRUCTIONS}
|
|
2113
|
+
- 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.
|
|
2114
|
+
- 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.
|
|
2115
|
+
- 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.
|
|
2116
|
+
- 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.
|
|
2117
|
+
- 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?").
|
|
2118
|
+
- Do NOT produce the structured evaluation now \u2014 the offer is only an offer.`;
|
|
2108
2119
|
|
|
2109
2120
|
// src/prompts/instructions/videolist.instruction.ts
|
|
2110
2121
|
var VIDEOLIST_INSTRUCTIONS = `MODE: VIDEOLIST
|
|
@@ -2167,7 +2178,7 @@ var TEMPLATE_VARIANTS = {
|
|
|
2167
2178
|
videolist: ["default"],
|
|
2168
2179
|
stockmarketitem: ["default"],
|
|
2169
2180
|
stockmarketlist: ["default"],
|
|
2170
|
-
text: ["default", "coding", "familiarity"]
|
|
2181
|
+
text: ["default", "coding", "familiarity", "opinion"]
|
|
2171
2182
|
};
|
|
2172
2183
|
var VARIANT_INSTRUCTIONS = {
|
|
2173
2184
|
// describe
|
|
@@ -2197,7 +2208,8 @@ var VARIANT_INSTRUCTIONS = {
|
|
|
2197
2208
|
// text
|
|
2198
2209
|
"text:default": TEXT_INSTRUCTIONS,
|
|
2199
2210
|
"text:coding": TEXT_CODING_INSTRUCTIONS,
|
|
2200
|
-
"text:familiarity": TEXT_FAMILIARITY_INSTRUCTIONS
|
|
2211
|
+
"text:familiarity": TEXT_FAMILIARITY_INSTRUCTIONS,
|
|
2212
|
+
"text:opinion": TEXT_OPINION_INSTRUCTIONS
|
|
2201
2213
|
};
|
|
2202
2214
|
function resolveVariantInstructions(template, variantId = DEFAULT_VARIANT_ID) {
|
|
2203
2215
|
const instructions = VARIANT_INSTRUCTIONS[`${template}:${variantId}`] ?? VARIANT_INSTRUCTIONS[`${template}:${DEFAULT_VARIANT_ID}`] ?? "";
|
|
@@ -2243,14 +2255,16 @@ var TEMPLATE_RULES = `TEMPLATE RULES
|
|
|
2243
2255
|
- summary: for recapping prior conversation or a provided topic without new images. No tools unless the user explicitly asks for external facts.
|
|
2244
2256
|
When the user asks for external facts, online research, images, or videos with a summary, include the enabled *WebSearch tool and every enabled *ImageSearch and *VideoSearch tool (same media behavior as article).
|
|
2245
2257
|
Only set imageCount or videoCount when the user explicitly requests a specific number; otherwise omit them and the system will use configured defaults.
|
|
2246
|
-
- evaluation: for
|
|
2258
|
+
- evaluation: for commissioned critiques, reviews, assessments, or pros/cons weigh-ups of something from the conversation \u2014 the structured editorial review piece.
|
|
2259
|
+
A request phrased as a question seeking YOUR opinion or recommendation ("do you think\u2026?", "should I\u2026?", "is it worth it?", "what's your take?") is NOT an evaluation \u2014 classify it as template "text", variant "opinion" (see OPINION QUESTION RULES).
|
|
2247
2260
|
The evaluation template ALWAYS includes every enabled *ImageSearch and *VideoSearch tool (same media behavior as article) \u2014 every evaluation renders hero and gallery media of its subject.
|
|
2248
2261
|
Include the enabled *WebSearch tool when the user asks for external facts, online research, or the subject needs grounding beyond the conversation.
|
|
2249
2262
|
Only set imageCount or videoCount when the user explicitly requests a specific number; otherwise omit them and the system will use configured defaults.
|
|
2250
2263
|
- product: for specific product lookups with purchase intent \u2014 prices, shop offers, deals, where to buy. Tool selection per the PRODUCT TEMPLATE RULES above.
|
|
2251
2264
|
- shoplist: for repeated purchase questions about a product already covered by a full product overview \u2014 prices again, other shops, availability. Tool selection per the SHOPLIST TEMPLATE RULES above.
|
|
2252
2265
|
- text: catch-all for chat, coding, creative writing. Tools only when external data needed.
|
|
2253
|
-
Familiarity questions ("do you know X?", "have you heard of X?") use the "familiarity" variant \u2014 see FAMILIARITY QUESTION RULES
|
|
2266
|
+
Familiarity questions ("do you know X?", "have you heard of X?") use the "familiarity" variant \u2014 see FAMILIARITY QUESTION RULES.
|
|
2267
|
+
Opinion and recommendation questions ("do you think\u2026?", "should I\u2026?", "would you recommend\u2026?") use the "opinion" variant \u2014 see OPINION QUESTION RULES.`;
|
|
2254
2268
|
var MEDIA_REQUEST_RULES = `MEDIA REQUEST RULES
|
|
2255
2269
|
- When the user asks for media (images, videos, screenshots, photos, graphics) about a topic, this is NOT a clarification \u2014 classify it with the appropriate media tools.
|
|
2256
2270
|
- If the user wants ONLY images or ONLY videos (no accompanying article), choose "imagelist" or "videolist" respectively.
|
|
@@ -2298,6 +2312,9 @@ Use these examples to resolve "news" vs "article":
|
|
|
2298
2312
|
- User: "latest music videos from Billie Eilish" \u2192 template: "videolist", tools: [serperVideoSearch]
|
|
2299
2313
|
- User: "how does NTE compare to Wuthering Waves?" \u2192 template: "evaluation", tools: [serperWebSearch, serperImageSearch, serperVideoSearch]
|
|
2300
2314
|
- User: "iPhone 16 Pro vs Pixel 9 Pro \u2014 which camera is better?" \u2192 template: "evaluation", tools: [serperWebSearch, serperImageSearch, serperVideoSearch]
|
|
2315
|
+
- User: "write me a full review of NTE with pros and cons" \u2192 template: "evaluation", tools: [serperWebSearch, serperImageSearch, serperVideoSearch]
|
|
2316
|
+
- User: "do you think I should try NTE?" \u2192 template: "text", prompt: "opinion", tools: [serperWebSearch]
|
|
2317
|
+
- User: "would you recommend the Gothic remake to a newcomer?" \u2192 template: "text", prompt: "opinion", tools: [serperWebSearch]
|
|
2301
2318
|
|
|
2302
2319
|
Follow-up media requests (user adds images/videos/news to established topic):
|
|
2303
2320
|
- User: "show me images" (after discussing a game) \u2192 template: "article", tools: [serperWebSearch, serperImageSearch, serperVideoSearch]
|
|
@@ -2324,9 +2341,8 @@ var FOLLOW_UP_RULES = `FOLLOW-UP / REFINEMENT RULES
|
|
|
2324
2341
|
\u2192 If the user also asks for external facts, online research, images, or videos, include the enabled *WebSearch tool and every enabled *ImageSearch and *VideoSearch tool.
|
|
2325
2342
|
\u2192 Otherwise, do NOT invoke a *WebSearch or other tools unless external facts are explicitly requested.
|
|
2326
2343
|
- If the user asks for an evaluation, critique, review, pros/cons, or judgment about items from the prior conversation:
|
|
2327
|
-
\u2192
|
|
2328
|
-
\u2192
|
|
2329
|
-
\u2192 Also include the enabled *WebSearch tool when the user asks for external facts or online research.
|
|
2344
|
+
\u2192 For a commissioned structured review piece: choose template "evaluation", include every enabled *ImageSearch and *VideoSearch tool, and also the enabled *WebSearch tool when the user asks for external facts or online research.
|
|
2345
|
+
\u2192 When the user instead asks for YOUR take, opinion, or a personal recommendation ("do you think I should\u2026?", "is it still worth it?", "your honest opinion?"): choose template "text", prompt "opinion" per the OPINION QUESTION RULES \u2014 no media tools.
|
|
2330
2346
|
- Examples:
|
|
2331
2347
|
Prior: article about "Gothic remake". User: "now show me images" \u2192 article, tools: [serperWebSearch, serperImageSearch]
|
|
2332
2348
|
Prior: article about "Gothic remake". User: "add videos too" \u2192 article, tools: [serperWebSearch, serperImageSearch, serperVideoSearch]
|
|
@@ -2337,7 +2353,7 @@ var FOLLOW_UP_RULES = `FOLLOW-UP / REFINEMENT RULES
|
|
|
2337
2353
|
Prior: article about "Gothic remake". User: "evaluate this game" \u2192 evaluation, tools: [serperImageSearch, serperVideoSearch].
|
|
2338
2354
|
Prior: product overview for "Sony WH-1000XM5" ([Template: product]). User: "where else can I buy it?" \u2192 shoplist, tools: [serperWebSearch, serperShoppingSearch, serperImageSearch].
|
|
2339
2355
|
Prior: product overview for "Samsung 990 Pro 2TB" ([Template: product]). User: "gibt es das auch woanders g\xFCnstiger?" (German \u2014 is it cheaper anywhere else?) \u2192 shoplist, tools: [serperWebSearch, serperShoppingSearch, serperImageSearch].
|
|
2340
|
-
Prior: product overview for "Sony WH-1000XM5" ([Template: product]). User: "is it still worth it?" \u2192
|
|
2356
|
+
Prior: product overview for "Sony WH-1000XM5" ([Template: product]). User: "is it still worth it?" \u2192 text:opinion (your verdict asked, not a new review piece), tools: [serperWebSearch].
|
|
2341
2357
|
- If the user provides corrections (e.g. "I wanted images"), add the missing tools to the existing set.
|
|
2342
2358
|
- Do NOT downgrade template to text just because the user is clarifying.
|
|
2343
2359
|
- If the latest message alone seems vague ("show me"), check prior turns for context.
|
|
@@ -2349,7 +2365,7 @@ When template is article, news, or text and the user query involves:
|
|
|
2349
2365
|
- factual research, data, statistics: include the enabled *WebSearch tool
|
|
2350
2366
|
- specific named entities (games, movies, books, people): include the enabled *WebSearch tool
|
|
2351
2367
|
- current events, news, announcements: include the enabled *WebSearch tool + newsSearch
|
|
2352
|
-
- personal opinion, creative writing, brainstorming: exclude *WebSearch tools
|
|
2368
|
+
- personal opinion, creative writing, brainstorming: exclude *WebSearch tools \u2014 EXCEPT opinion questions about recent, niche, or living subjects (see OPINION QUESTION RULES), which include the enabled *WebSearch tool for grounding
|
|
2353
2369
|
- coding help: exclude the *WebSearch tool unless user asks about a specific library/framework version`;
|
|
2354
2370
|
var CLARIFICATION_RULES = `CLARIFICATION RULES
|
|
2355
2371
|
If the user request is ambiguous, incomplete, or could refer to multiple
|
|
@@ -2640,7 +2656,8 @@ var VARIANT_SELECTION_RULES = `PROMPT SELECTION RULES
|
|
|
2640
2656
|
- default for product: use when the user asks about a specific product they want to buy, compare prices, find where to buy something, or look up best deals.
|
|
2641
2657
|
- default for shoplist: use for follow-up shopping questions about a product the conversation already covered with a full product overview \u2014 the user keeps asking about the same product (prices again, other shops, availability) and needs a compact purchase list, not another deep-dive.
|
|
2642
2658
|
- coding: use for text when the user asks for code help or technical implementation.
|
|
2643
|
-
- familiarity: use for text when the user asks whether you know or have heard of something (see FAMILIARITY QUESTION RULES)
|
|
2659
|
+
- familiarity: use for text when the user asks whether you know or have heard of something (see FAMILIARITY QUESTION RULES).
|
|
2660
|
+
- opinion: use for text when the user asks for YOUR personal judgment, take, opinion, or recommendation on a subject (see OPINION QUESTION RULES).`;
|
|
2644
2661
|
var FAMILIARITY_QUESTION_RULES = `FAMILIARITY QUESTION RULES
|
|
2645
2662
|
- Questions asking whether you know or have heard of something are familiarity questions only when the subject is public world knowledge and the user is not referring to their history with you (see MEMORY RULES).
|
|
2646
2663
|
- Familiarity questions MUST use template "text" with prompt variant "familiarity" \u2014 NEVER "article", "news", or "evaluation". The user is opening a conversation about the subject, not commissioning a report.
|
|
@@ -2648,6 +2665,13 @@ var FAMILIARITY_QUESTION_RULES = `FAMILIARITY QUESTION RULES
|
|
|
2648
2665
|
- Example: "kennst du dich mit NTE aus?" \u2192 template: "text", prompt: "familiarity", tools: [serperWebSearch]
|
|
2649
2666
|
- Example: "have you heard of the new Dune movie?" \u2192 template: "text", prompt: "familiarity", tools: [serperWebSearch]
|
|
2650
2667
|
- Example: "do you know the Pythagorean theorem?" \u2192 template: "text", prompt: "familiarity", tools: []`;
|
|
2668
|
+
var OPINION_QUESTION_RULES = `OPINION QUESTION RULES
|
|
2669
|
+
- Questions asking for YOUR personal judgment, take, opinion, or recommendation \u2014 "do you think X is any good?", "should I try X?", "would you recommend X?", "what's your take on X?", "is X worth it?" \u2014 are opinion questions: the user wants your conversational verdict, not a structured review document.
|
|
2670
|
+
- Opinion questions MUST use template "text" with prompt variant "opinion" \u2014 NEVER "article", "news", or "evaluation". The evaluation template renders an editorial review piece (headline, score panel, galleries) \u2014 that shape is only for explicit review commissions ("evaluate X", "write a review of X with pros and cons").
|
|
2671
|
+
- Include the enabled *WebSearch tool whenever the subject is niche, recent, a living topic, or a specific named entity \u2014 a grounded verdict needs the current reception and facts. This overrides the "personal opinion: exclude *WebSearch" line in TOPIC-BASED TOOL SELECTION for living subjects. Omit tools only for timeless, purely conceptual subjects.
|
|
2672
|
+
- Example: "do you think i should try aion 2?" \u2192 template: "text", prompt: "opinion", tools: [serperWebSearch]
|
|
2673
|
+
- Example: "would you recommend the new Dune movie to a casual viewer?" \u2192 template: "text", prompt: "opinion", tools: [serperWebSearch]
|
|
2674
|
+
- Example: "what do you think of stoicism?" (timeless concept) \u2192 template: "text", prompt: "opinion", tools: []`;
|
|
2651
2675
|
|
|
2652
2676
|
// src/prompts/harness/intent-selection.prompt.ts
|
|
2653
2677
|
function buildIntentSelectionPrompt(toolNames, language) {
|
|
@@ -2685,6 +2709,8 @@ ${MEMORY_RULES}
|
|
|
2685
2709
|
|
|
2686
2710
|
${FAMILIARITY_QUESTION_RULES}
|
|
2687
2711
|
|
|
2712
|
+
${OPINION_QUESTION_RULES}
|
|
2713
|
+
|
|
2688
2714
|
${PRODUCT_TEMPLATE_RULES}
|
|
2689
2715
|
|
|
2690
2716
|
${SHOPLIST_TEMPLATE_RULES}
|
|
@@ -3035,14 +3061,14 @@ var EncyclopediaClassifySchema = z.object({
|
|
|
3035
3061
|
*/
|
|
3036
3062
|
category: z.string(),
|
|
3037
3063
|
/**
|
|
3038
|
-
* One lowercase PLURAL sub-family
|
|
3064
|
+
* One lowercase PLURAL sub-family narrowing the category (e.g.
|
|
3039
3065
|
* `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3040
|
-
* constellation's COMMUNITY tier, one level below the cluster.
|
|
3041
|
-
*
|
|
3042
|
-
* company, or title — a show/work title like `breaking-bad` is a
|
|
3043
|
-
*
|
|
3066
|
+
* constellation's COMMUNITY tier, one level below the cluster. The chain
|
|
3067
|
+
* is strict, so community is always present. Never a specific entity,
|
|
3068
|
+
* product, company, or title — a show/work title like `breaking-bad` is a
|
|
3069
|
+
* hub, never a community.
|
|
3044
3070
|
*/
|
|
3045
|
-
community: z.string()
|
|
3071
|
+
community: z.string(),
|
|
3046
3072
|
/**
|
|
3047
3073
|
* The narrow SINGULAR subject entity the document is about (e.g.
|
|
3048
3074
|
* `wuthering waves`, `q3 budget`) — the constellation's HUB tier. A short,
|
|
@@ -3050,11 +3076,13 @@ var EncyclopediaClassifySchema = z.object({
|
|
|
3050
3076
|
*/
|
|
3051
3077
|
topic: z.string(),
|
|
3052
3078
|
/**
|
|
3053
|
-
*
|
|
3054
|
-
*
|
|
3055
|
-
*
|
|
3056
|
-
*
|
|
3079
|
+
* The SINGULAR aspect of the document under its hub (e.g. `base building`
|
|
3080
|
+
* under `project zomboid`, `department spend` under `q3 budget`) — the
|
|
3081
|
+
* constellation's NODE tier, one level below the hub: a named sub-entity
|
|
3082
|
+
* or topic branch the chunks file under. Reuse the known vocabulary
|
|
3083
|
+
* instead of minting near-variants.
|
|
3057
3084
|
*/
|
|
3085
|
+
node: z.string(),
|
|
3058
3086
|
icon: z.string().optional()
|
|
3059
3087
|
});
|
|
3060
3088
|
|
|
@@ -3093,24 +3121,25 @@ function buildEncyclopediaClassifyPrompt(vocabulary = {}) {
|
|
|
3093
3121
|
after: `
|
|
3094
3122
|
YOUR TASK \u2014 label one stored source document with its place in the macro-taxonomy:
|
|
3095
3123
|
|
|
3096
|
-
TAXONOMY HIERARCHY (top-down): CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE
|
|
3124
|
+
TAXONOMY HIERARCHY (top-down): CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE \u2192 LEAF
|
|
3097
3125
|
- CLUSTER = a broad PLURAL family noun ("games", "work", "health") \u2014 the highest logical bucket.
|
|
3098
3126
|
- COMMUNITY = a PLURAL sub-family under one cluster ("survival-games" under "games") \u2014 a genre or domain branch.
|
|
3099
3127
|
- HUB = the SINGULAR main subject entity anchoring the document ("project zomboid", "wuthering waves") \u2014 a specific name, never pluralized.
|
|
3100
|
-
- NODE = the
|
|
3128
|
+
- NODE = the SINGULAR aspect of the document under its hub ("base building" under "project zomboid", "department spend" under "q3 budget") \u2014 a named sub-entity or topic branch; the document's chunks are the LEAVES filed under it. The chain is strict: ALL FOUR labels are always present.
|
|
3101
3129
|
|
|
3102
3130
|
- The document may be a fetched web page, an uploaded file, or a search-result snippet. Classify by its CONTENT, never by its source shape \u2014 a file has no domain, and that must not matter.
|
|
3103
3131
|
- FICTION & ENTERTAINMENT CONTENT (absolute): a document about an entertainment work or fictional universe classifies by its real-world MEDIUM, never by the work's in-universe domains. A TV episode page about a character's family or career is NOT "family", "education", "business", or "science" \u2014 the category is the medium family (e.g. "shows"), the community a true plural sub-family (e.g. "tv-shows"), and the work's title is the topic (e.g. "breaking bad"), never the community.
|
|
3104
3132
|
- category (CLUSTER): ONE broad lowercase PLURAL family noun (e.g. "games", "work", "health", "finance") that groups the topic into a family. It labels the TOPIC \u2014 never a side theme or an incidental mention on the page. Never a specific entity, product, company, or title.
|
|
3105
|
-
- community (COMMUNITY
|
|
3133
|
+
- community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category (e.g. "survival-games" under "games"). Always present; never a specific entity, product, company, or title \u2014 a show/work title like "breaking-bad" is a hub, never a community.
|
|
3106
3134
|
- topic (HUB): the document's MAIN subject entity \u2014 what the whole source is about (e.g. "wuthering waves", "q3 budget", "rust borrow checker") \u2014 SINGULAR and specific. A short, reusable label \u2014 not a sentence, not a URL, not a filename, never a domain or a site name. Never a sub-part of the main subject (a chapter, a location, one feature) and never an adjacent proper noun (a publisher, an author, a related event) \u2014 when a title-level entity exists, it is the topic.
|
|
3135
|
+
- node (NODE): the SINGULAR aspect of the document under its hub \u2014 the named sub-entity or topic branch the source focuses on (e.g. "base building" under "project zomboid"). Short and reusable \u2014 never a sentence, never a URL.
|
|
3107
3136
|
- When the document is about a KNOWN TOPIC, output that label VERBATIM \u2014 prefer "neverness to everness" over minting a variant like "nte".
|
|
3108
|
-
- TAXONOMY PROBING (pick first, create if necessary): when the memory-taxonomy-probe tool is available, probe top-down \u2014 cluster \u2192 community \u2192 hub \u2014 before answering, and ADOPT returned candidates VERBATIM (a candidate's id becomes the next probe's parentId). CREATE a new label only when no candidate fits; on creation you may pass one "icon" from the curated taxonomy icon set for the deepest NEW label.
|
|
3137
|
+
- TAXONOMY PROBING (pick first, create if necessary): when the memory-taxonomy-probe tool is available, probe top-down \u2014 cluster \u2192 community \u2192 hub \u2192 node \u2014 before answering, and ADOPT returned candidates VERBATIM (a candidate's id becomes the next probe's parentId). CREATE a new label only when no candidate fits; on creation you may pass one "icon" from the curated taxonomy icon set for the deepest NEW label.
|
|
3109
3138
|
${buildVocabularySection(vocabulary)}
|
|
3110
3139
|
RULES:
|
|
3111
3140
|
- Return ONLY a single valid JSON object matching the exact schema above.
|
|
3112
3141
|
- No markdown code fences, no explanations, preamble, or postscript.
|
|
3113
|
-
- Never output undefined or null. "category"
|
|
3142
|
+
- Never output undefined or null. "category", "community", "topic", and "node" are always present; "icon" is omitted when it doesn't apply.
|
|
3114
3143
|
|
|
3115
3144
|
FINAL REMINDER:
|
|
3116
3145
|
- Output ONLY valid JSON matching the exact schema above. No markdown code fences, no explanations, preamble, or postscript.`
|
|
@@ -3515,7 +3544,7 @@ STORAGE MECHANICS \u2014 how your memory works (write for the retriever):
|
|
|
3515
3544
|
A category or community is NEVER a specific entity, product, company, or game title: "amd" is a subject under the category "stocks"; "stellar blade" is a subject under the category "games"; a show/work title like "breaking-bad" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.
|
|
3516
3545
|
- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category "shows", community "tv shows", hub the show's title or the persona name); never "family", "education", "business", or "science" for invented content.
|
|
3517
3546
|
|
|
3518
|
-
TAXONOMY PROBING (pick first, create if necessary): before naming a
|
|
3547
|
+
TAXONOMY PROBING (pick first, create if necessary): before naming a tier label you are not certain exists, call memory-taxonomy-probe top-down \u2014 cluster \u2192 community \u2192 hub \u2192 node \u2014 and ADOPT a returned candidate by naming it VERBATIM in the remember call (its id becomes the next probe's parentId). CREATE a new label only when every candidate misses the meaning \u2014 then follow the phrasing rules (plural family/sub-family, singular hub, singular node aspect) and optionally pass an "icon" from the curated set for the label you create. The known-vocabulary section below already lists likely fits; probing confirms them or finds better ones.
|
|
3519
3548
|
|
|
3520
3549
|
Do NOT store:
|
|
3521
3550
|
- Public facts merely fetched this turn that do not relate to the user (e.g. generic web results).
|
|
@@ -3648,7 +3677,7 @@ var TaxonomyPairVerdictSchema = z.object({
|
|
|
3648
3677
|
// src/prompts/memory/taxonomy-reconcile-prompt.constant.ts
|
|
3649
3678
|
var TAXONOMY_RECONCILE_INSTRUCTIONS = `TAXONOMY RECONCILIATION \u2014 one purpose: decide whether two EXISTING taxonomy labels of the same tier name the same concept and should merge into one.
|
|
3650
3679
|
|
|
3651
|
-
The macro-taxonomy, top-down: CLUSTER (plural family, e.g. "games") \u2192 COMMUNITY (plural sub-family, e.g. "survival-games") \u2192 HUB (singular subject entity, e.g. "project zomboid") \u2192 plus TAG labels (narrow recall vocabulary).
|
|
3680
|
+
The macro-taxonomy, top-down: CLUSTER (plural family, e.g. "games") \u2192 COMMUNITY (plural sub-family, e.g. "survival-games") \u2192 HUB (singular subject entity, e.g. "project zomboid") \u2192 NODE (singular aspect under the hub, e.g. "base building") \u2192 plus TAG labels (narrow recall vocabulary).
|
|
3652
3681
|
|
|
3653
3682
|
Merge ONLY wording variants of one concept: casing/formatting drift ("Video Games" / "video-games"), singular/plural drift inside a family tier ("survival game" / "survival-games"), abbreviation with identical expansion ("nlp" / "natural-language-processing").
|
|
3654
3683
|
NEVER merge: two entities that merely share a word ("apple" the company vs "apple" the fruit), a parent and its child ("games" vs "survival-games"), a broad tier and a specific entity ("games" vs "project zomboid"), or two genuinely different topics that happen to look similar. When in doubt, answer DISTINCT \u2014 a missed merge is cleaned up later; a wrong merge destroys both labels' meaning forever.`;
|
|
@@ -3688,31 +3717,35 @@ var ExtractedFactSchema = z.object({
|
|
|
3688
3717
|
*/
|
|
3689
3718
|
text: z.string(),
|
|
3690
3719
|
/**
|
|
3691
|
-
* The lowercase entity the fact is about
|
|
3692
|
-
*
|
|
3693
|
-
*
|
|
3694
|
-
* facts about the SAME subject.
|
|
3720
|
+
* The lowercase entity the fact is about — the chain's HUB tier:
|
|
3721
|
+
* singular, specific, stable. Maintenance adjudication only ever
|
|
3722
|
+
* compares facts about the SAME subject.
|
|
3695
3723
|
*/
|
|
3696
|
-
subject: z.string()
|
|
3724
|
+
subject: z.string(),
|
|
3725
|
+
/**
|
|
3726
|
+
* The lowercase singular ASPECT the fact addresses under its subject —
|
|
3727
|
+
* the chain's NODE tier (e.g. `base building` under `project zomboid`,
|
|
3728
|
+
* `ryzen 9950x3d` under `amd`). Names WHERE under the hub the fact is
|
|
3729
|
+
* filed; reuse the known vocabulary instead of minting near-variants.
|
|
3730
|
+
*/
|
|
3731
|
+
node: z.string(),
|
|
3697
3732
|
/**
|
|
3698
3733
|
* One broad lowercase PLURAL family label for THIS fact (e.g. `stocks`,
|
|
3699
|
-
* `pets`, `games`) — the
|
|
3700
|
-
* turn-side category when omitted. Never
|
|
3734
|
+
* `pets`, `games`) — the chain's CLUSTER tier. Never
|
|
3701
3735
|
* a specific entity, product, company, or game title. Persona/roleplay or
|
|
3702
3736
|
* fictional content classifies by its real-world medium (a TV persona's
|
|
3703
3737
|
* biography belongs under `shows`), never by in-universe domains (`family`,
|
|
3704
3738
|
* `education`, `business` describe reality, not an invented life).
|
|
3705
3739
|
*/
|
|
3706
|
-
category: z.string()
|
|
3740
|
+
category: z.string(),
|
|
3707
3741
|
/**
|
|
3708
3742
|
* One lowercase PLURAL sub-family label narrowing THIS fact's category
|
|
3709
3743
|
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3710
|
-
*
|
|
3711
|
-
*
|
|
3712
|
-
*
|
|
3713
|
-
* `breaking-bad` is a tag or hub, never a community.
|
|
3744
|
+
* chain's COMMUNITY tier, one level below the cluster. Never a specific
|
|
3745
|
+
* entity, product, or title — a show/work title like
|
|
3746
|
+
* `breaking-bad` is a hub or tag, never a community.
|
|
3714
3747
|
*/
|
|
3715
|
-
community: z.string()
|
|
3748
|
+
community: z.string(),
|
|
3716
3749
|
/** What kind of durable thing this is (see FACT_KINDS). */
|
|
3717
3750
|
kind: z.enum(FACT_KINDS),
|
|
3718
3751
|
/** Whether a newer statement is expected to replace this one (see FACT_STABILITIES). */
|
|
@@ -3750,20 +3783,29 @@ var ExtractionSchema = z.object({
|
|
|
3750
3783
|
* One lowercase PLURAL sub-family label narrowing the turn-side category
|
|
3751
3784
|
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3752
3785
|
* constellation's COMMUNITY tier: a genre, project family, or domain branch
|
|
3753
|
-
*
|
|
3754
|
-
*
|
|
3755
|
-
*
|
|
3756
|
-
*
|
|
3786
|
+
* One broad lowercase PLURAL sub-family label narrowing the turn-side
|
|
3787
|
+
* category (e.g. `survival-games` under `games`, `tv-shows` under
|
|
3788
|
+
* `shows`) — the COMMUNITY tier between the cluster and the hub.
|
|
3789
|
+
* Never a specific entity, product, or title — a show/work title like
|
|
3790
|
+
* `breaking-bad` is a hub or tag, never a community.
|
|
3757
3791
|
*/
|
|
3758
3792
|
community: z.string().optional()
|
|
3759
3793
|
});
|
|
3760
3794
|
|
|
3761
3795
|
// src/prompts/memory/vectorize-prompt.constant.ts
|
|
3762
|
-
|
|
3796
|
+
var USER_SOURCE_VOICE_RULES = `SOURCE VOICE: this extraction source is the USER's own message \u2014 statements in it are the user's voice and may be attributed to the user.`;
|
|
3797
|
+
var ASSISTANT_SOURCE_VOICE_RULES = `SOURCE VOICE (absolute): this extraction source is the ASSISTANT's own generated answer \u2014 a flattened digest of its titles, verdicts, and findings \u2014 NOT the user's words.
|
|
3798
|
+
- First-person statements, verdicts, scores, recommendations, and "my take" phrasing are the ASSISTANT's voice. NEVER attribute them to the user: no fact of the form "the user thinks / describes / wants / would / decided \u2026" may be drawn from this source.
|
|
3799
|
+
- The assistant's opinions, judgments, verdicts, and recommendations are NOT durable objective facts \u2014 never extract them. When the source only conveys the assistant's opinion, return an empty facts array (tags may still label the topic).
|
|
3800
|
+
- Extract only objective, checkable world facts the answer asserts, with the subject ENTITY as the hub \u2014 never "user" as the subject of assistant-voice content.
|
|
3801
|
+
- Statements about reception or coverage keep their true source ("available coverage of X notes \u2026"), never "the user";`;
|
|
3802
|
+
function buildExtractionPrompt(vocabulary = {}, role = "user") {
|
|
3803
|
+
const sourceVoiceRules = role === "assistant" ? ASSISTANT_SOURCE_VOICE_RULES : USER_SOURCE_VOICE_RULES;
|
|
3763
3804
|
return buildStructuredPrompt(ExtractionSchema, {
|
|
3764
3805
|
before: "OUTPUT FORMAT \u2014 output ONLY valid JSON matching this exact schema:",
|
|
3765
3806
|
after: `
|
|
3766
3807
|
YOUR TASK \u2014 decide what is worth remembering:
|
|
3808
|
+
${sourceVoiceRules}
|
|
3767
3809
|
- ROUTING BOUNDARY (absolute): this extraction feeds the memory partition \u2014 the OBJECTIVE fact store ONLY. Extract only objective, external-world facts and events: factual records, project details, decisions, states, possessions, contacts, relationships between people. You MUST NOT extract subjective user data \u2014 no preferences, likes/dislikes, interests, wants, behavioral traits, or internal states ("the user likes\u2026", "the user is interested in\u2026", "the user prefers\u2026"). All user profile and persona data is deferred to the cognition tier; when the turn reveals ONLY subjective user data, return an empty facts array.
|
|
3768
3810
|
- A fact is durable, objective information that remains useful in a later, unrelated conversation: decisions, contact details, project facts, technical constraints, events (e.g. "Sam's phone number is 555-1234", "The user is building a vector memory feature", "The payments service migrated to PostgreSQL in November").
|
|
3769
3811
|
- Be sensitive to the user's data: capture anything durable and objective the turn reveals \u2014 a decision, a constraint, a project detail, a person or subject they care about \u2014 even when it is phrased casually or buried in a longer message. Noticing and storing durable factual data is expected; do not wait for an explicit "remember".
|
|
@@ -3771,16 +3813,18 @@ YOUR TASK \u2014 decide what is worth remembering:
|
|
|
3771
3813
|
- Storage mechanics: each fact is embedded as a whole and matched sentence-by-sentence at recall time (multi-variant retrieval). One dense sentence is fine \u2014 put the subject up front ("The payments service runs PostgreSQL 16", not "It runs that version").
|
|
3772
3814
|
- Skip transient content: greetings, small talk, one-off instructions, filler \u2014 anything with no future recall value. When in doubt about whether a detail is durable, keep it: a durable detail is cheaper to store than to lose. When in doubt about whether a detail is SUBJECTIVE, drop it \u2014 the cognition tier captures preferences and profile data.
|
|
3773
3815
|
|
|
3774
|
-
FACT METADATA \u2014 every fact object carries the fields the maintenance passes (consolidate/reflect/conviction) interpret. Labels place the fact in the macro-taxonomy, top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE, where the
|
|
3816
|
+
FACT METADATA \u2014 every fact object carries the fields the maintenance passes (consolidate/reflect/conviction) interpret. Labels place the fact in the macro-taxonomy, top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE \u2192 LEAF, where the LEAF is the fact's text itself and every tier above it is a NAMED label that narrows where it is filed. The chain is strict: a fact is emitted with ALL FOUR labels or not at all.
|
|
3775
3817
|
- CLUSTER (category): a broad PLURAL family noun ("games", "stocks", "pets").
|
|
3776
3818
|
- COMMUNITY (community): a PLURAL sub-family under one cluster ("survival-games" under "games") \u2014 a genre or domain branch.
|
|
3777
3819
|
- HUB (subject): the SINGULAR main subject entity anchoring the fact ("project zomboid", "amd", "sam") \u2014 a specific name, never pluralized.
|
|
3820
|
+
- NODE (node): the SINGULAR aspect under the hub that the fact addresses ("base building" under "project zomboid", "ryzen 9950x3d" under "amd") \u2014 a specific sub-entity or topic branch, never pluralized, never a sentence.
|
|
3778
3821
|
PERSONA & FICTION CONTENT (absolute): facts about an adopted persona, a roleplay, or a fictional/entertainment work classify by the content's real-world MEDIUM, never by its in-universe domains. A TV persona's biography, family, career, or studies are NOT real-world walk-of-life categories \u2014 never "family", "education", "business", or "science" for invented content: the cluster is the medium family (e.g. "shows"), the community a true plural sub-family (e.g. "tv-shows"), and the show's title goes to the hub or the tags ("breaking bad"), never to the community.
|
|
3779
3822
|
Fields:
|
|
3780
3823
|
- text: the statement itself.
|
|
3781
|
-
- subject (
|
|
3782
|
-
-
|
|
3783
|
-
-
|
|
3824
|
+
- subject (required): the lowercase SINGULAR entity the fact is about \u2014 the HUB tier \u2014 a person, product, project, or the user's own name ("sam", "stellar blade", "payments service"). Maintenance only ever compares facts about the SAME subject, so name it whenever the fact is about a specific entity.
|
|
3825
|
+
- node (required): the lowercase SINGULAR aspect of the fact under its hub \u2014 the NODE tier \u2014 ("base building", "ryzen 9950x3d", "vocal range"). Reuse the known vocabulary rather than minting near-variants.
|
|
3826
|
+
- category (required): ONE broad lowercase PLURAL family label for this fact \u2014 the CLUSTER tier \u2014 reusing the known vocabulary.
|
|
3827
|
+
- community (required): ONE broad lowercase PLURAL sub-family narrowing the fact's category \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch \u2014 "survival-games" under "games").
|
|
3784
3828
|
- kind (required): what kind of durable thing it is:
|
|
3785
3829
|
- preference \u2014 RESERVED, never emit: likes, dislikes, wants, and interests are subjective user data owned by the cognition tier (see ROUTING BOUNDARY)
|
|
3786
3830
|
- decision \u2014 a choice that was made (adoptions, migrations, purchases committed to)
|
|
@@ -3793,7 +3837,7 @@ Fields:
|
|
|
3793
3837
|
- stability (required): "durable" \u2014 a long-term truth that should survive until contradicted (decisions, traits, history) \u2014 or "volatile" \u2014 a current state a newer statement is EXPECTED to replace (location, tooling, versions). When in doubt, choose durable.
|
|
3794
3838
|
- Tags: 2 to 6 stable, reusable, lowercase topic labels describing what the text is about (e.g. "work", "rust", "contacts", "amd", "stellar blade"). Tags are NARROW and specific \u2014 entity names, product names, game titles. They are the vocabulary for topic-filtered recall later.
|
|
3795
3839
|
- Category: ONE broad lowercase PLURAL family noun for the whole text (e.g. "stocks", "pets", "games", "health") \u2014 the CLUSTER tier \u2014 that groups the narrow tags into one topic family. A category is NEVER a specific entity, product, company, or game title: "amd" belongs under "stocks"; "stellar blade" and "stellar blade blood rain" belong under "games". Persona/fictional content follows the PERSONA & FICTION rule above (medium family, not in-universe domains). Always include it when facts are emitted; omit it when nothing durable is found.
|
|
3796
|
-
- Community: ONE broad lowercase PLURAL sub-family that narrows the category (e.g. "survival-games", "action-rpgs" under "games"; "tv-shows" under "shows") \u2014 the COMMUNITY tier between the cluster and the hub.
|
|
3840
|
+
- Community: ONE broad lowercase PLURAL sub-family that narrows the category (e.g. "survival-games", "action-rpgs" under "games"; "tv-shows" under "shows") \u2014 the COMMUNITY tier between the cluster and the hub. Always include it when facts are emitted; never a specific entity, product, or title \u2014 a show/work title like "breaking-bad" is a tag or hub, never a community.
|
|
3797
3841
|
- If nothing durable is found, return an empty facts array; tags may still label the topic when useful.
|
|
3798
3842
|
${buildVocabularySection(vocabulary)}
|
|
3799
3843
|
PRIOR MEMORY (when the user message ends with an "ALREADY STORED IN MEMORY" section):
|
|
@@ -3817,7 +3861,7 @@ Error: ${error}
|
|
|
3817
3861
|
|
|
3818
3862
|
Return ONLY a single valid JSON object matching the extraction schema exactly:
|
|
3819
3863
|
${formatZodShape(ExtractionSchema)}
|
|
3820
|
-
All object keys must be quoted with double quotes. "subject"
|
|
3864
|
+
All object keys must be quoted with double quotes. Per fact, "subject", "node", "category", and "community" are required alongside "kind" and "stability".
|
|
3821
3865
|
Do not add markdown code fences, explanations, placeholders, or extra text.
|
|
3822
3866
|
|
|
3823
3867
|
FINAL REMINDER:
|
|
@@ -3851,4 +3895,4 @@ Compose the response from the snippets below. Include every snippet you can subs
|
|
|
3851
3895
|
${parts.join("\n\n")}`;
|
|
3852
3896
|
}
|
|
3853
3897
|
|
|
3854
|
-
export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, DEFAULT_VARIANT_ID, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, ENCYCLOPEDIA_INGEST_TRIAGE_INSTRUCTIONS, FINAL_REMINDER, FRICTION_INSTRUCTIONS, 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, RESEARCH_FRICTION_QUERY_INSTRUCTIONS, RESEARCH_TRIAGE_INSTRUCTIONS, RESPONSE_LAYOUTS, SECURITY_RULES, SHOPLIST_INSTRUCTIONS, SNIPPET_TEMPLATE_PRESETS, SOURCE_TRUTH_RULES, SOURCE_VOICE_RULES, STOCKMARKET_ITEM_INSTRUCTIONS, STOCKMARKET_LIST_INSTRUCTIONS, SUMMARY_INSTRUCTIONS, TAXONOMY_RECONCILE_INSTRUCTIONS, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TOOL_RESULTS_RULES, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildCognitionProfileSection, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildConvictionSynthesisPrompt, buildCorrectionPrompt, buildDescribePdfPagePrompt, buildEncyclopediaClassifyPrompt, buildEncyclopediaIngestTriagePrompt, buildEnrichPrompt, buildExecuteLanguageInstruction, buildExtractionCorrectionPrompt, buildExtractionPrompt, buildFrictionPrompt, buildImageExecutePrompt, buildIntentCorrectionPrompt, buildIntentSelectionPrompt, buildLanguageRule, buildLayoutInstruction, buildLocalizationRule, buildMemoryProbeSection, buildMemoryProfilePrompt, buildMemoryWritePrompt, buildMergeDirective, buildMissingToolsPrompt, buildOutputContract, buildResearchFrictionQueryPrompt, buildResearchTriagePrompt, buildSnippetInstruction, buildSourcePolicyPrompt, buildStockmarketNote, buildStructuredJsonPrompt, buildStructuredPrompt, buildSynopsisProbeSection, buildTaxonomyPairPrompt, buildTaxonomyReconcileSystemPrompt, 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 };
|
|
3898
|
+
export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, DEFAULT_VARIANT_ID, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, ENCYCLOPEDIA_INGEST_TRIAGE_INSTRUCTIONS, FINAL_REMINDER, FRICTION_INSTRUCTIONS, 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, RESEARCH_FRICTION_QUERY_INSTRUCTIONS, RESEARCH_TRIAGE_INSTRUCTIONS, RESPONSE_LAYOUTS, SECURITY_RULES, SHOPLIST_INSTRUCTIONS, SNIPPET_TEMPLATE_PRESETS, SOURCE_TRUTH_RULES, SOURCE_VOICE_RULES, STOCKMARKET_ITEM_INSTRUCTIONS, STOCKMARKET_LIST_INSTRUCTIONS, SUMMARY_INSTRUCTIONS, TAXONOMY_RECONCILE_INSTRUCTIONS, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TEXT_OPINION_INSTRUCTIONS, TOOL_RESULTS_RULES, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildCognitionProfileSection, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildConvictionSynthesisPrompt, buildCorrectionPrompt, buildDescribePdfPagePrompt, buildEncyclopediaClassifyPrompt, buildEncyclopediaIngestTriagePrompt, buildEnrichPrompt, buildExecuteLanguageInstruction, buildExtractionCorrectionPrompt, buildExtractionPrompt, buildFrictionPrompt, buildImageExecutePrompt, buildIntentCorrectionPrompt, buildIntentSelectionPrompt, buildLanguageRule, buildLayoutInstruction, buildLocalizationRule, buildMemoryProbeSection, buildMemoryProfilePrompt, buildMemoryWritePrompt, buildMergeDirective, buildMissingToolsPrompt, buildOutputContract, buildResearchFrictionQueryPrompt, buildResearchTriagePrompt, buildSnippetInstruction, buildSourcePolicyPrompt, buildStockmarketNote, buildStructuredJsonPrompt, buildStructuredPrompt, buildSynopsisProbeSection, buildTaxonomyPairPrompt, buildTaxonomyReconcileSystemPrompt, 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 };
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -16,8 +16,9 @@ declare const NON_PAGE_EXTENSIONS: RegExp;
|
|
|
16
16
|
|
|
17
17
|
declare const EncyclopediaClassifySchema: z.ZodObject<{
|
|
18
18
|
category: z.ZodString;
|
|
19
|
-
community: z.
|
|
19
|
+
community: z.ZodString;
|
|
20
20
|
topic: z.ZodString;
|
|
21
|
+
node: z.ZodString;
|
|
21
22
|
icon: z.ZodOptional<z.ZodString>;
|
|
22
23
|
}, z.core.$strip>;
|
|
23
24
|
type EncyclopediaClassification = z.infer<typeof EncyclopediaClassifySchema>;
|
|
@@ -247,9 +248,10 @@ declare const FACT_KINDS: readonly ["preference", "decision", "state", "contact"
|
|
|
247
248
|
declare const FACT_STABILITIES: readonly ["durable", "volatile"];
|
|
248
249
|
declare const ExtractedFactSchema: z.ZodObject<{
|
|
249
250
|
text: z.ZodString;
|
|
250
|
-
subject: z.
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
subject: z.ZodString;
|
|
252
|
+
node: z.ZodString;
|
|
253
|
+
category: z.ZodString;
|
|
254
|
+
community: z.ZodString;
|
|
253
255
|
kind: z.ZodEnum<{
|
|
254
256
|
preference: "preference";
|
|
255
257
|
decision: "decision";
|
|
@@ -269,9 +271,10 @@ type ExtractedFact = z.infer<typeof ExtractedFactSchema>;
|
|
|
269
271
|
declare const ExtractionSchema: z.ZodObject<{
|
|
270
272
|
facts: z.ZodArray<z.ZodObject<{
|
|
271
273
|
text: z.ZodString;
|
|
272
|
-
subject: z.
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
subject: z.ZodString;
|
|
275
|
+
node: z.ZodString;
|
|
276
|
+
category: z.ZodString;
|
|
277
|
+
community: z.ZodString;
|
|
275
278
|
kind: z.ZodEnum<{
|
|
276
279
|
preference: "preference";
|
|
277
280
|
decision: "decision";
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -78,14 +78,14 @@ var EncyclopediaClassifySchema = z.object({
|
|
|
78
78
|
*/
|
|
79
79
|
category: z.string(),
|
|
80
80
|
/**
|
|
81
|
-
* One lowercase PLURAL sub-family
|
|
81
|
+
* One lowercase PLURAL sub-family narrowing the category (e.g.
|
|
82
82
|
* `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
83
|
-
* constellation's COMMUNITY tier, one level below the cluster.
|
|
84
|
-
*
|
|
85
|
-
* company, or title — a show/work title like `breaking-bad` is a
|
|
86
|
-
*
|
|
83
|
+
* constellation's COMMUNITY tier, one level below the cluster. The chain
|
|
84
|
+
* is strict, so community is always present. Never a specific entity,
|
|
85
|
+
* product, company, or title — a show/work title like `breaking-bad` is a
|
|
86
|
+
* hub, never a community.
|
|
87
87
|
*/
|
|
88
|
-
community: z.string()
|
|
88
|
+
community: z.string(),
|
|
89
89
|
/**
|
|
90
90
|
* The narrow SINGULAR subject entity the document is about (e.g.
|
|
91
91
|
* `wuthering waves`, `q3 budget`) — the constellation's HUB tier. A short,
|
|
@@ -93,11 +93,13 @@ var EncyclopediaClassifySchema = z.object({
|
|
|
93
93
|
*/
|
|
94
94
|
topic: z.string(),
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
96
|
+
* The SINGULAR aspect of the document under its hub (e.g. `base building`
|
|
97
|
+
* under `project zomboid`, `department spend` under `q3 budget`) — the
|
|
98
|
+
* constellation's NODE tier, one level below the hub: a named sub-entity
|
|
99
|
+
* or topic branch the chunks file under. Reuse the known vocabulary
|
|
100
|
+
* instead of minting near-variants.
|
|
100
101
|
*/
|
|
102
|
+
node: z.string(),
|
|
101
103
|
icon: z.string().optional()
|
|
102
104
|
});
|
|
103
105
|
|
|
@@ -628,31 +630,35 @@ var ExtractedFactSchema = z.object({
|
|
|
628
630
|
*/
|
|
629
631
|
text: z.string(),
|
|
630
632
|
/**
|
|
631
|
-
* The lowercase entity the fact is about
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
* facts about the SAME subject.
|
|
633
|
+
* The lowercase entity the fact is about — the chain's HUB tier:
|
|
634
|
+
* singular, specific, stable. Maintenance adjudication only ever
|
|
635
|
+
* compares facts about the SAME subject.
|
|
635
636
|
*/
|
|
636
|
-
subject: z.string()
|
|
637
|
+
subject: z.string(),
|
|
638
|
+
/**
|
|
639
|
+
* The lowercase singular ASPECT the fact addresses under its subject —
|
|
640
|
+
* the chain's NODE tier (e.g. `base building` under `project zomboid`,
|
|
641
|
+
* `ryzen 9950x3d` under `amd`). Names WHERE under the hub the fact is
|
|
642
|
+
* filed; reuse the known vocabulary instead of minting near-variants.
|
|
643
|
+
*/
|
|
644
|
+
node: z.string(),
|
|
637
645
|
/**
|
|
638
646
|
* One broad lowercase PLURAL family label for THIS fact (e.g. `stocks`,
|
|
639
|
-
* `pets`, `games`) — the
|
|
640
|
-
* turn-side category when omitted. Never
|
|
647
|
+
* `pets`, `games`) — the chain's CLUSTER tier. Never
|
|
641
648
|
* a specific entity, product, company, or game title. Persona/roleplay or
|
|
642
649
|
* fictional content classifies by its real-world medium (a TV persona's
|
|
643
650
|
* biography belongs under `shows`), never by in-universe domains (`family`,
|
|
644
651
|
* `education`, `business` describe reality, not an invented life).
|
|
645
652
|
*/
|
|
646
|
-
category: z.string()
|
|
653
|
+
category: z.string(),
|
|
647
654
|
/**
|
|
648
655
|
* One lowercase PLURAL sub-family label narrowing THIS fact's category
|
|
649
656
|
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
650
|
-
*
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
* `breaking-bad` is a tag or hub, never a community.
|
|
657
|
+
* chain's COMMUNITY tier, one level below the cluster. Never a specific
|
|
658
|
+
* entity, product, or title — a show/work title like
|
|
659
|
+
* `breaking-bad` is a hub or tag, never a community.
|
|
654
660
|
*/
|
|
655
|
-
community: z.string()
|
|
661
|
+
community: z.string(),
|
|
656
662
|
/** What kind of durable thing this is (see FACT_KINDS). */
|
|
657
663
|
kind: z.enum(FACT_KINDS),
|
|
658
664
|
/** Whether a newer statement is expected to replace this one (see FACT_STABILITIES). */
|
|
@@ -690,10 +696,11 @@ var ExtractionSchema = z.object({
|
|
|
690
696
|
* One lowercase PLURAL sub-family label narrowing the turn-side category
|
|
691
697
|
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
692
698
|
* constellation's COMMUNITY tier: a genre, project family, or domain branch
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
*
|
|
699
|
+
* One broad lowercase PLURAL sub-family label narrowing the turn-side
|
|
700
|
+
* category (e.g. `survival-games` under `games`, `tv-shows` under
|
|
701
|
+
* `shows`) — the COMMUNITY tier between the cluster and the hub.
|
|
702
|
+
* Never a specific entity, product, or title — a show/work title like
|
|
703
|
+
* `breaking-bad` is a hub or tag, never a community.
|
|
697
704
|
*/
|
|
698
705
|
community: z.string().optional()
|
|
699
706
|
});
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -475,9 +475,10 @@ declare function createMemoryPartitionRecallTool(deps: MemoryPartitionRecallDeps
|
|
|
475
475
|
|
|
476
476
|
declare const memoryPartitionRememberSchema: z.ZodObject<{
|
|
477
477
|
text: z.ZodString;
|
|
478
|
-
category: z.
|
|
479
|
-
community: z.
|
|
480
|
-
subject: z.
|
|
478
|
+
category: z.ZodString;
|
|
479
|
+
community: z.ZodString;
|
|
480
|
+
subject: z.ZodString;
|
|
481
|
+
node: z.ZodString;
|
|
481
482
|
icon: z.ZodOptional<z.ZodString>;
|
|
482
483
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
483
484
|
}, z.core.$strip>;
|
|
@@ -492,9 +493,10 @@ interface MemoryPartitionRememberDeps {
|
|
|
492
493
|
requestId?: string;
|
|
493
494
|
text: string;
|
|
494
495
|
tags?: string[];
|
|
495
|
-
category
|
|
496
|
-
community
|
|
497
|
-
subject
|
|
496
|
+
category: string;
|
|
497
|
+
community: string;
|
|
498
|
+
subject: string;
|
|
499
|
+
node: string;
|
|
498
500
|
icon?: string;
|
|
499
501
|
}) => Promise<string>;
|
|
500
502
|
}
|
|
@@ -503,6 +505,7 @@ declare function createMemoryPartitionRememberTool(deps: MemoryPartitionRemember
|
|
|
503
505
|
declare const memoryTaxonomyProbeSchema: z.ZodObject<{
|
|
504
506
|
kind: z.ZodEnum<{
|
|
505
507
|
community: "community";
|
|
508
|
+
node: "node";
|
|
506
509
|
cluster: "cluster";
|
|
507
510
|
hub: "hub";
|
|
508
511
|
}>;
|
package/dist/tools/index.mjs
CHANGED
|
@@ -1154,15 +1154,18 @@ ${lines.join("\n")}`;
|
|
|
1154
1154
|
}
|
|
1155
1155
|
var memoryPartitionRememberSchema = z.object({
|
|
1156
1156
|
text: z.string().min(1).max(2e3).describe('The fact to remember, as a self-contained statement, e.g. "Sams phone number is 555-1234".'),
|
|
1157
|
-
category: z.string().min(1).max(40).
|
|
1157
|
+
category: z.string().min(1).max(40).describe(
|
|
1158
1158
|
'One broad lowercase PLURAL category the fact belongs to, e.g. "stocks", "games", "pets", "work" \u2014 the CLUSTER tier: a family noun, never a specific entity/product/company/game name ("amd" \u2192 "stocks"; "stellar blade" \u2192 "games"). Persona/roleplay or fictional content classifies by its real-world medium (a TV persona\u2019s biography \u2192 "shows"), never by in-universe domains ("family", "education", "business" describe reality, not an invented life). Always include it.'
|
|
1159
1159
|
),
|
|
1160
|
-
community: z.string().min(1).max(60).
|
|
1161
|
-
'One lowercase PLURAL sub-family narrowing the category, e.g. "survival games" under "games", "tv shows" under "shows" \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch).
|
|
1160
|
+
community: z.string().min(1).max(60).describe(
|
|
1161
|
+
'One lowercase PLURAL sub-family narrowing the category, e.g. "survival games" under "games", "tv shows" under "shows" \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch). Always present; never a specific entity, product, or title \u2014 a show/work title like "breaking-bad" is a hub, never a community.'
|
|
1162
1162
|
),
|
|
1163
|
-
subject: z.string().min(1).max(40).
|
|
1163
|
+
subject: z.string().min(1).max(40).describe(
|
|
1164
1164
|
'The lowercase SINGULAR entity the fact is about \u2014 the HUB tier, e.g. "project zomboid", "amd", "sam". Name it whenever the fact is about a specific entity; never a plural family label.'
|
|
1165
1165
|
),
|
|
1166
|
+
node: z.string().min(1).max(120).describe(
|
|
1167
|
+
'The lowercase SINGULAR aspect the fact addresses under its hub \u2014 the NODE tier, e.g. "base building" under "project zomboid", "ryzen 9950x3d" under "amd". Reuse existing labels whenever they fit; never pluralized, never a sentence.'
|
|
1168
|
+
),
|
|
1166
1169
|
icon: z.string().min(1).max(64).optional().describe(
|
|
1167
1170
|
'Lucide icon name for a label you are CREATING in this call (attached to the deepest NEW label: subject first, then community, then category). Only from the curated taxonomy icon set (e.g. "gamepad-2", "book-open", "paw-print"); omit entirely when you adopt existing labels or no icon fits.'
|
|
1168
1171
|
),
|
|
@@ -1172,9 +1175,9 @@ var memoryPartitionRememberSchema = z.object({
|
|
|
1172
1175
|
});
|
|
1173
1176
|
function createMemoryPartitionRememberTool(deps) {
|
|
1174
1177
|
return tool({
|
|
1175
|
-
description: 'Store into the user\'s fact partition (memory-partition) \u2014 OBJECTIVE facts only: notable external-world facts about subjects they care about (projects, followed stocks, games, people, past topics), objective details they state as fact (contact info, decisions, constraints, their setup), and objective facts they explicitly ask you to remember. You MUST NOT store subjective user data here \u2014 preferences, interests, likes/dislikes, behavioral traits, or internal states ("the user likes\u2026") belong to the cognition tier (memory-cognition-remember). Storing gathered knowledge is expected \u2014 do not wait for an explicit "remember" instruction. This memory outlives the conversation and is recalled later with memory-partition-recall. STORAGE MECHANICS: each record is embedded as a whole and matched sentence-by-sentence at recall time \u2014 write ONE self-contained statement per call (a single dense sentence is fine, subject up front), restating a record verbatim updates it in place, tags are the recall filter vocabulary (lowercase, reusable), and the macro-taxonomy routes each record
|
|
1178
|
+
description: 'Store into the user\'s fact partition (memory-partition) \u2014 OBJECTIVE facts only: notable external-world facts about subjects they care about (projects, followed stocks, games, people, past topics), objective details they state as fact (contact info, decisions, constraints, their setup), and objective facts they explicitly ask you to remember. You MUST NOT store subjective user data here \u2014 preferences, interests, likes/dislikes, behavioral traits, or internal states ("the user likes\u2026") belong to the cognition tier (memory-cognition-remember). Storing gathered knowledge is expected \u2014 do not wait for an explicit "remember" instruction. This memory outlives the conversation and is recalled later with memory-partition-recall. STORAGE MECHANICS: each record is embedded as a whole and matched sentence-by-sentence at recall time \u2014 write ONE self-contained statement per call (a single dense sentence is fine, subject up front), restating a record verbatim updates it in place, tags are the recall filter vocabulary (lowercase, reusable), and the macro-taxonomy routes each record down its strict chain: `category` one broad PLURAL family label (games, pets, work, health \u2026 \u2014 the cluster tier), `community` one PLURAL sub-family under it (survival games, action rpgs \u2026), `subject` the SINGULAR entity the fact is about (project zomboid, amd, sam \u2026 \u2014 the hub tier), `node` the SINGULAR aspect under the hub (base building, ryzen 9950x3d \u2026 \u2014 the node tier). ALL FOUR labels are always required; reuse existing labels whenever they fit.',
|
|
1176
1179
|
inputSchema: memoryPartitionRememberSchema,
|
|
1177
|
-
execute: async ({ text, tags, category, community, subject, icon }) => {
|
|
1180
|
+
execute: async ({ text, tags, category, community, subject, node, icon }) => {
|
|
1178
1181
|
try {
|
|
1179
1182
|
const id = await deps.storeRecord({
|
|
1180
1183
|
memoryPartition: deps.scope.memoryPartition,
|
|
@@ -1186,6 +1189,7 @@ function createMemoryPartitionRememberTool(deps) {
|
|
|
1186
1189
|
category,
|
|
1187
1190
|
community,
|
|
1188
1191
|
subject,
|
|
1192
|
+
node,
|
|
1189
1193
|
icon
|
|
1190
1194
|
});
|
|
1191
1195
|
return { stored: true, id };
|
|
@@ -1199,14 +1203,14 @@ function createMemoryPartitionRememberTool(deps) {
|
|
|
1199
1203
|
});
|
|
1200
1204
|
}
|
|
1201
1205
|
var memoryTaxonomyProbeSchema = z.object({
|
|
1202
|
-
kind: z.enum(["cluster", "community", "hub"]).describe(
|
|
1203
|
-
"Which tier to probe. Top-down order: cluster (PLURAL family noun) \u2192 community (PLURAL sub-family under one cluster) \u2192 hub (SINGULAR main subject entity)."
|
|
1206
|
+
kind: z.enum(["cluster", "community", "hub", "node"]).describe(
|
|
1207
|
+
"Which tier to probe. Top-down order: cluster (PLURAL family noun) \u2192 community (PLURAL sub-family under one cluster) \u2192 hub (SINGULAR main subject entity) \u2192 node (SINGULAR aspect under the hub)."
|
|
1204
1208
|
),
|
|
1205
1209
|
query: z.string().min(1).max(120).describe(
|
|
1206
1210
|
'The label you are considering (e.g. "games", "survival games", "project zomboid") \u2014 scored against the existing taxonomy by name similarity and meaning.'
|
|
1207
1211
|
),
|
|
1208
1212
|
parentId: z.string().optional().describe(
|
|
1209
|
-
"The adopted
|
|
1213
|
+
"The adopted label id from the tier ABOVE (community probes pass the adopted cluster id; hub probes the adopted community id; node probes the adopted hub id). Narrows the candidacy to that parent; omit only when you are about to CREATE the parent."
|
|
1210
1214
|
)
|
|
1211
1215
|
});
|
|
1212
1216
|
function createMemoryTaxonomyProbeTool(deps) {
|
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.
|
|
5
|
-
"packageManager": "pnpm@12.
|
|
4
|
+
"version": "1.0.4",
|
|
5
|
+
"packageManager": "pnpm@12.14.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@mozilla/readability": "^0.6.0",
|
|
58
|
-
"@triplef/helpers": "^1.
|
|
59
|
-
"linkedom": "^0.18.
|
|
58
|
+
"@triplef/helpers": "^1.6.1",
|
|
59
|
+
"linkedom": "^0.18.14",
|
|
60
60
|
"turndown": "^7.2.4"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"ai": "^7.0.
|
|
64
|
-
"zod": "^4.6.
|
|
63
|
+
"ai": "^7.0.148",
|
|
64
|
+
"zod": "^4.6.7"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"ai": {
|
|
@@ -72,27 +72,27 @@
|
|
|
72
72
|
"@changesets/cli": "^3.0.3",
|
|
73
73
|
"@eslint/js": "^10.0.1",
|
|
74
74
|
"@types/eslint": "^9.6.1",
|
|
75
|
-
"@types/node": "^26.6.
|
|
75
|
+
"@types/node": "^26.6.5",
|
|
76
76
|
"@types/turndown": "^5.0.6",
|
|
77
|
-
"@vitest/coverage-v8": "5.0.
|
|
77
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
78
78
|
"depcheck": "^1.4.7",
|
|
79
|
-
"dependency-cruiser": "^18.
|
|
80
|
-
"eslint": "^10.
|
|
79
|
+
"dependency-cruiser": "^18.7.0",
|
|
80
|
+
"eslint": "^10.13.0",
|
|
81
81
|
"eslint-config-prettier": "^10.1.8",
|
|
82
|
-
"eslint-plugin-prettier": "^5.5.
|
|
82
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
83
83
|
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
84
84
|
"eslint-plugin-sonarjs": "^4.2.2",
|
|
85
85
|
"globals": "^17.13.0",
|
|
86
86
|
"husky": "^9.1.7",
|
|
87
87
|
"jiti": "^2.7.0",
|
|
88
88
|
"lint-staged": "^17.6.0",
|
|
89
|
-
"npm-check-updates": "^23.1.
|
|
90
|
-
"prettier": "^3.9.
|
|
89
|
+
"npm-check-updates": "^23.1.1",
|
|
90
|
+
"prettier": "^3.9.10",
|
|
91
91
|
"rimraf": "^6.1.3",
|
|
92
92
|
"ts-unused-exports": "^11.0.1",
|
|
93
93
|
"tsup": "^8.5.1",
|
|
94
94
|
"typescript": "^5.9.3",
|
|
95
|
-
"typescript-eslint": "^8.
|
|
96
|
-
"vitest": "^5.0.
|
|
95
|
+
"typescript-eslint": "^8.72.0",
|
|
96
|
+
"vitest": "^5.0.5"
|
|
97
97
|
}
|
|
98
98
|
}
|