@triplef/agent 0.1.25 → 0.1.26

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.
@@ -131,7 +131,15 @@ interface ConvictionEvidenceItem {
131
131
  }
132
132
  declare function buildConvictionSynthesisPrompt(evidence: readonly ConvictionEvidenceItem[]): string;
133
133
 
134
- declare function buildEncyclopediaClassifyPrompt(knownCategories?: readonly string[], knownTopics?: readonly string[]): string;
134
+ interface TaxonomyVocabulary {
135
+ categories?: readonly string[];
136
+ communities?: readonly string[];
137
+ hubs?: readonly string[];
138
+ tags?: readonly string[];
139
+ }
140
+ declare function buildVocabularySection(vocab?: TaxonomyVocabulary): string;
141
+
142
+ declare function buildEncyclopediaClassifyPrompt(vocabulary?: TaxonomyVocabulary): string;
135
143
 
136
144
  declare function formatProvenanceLine(line: {
137
145
  text: string;
@@ -199,14 +207,13 @@ declare function buildMemoryProfilePrompt(params: {
199
207
  maxPayloadChars?: number;
200
208
  }): string;
201
209
 
202
- 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- category is the broad family the fact belongs to (partition lane only): ONE lowercase PLURAL family noun per remember call \u2014 stocks, games, pets, work, health, finance, contacts \u2026 \u2014 chosen so narrow topics group into families. A category is NEVER a specific entity, product, company, or game title: \"amd\" is a tag under the category \"stocks\"; \"stellar blade\" and \"stellar blade blood rain\" are tags under the category \"games\". Always include it; tags stay narrow, category stays broad and plural.\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.";
210
+ 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\"); 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\". Always include category; reuse the existing labels whenever they fit.\n\nTAXONOMY PROBING (pick first, create if necessary): before naming a community or hub you are not certain exists, call memory-taxonomy-probe top-down \u2014 cluster \u2192 community \u2192 hub \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) 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.";
203
211
  declare function buildMemoryWritePrompt(params: {
204
212
  userRequest: string;
205
213
  priorMemory?: string;
206
214
  probedMemory?: string;
207
215
  gathered?: string;
208
- knownCategories?: string[];
209
- knownTags?: string[];
216
+ vocabulary?: TaxonomyVocabulary;
210
217
  }): string;
211
218
 
212
219
  declare const RESEARCH_FRICTION_QUERY_INSTRUCTIONS: string;
@@ -224,10 +231,18 @@ declare function buildResearchTriagePrompt(gaps: Array<{
224
231
  snippet: string;
225
232
  }>, maxPayloadChars?: number): string;
226
233
 
227
- declare function buildExtractionPrompt(knownCategories?: readonly string[], knownTags?: readonly string[]): string;
228
- declare function buildExtractionCorrectionPrompt(error: string): string;
234
+ 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.";
235
+ declare function buildTaxonomyPairPrompt(params: {
236
+ kind: 'cluster' | 'community' | 'hub' | 'tag';
237
+ labelA: string;
238
+ labelB: string;
239
+ countA: number;
240
+ countB: number;
241
+ }): string;
242
+ declare function buildTaxonomyReconcileSystemPrompt(): string;
229
243
 
230
- declare function buildVocabularySection(knownCategories?: readonly string[], knownTags?: readonly string[]): string;
244
+ declare function buildExtractionPrompt(vocabulary?: TaxonomyVocabulary): string;
245
+ declare function buildExtractionCorrectionPrompt(error: string): string;
231
246
 
232
247
  declare const COMMONMARK_FORMAT = "MARKDOWN FORMAT (strict CommonMark):\n- Use ASCII asterisks only: *italic* and **bold**.\n- Never put spaces inside the markers: write **bold**, never ** bold **.\n- Never use fullwidth or unicode asterisk characters (\uFF0A or \u2217).\n- Separate paragraphs with a blank line; keep paragraphs short.\n- Use Markdown links for URLs: [label](https://...). Never paste bare URLs.\n- Use emphasis sparingly. Bold only the single most important term in a paragraph \u2014 never a whole sentence or a lead-in clause.\n- Prefer ## or ### headings to introduce sections instead of bolding the lead-in.\n- Use - bullets for parallel items and 1. numbers for ordered steps.";
233
248
 
@@ -393,4 +408,4 @@ declare const verdictSpineSnippet: TemplateSnippet;
393
408
 
394
409
  declare const videoGallerySnippet: TemplateSnippet;
395
410
 
396
- export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, type ContentSystemPromptParams, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, FINAL_REMINDER, FRICTION_INSTRUCTIONS, type FrictionFact, HISTORY_URLS_RULES, IMAGELIST_INSTRUCTIONS, IMAGE_TASK_RULE, INTERNATIONAL_COVERAGE_INSTRUCTIONS, ITEM_SHAPES, JSON_RULES, MEDIA_COUNTS, MEDIA_RULES, MEMORY_CLUSTER_INSTRUCTIONS, MEMORY_CONSOLIDATE_INSTRUCTIONS, MEMORY_PROFILE_INSTRUCTIONS, MEMORY_WRITE_INSTRUCTIONS, MERGE_MEDIA_RULES, MERGE_TOPIC_RULE, MULTIMODAL_POLICY, NOISE_RULES, OCR_INSTRUCTIONS, OCR_VERBATIM_INSTRUCTIONS, PRECEDENCE_RULES, PRODUCT_INSTRUCTIONS, 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, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TOOL_RESULTS_RULES, type TemplateSnippet, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildCognitionProfileSection, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildConvictionSynthesisPrompt, buildCorrectionPrompt, buildDescribePdfPagePrompt, buildEncyclopediaClassifyPrompt, 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, 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 };
411
+ export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, type ContentSystemPromptParams, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, FINAL_REMINDER, FRICTION_INSTRUCTIONS, type FrictionFact, HISTORY_URLS_RULES, IMAGELIST_INSTRUCTIONS, IMAGE_TASK_RULE, INTERNATIONAL_COVERAGE_INSTRUCTIONS, ITEM_SHAPES, JSON_RULES, MEDIA_COUNTS, MEDIA_RULES, MEMORY_CLUSTER_INSTRUCTIONS, MEMORY_CONSOLIDATE_INSTRUCTIONS, MEMORY_PROFILE_INSTRUCTIONS, MEMORY_WRITE_INSTRUCTIONS, MERGE_MEDIA_RULES, MERGE_TOPIC_RULE, MULTIMODAL_POLICY, NOISE_RULES, OCR_INSTRUCTIONS, OCR_VERBATIM_INSTRUCTIONS, PRECEDENCE_RULES, PRODUCT_INSTRUCTIONS, 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, 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 };
@@ -3018,48 +3018,84 @@ function buildConvictionSynthesisPrompt(evidence) {
3018
3018
  var EncyclopediaClassifySchema = z.object({
3019
3019
  /**
3020
3020
  * One broad lowercase PLURAL family label for the document (e.g. `games`,
3021
- * `work`, `health`) — the constellation's cluster tier. Never a specific
3021
+ * `work`, `health`) — the constellation's CLUSTER tier. Never a specific
3022
3022
  * entity, product, company, or title.
3023
3023
  */
3024
3024
  category: z.string(),
3025
3025
  /**
3026
- * The narrow topic the document is about (e.g. `wuthering waves`,
3027
- * `q3 budget`) — the constellation's cluster tier. A short, specific,
3028
- * reusable label, not a sentence and not a URL.
3026
+ * One lowercase PLURAL sub-family label narrowing the category (e.g.
3027
+ * `survival-games` under `games`) — the constellation's COMMUNITY tier, one
3028
+ * level below the cluster. Optional: omit when no sub-family applies. Never
3029
+ * a specific entity, product, company, or title.
3029
3030
  */
3030
- topic: z.string()
3031
+ community: z.string().optional(),
3032
+ /**
3033
+ * The narrow SINGULAR subject entity the document is about (e.g.
3034
+ * `wuthering waves`, `q3 budget`) — the constellation's HUB tier. A short,
3035
+ * specific, reusable label, not a sentence and not a URL.
3036
+ */
3037
+ topic: z.string(),
3038
+ /**
3039
+ * Lucide icon name for a label this classification CREATES (attached to
3040
+ * the deepest NEW label: topic first, then community, then category).
3041
+ * Only from the curated taxonomy icon set; omit when adopting existing
3042
+ * labels or no icon fits.
3043
+ */
3044
+ icon: z.string().optional()
3031
3045
  });
3032
3046
 
3033
3047
  // src/prompts/memory/vocabulary-section.helper.ts
3034
- function buildVocabularySection(knownCategories = [], knownTags = []) {
3035
- if (knownCategories.length === 0 && knownTags.length === 0) return "";
3048
+ function buildVocabularySection(vocab = {}) {
3049
+ const { categories = [], communities = [], hubs = [], tags = [] } = vocab;
3050
+ if (categories.length === 0 && communities.length === 0 && hubs.length === 0 && tags.length === 0) {
3051
+ return "";
3052
+ }
3036
3053
  const lines = [];
3037
- if (knownCategories.length > 0) {
3054
+ if (categories.length > 0) {
3038
3055
  lines.push(
3039
- `KNOWN CATEGORIES (reuse one when it fits; only mint a new plural family noun when none applies): ${knownCategories.join(", ")}`
3056
+ `KNOWN CATEGORIES (cluster tier \u2014 reuse one when it fits; only mint a new plural family noun when none applies): ${categories.join(", ")}`
3040
3057
  );
3041
3058
  }
3042
- if (knownTags.length > 0) {
3043
- lines.push(`KNOWN TOPICS (reuse these tag labels when they fit): ${knownTags.join(", ")}`);
3059
+ if (communities.length > 0) {
3060
+ lines.push(
3061
+ `KNOWN COMMUNITIES (community tier \u2014 plural sub-families under a category; reuse when they fit): ${communities.join(", ")}`
3062
+ );
3063
+ }
3064
+ if (hubs.length > 0) {
3065
+ lines.push(
3066
+ `KNOWN HUBS (hub tier \u2014 singular subject entities; name them verbatim when the text is about one): ${hubs.join(", ")}`
3067
+ );
3068
+ }
3069
+ if (tags.length > 0) {
3070
+ lines.push(`KNOWN TOPICS (reuse these tag labels when they fit): ${tags.join(", ")}`);
3044
3071
  }
3045
3072
  return lines.join("\n");
3046
3073
  }
3047
3074
 
3048
3075
  // src/prompts/memory/encyclopedia-classify-prompt.constant.ts
3049
- function buildEncyclopediaClassifyPrompt(knownCategories = [], knownTopics = []) {
3076
+ function buildEncyclopediaClassifyPrompt(vocabulary = {}) {
3050
3077
  return buildStructuredPrompt(EncyclopediaClassifySchema, {
3051
3078
  before: "OUTPUT FORMAT \u2014 output ONLY valid JSON matching this exact schema:",
3052
3079
  after: `
3053
- YOUR TASK \u2014 label one stored source document with its broad category and the topic it is about:
3080
+ YOUR TASK \u2014 label one stored source document with its place in the macro-taxonomy:
3081
+
3082
+ TAXONOMY HIERARCHY (top-down): CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE
3083
+ - CLUSTER = a broad PLURAL family noun ("games", "work", "health") \u2014 the highest logical bucket.
3084
+ - COMMUNITY = a PLURAL sub-family under one cluster ("survival-games" under "games") \u2014 a genre or domain branch.
3085
+ - HUB = the SINGULAR main subject entity anchoring the document ("project zomboid", "wuthering waves") \u2014 a specific name, never pluralized.
3086
+ - NODE = the individual chunks of the document itself \u2014 the leaves attached to the hub (you never name these).
3087
+
3054
3088
  - 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.
3055
- - category: 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.
3056
- - topic: the document's MAIN subject entity \u2014 what the whole source is about (e.g. "wuthering waves", "q3 budget", "rust borrow checker"). A short, specific, 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.
3089
+ - 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.
3090
+ - community (COMMUNITY, optional): ONE lowercase PLURAL sub-family narrowing the category (e.g. "survival-games" under "games"). Omit it when no sub-family applies; never a specific entity, product, company, or title.
3091
+ - 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.
3057
3092
  - When the document is about a KNOWN TOPIC, output that label VERBATIM \u2014 prefer "neverness to everness" over minting a variant like "nte".
3058
- ${buildVocabularySection(knownCategories, knownTopics)}
3093
+ - 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.
3094
+ ${buildVocabularySection(vocabulary)}
3059
3095
  RULES:
3060
3096
  - Return ONLY a single valid JSON object matching the exact schema above.
3061
3097
  - No markdown code fences, no explanations, preamble, or postscript.
3062
- - Never output undefined or null. Both keys are always present.
3098
+ - Never output undefined or null. "category" and "topic" are always present; "community" and "icon" are omitted when they don't apply.
3063
3099
 
3064
3100
  FINAL REMINDER:
3065
3101
  - Output ONLY valid JSON matching the exact schema above. No markdown code fences, no explanations, preamble, or postscript.`
@@ -3406,7 +3442,13 @@ STORAGE MECHANICS \u2014 how your memory works (write for the retriever):
3406
3442
  - 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").
3407
3443
  - Restating a record verbatim OVERWRITES it in place \u2014 updates are restatements of the full corrected statement, not diffs.
3408
3444
  - 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").
3409
- - category is the broad family the fact belongs to (partition lane only): ONE lowercase PLURAL family noun per remember call \u2014 stocks, games, pets, work, health, finance, contacts \u2026 \u2014 chosen so narrow topics group into families. A category is NEVER a specific entity, product, company, or game title: "amd" is a tag under the category "stocks"; "stellar blade" and "stellar blade blood rain" are tags under the category "games". Always include it; tags stay narrow, category stays broad and plural.
3445
+ - 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):
3446
+ - category (CLUSTER): ONE lowercase PLURAL family noun \u2014 stocks, games, pets, work, health, finance, contacts \u2026
3447
+ - community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category ("survival games" under "games"); omit when no sub-family applies.
3448
+ - 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.
3449
+ 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". Always include category; reuse the existing labels whenever they fit.
3450
+
3451
+ TAXONOMY PROBING (pick first, create if necessary): before naming a community or hub you are not certain exists, call memory-taxonomy-probe top-down \u2014 cluster \u2192 community \u2192 hub \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) 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.
3410
3452
 
3411
3453
  Do NOT store:
3412
3454
  - Public facts merely fetched this turn that do not relate to the user (e.g. generic web results).
@@ -3419,7 +3461,7 @@ Rules:
3419
3461
  - Call each remember tool once per distinct durable item \u2014 no more.
3420
3462
  - 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.`;
3421
3463
  function buildMemoryWritePrompt(params) {
3422
- const vocabulary = buildVocabularySection(params.knownCategories, params.knownTags);
3464
+ const vocabulary = buildVocabularySection(params.vocabulary);
3423
3465
  return [
3424
3466
  `USER REQUEST: ${params.userRequest}`,
3425
3467
  `PRIOR MEMORY: ${params.priorMemory?.trim() || "(none stored yet)"}`,
@@ -3525,6 +3567,42 @@ function buildResearchTriagePrompt(gaps, maxPayloadChars) {
3525
3567
  return [`GAPS:
3526
3568
  ${limitText(body, maxPayloadChars)}`, "Write the decisions JSON object now."].join("\n\n");
3527
3569
  }
3570
+ var TaxonomyPairVerdictSchema = z.object({
3571
+ /**
3572
+ * `same` — the two labels name the same concept (a wording/casing/plural
3573
+ * variant) and merge. `distinct` — genuinely different concepts that only
3574
+ * look alike; keep both. When in doubt: DISTINCT.
3575
+ */
3576
+ verdict: z.enum(["same", "distinct"]),
3577
+ /** One short sentence justifying the verdict (audit trail). */
3578
+ reason: z.string().optional()
3579
+ });
3580
+
3581
+ // src/prompts/memory/taxonomy-reconcile-prompt.constant.ts
3582
+ 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.
3583
+
3584
+ 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).
3585
+
3586
+ 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").
3587
+ 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.`;
3588
+ function buildTaxonomyPairPrompt(params) {
3589
+ return `TIER: ${params.kind}
3590
+ LABEL A: "${params.labelA}" (used by ${params.countA} records)
3591
+ LABEL B: "${params.labelB}" (used by ${params.countB} records)
3592
+
3593
+ Decide: do these two labels name the SAME concept (merge) or are they DISTINCT (keep both)?`;
3594
+ }
3595
+ function buildTaxonomyReconcileSystemPrompt() {
3596
+ return buildStructuredPrompt(TaxonomyPairVerdictSchema, {
3597
+ before: `${TAXONOMY_RECONCILE_INSTRUCTIONS}
3598
+
3599
+ OUTPUT FORMAT \u2014 output ONLY valid JSON matching this exact schema:`,
3600
+ after: `
3601
+ RULES:
3602
+ - Return ONLY a single valid JSON object matching the exact schema above.
3603
+ - No markdown code fences, no explanations, preamble, or postscript.`
3604
+ });
3605
+ }
3528
3606
  var FACT_KINDS = [
3529
3607
  "preference",
3530
3608
  "decision",
@@ -3544,16 +3622,26 @@ var ExtractedFactSchema = z.object({
3544
3622
  text: z.string(),
3545
3623
  /**
3546
3624
  * The lowercase entity the fact is about (default `user`; a person,
3547
- * product, or project name). Maintenance adjudication only ever compares
3625
+ * product, or project name) — the constellation's HUB tier: singular,
3626
+ * specific, stable. Maintenance adjudication only ever compares
3548
3627
  * facts about the SAME subject.
3549
3628
  */
3550
3629
  subject: z.string().optional(),
3551
3630
  /**
3552
3631
  * One broad lowercase PLURAL family label for THIS fact (e.g. `stocks`,
3553
- * `pets`, `games`) — inherits the turn-side category when omitted. Never
3632
+ * `pets`, `games`) — the constellation's CLUSTER tier. Inherits the
3633
+ * turn-side category when omitted. Never
3554
3634
  * a specific entity, product, company, or game title.
3555
3635
  */
3556
3636
  category: z.string().optional(),
3637
+ /**
3638
+ * One lowercase PLURAL sub-family label narrowing THIS fact's category
3639
+ * (e.g. `survival-games` under `games`) — the constellation's COMMUNITY
3640
+ * tier, one level below the cluster. Inherits the turn-side community when
3641
+ * omitted; omit when no sub-family applies. Never a specific entity,
3642
+ * product, or title.
3643
+ */
3644
+ community: z.string().optional(),
3557
3645
  /** What kind of durable thing this is (see FACT_KINDS). */
3558
3646
  kind: z.enum(FACT_KINDS),
3559
3647
  /** Whether a newer statement is expected to replace this one (see FACT_STABILITIES). */
@@ -3576,18 +3664,27 @@ var ExtractionSchema = z.object({
3576
3664
  tags: z.array(z.string()),
3577
3665
  /**
3578
3666
  * One broad lowercase PLURAL family label for the whole turn-side (e.g.
3579
- * `stocks`, `pets`, `games`) — groups the narrow tags into one topic family
3580
- * for the constellation's community tier and the relink job's per-category
3581
- * passes, and backstops facts that omit their own `category`. Never a
3667
+ * `stocks`, `pets`, `games`) — the constellation's CLUSTER tier. Groups
3668
+ * the narrow tags into one topic family, powers the relink job's
3669
+ * per-category passes, and backstops facts that omit their own `category`. Never a
3582
3670
  * specific entity, product, company, or game title: `amd` belongs under
3583
3671
  * `stocks`; `stellar blade` belongs under `games`. Optional: a turn with
3584
3672
  * nothing durable may omit it.
3585
3673
  */
3586
- category: z.string().optional()
3674
+ category: z.string().optional(),
3675
+ /**
3676
+ * One lowercase PLURAL sub-family label narrowing the turn-side category
3677
+ * (e.g. `survival-games` under `games`) — the constellation's COMMUNITY
3678
+ * tier: a genre, project family, or domain branch one level below the
3679
+ * cluster. Backstops facts that omit their own `community`. Optional:
3680
+ * omit it when no sub-family applies. Never a specific entity, product,
3681
+ * or title.
3682
+ */
3683
+ community: z.string().optional()
3587
3684
  });
3588
3685
 
3589
3686
  // src/prompts/memory/vectorize-prompt.constant.ts
3590
- function buildExtractionPrompt(knownCategories = [], knownTags = []) {
3687
+ function buildExtractionPrompt(vocabulary = {}) {
3591
3688
  return buildStructuredPrompt(ExtractionSchema, {
3592
3689
  before: "OUTPUT FORMAT \u2014 output ONLY valid JSON matching this exact schema:",
3593
3690
  after: `
@@ -3599,10 +3696,15 @@ YOUR TASK \u2014 decide what is worth remembering:
3599
3696
  - 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").
3600
3697
  - 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.
3601
3698
 
3602
- FACT METADATA \u2014 every fact object carries the fields the maintenance passes (consolidate/reflect/conviction) interpret:
3699
+ 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 NODE is the fact itself (never named) and each tier above it narrows where it is filed:
3700
+ - CLUSTER (category): a broad PLURAL family noun ("games", "stocks", "pets").
3701
+ - COMMUNITY (community): a PLURAL sub-family under one cluster ("survival-games" under "games") \u2014 a genre or domain branch.
3702
+ - HUB (subject): the SINGULAR main subject entity anchoring the fact ("project zomboid", "amd", "sam") \u2014 a specific name, never pluralized.
3703
+ Fields:
3603
3704
  - text: the statement itself.
3604
- - subject (optional): the lowercase entity the fact is about \u2014 "user" by default, or a person, product, or project 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.
3605
- - category (optional): ONE broad lowercase PLURAL family label for this fact, reusing the known vocabulary \u2014 inherits the turn-side category when omitted.
3705
+ - subject (optional): the lowercase SINGULAR entity the fact is about \u2014 the HUB tier \u2014 "user" by default, or a person, product, or project 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.
3706
+ - category (optional): ONE broad lowercase PLURAL family label for this fact \u2014 the CLUSTER tier \u2014 reusing the known vocabulary. Inherits the turn-side category when omitted.
3707
+ - community (optional): ONE 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"). Inherits the turn-side community when omitted; omit when no sub-family applies.
3606
3708
  - kind (required): what kind of durable thing it is:
3607
3709
  - preference \u2014 RESERVED, never emit: likes, dislikes, wants, and interests are subjective user data owned by the cognition tier (see ROUTING BOUNDARY)
3608
3710
  - decision \u2014 a choice that was made (adoptions, migrations, purchases committed to)
@@ -3614,9 +3716,10 @@ FACT METADATA \u2014 every fact object carries the fields the maintenance passes
3614
3716
  - fact \u2014 any other durable fact
3615
3717
  - 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.
3616
3718
  - 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.
3617
- - Category: ONE broad lowercase PLURAL family noun for the whole text (e.g. "stocks", "pets", "games", "health") 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". Always include it when facts are emitted; omit it when nothing durable is found.
3719
+ - 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". Always include it when facts are emitted; omit it when nothing durable is found.
3720
+ - Community: ONE broad lowercase PLURAL sub-family that narrows the category (e.g. "survival-games", "action-rpgs" under "games") \u2014 the COMMUNITY tier between the cluster and the hub. Omit it when no sub-family applies; never a specific entity, product, or title.
3618
3721
  - If nothing durable is found, return an empty facts array; tags may still label the topic when useful.
3619
- ${buildVocabularySection(knownCategories, knownTags)}
3722
+ ${buildVocabularySection(vocabulary)}
3620
3723
  PRIOR MEMORY (when the user message ends with an "ALREADY STORED IN MEMORY" section):
3621
3724
  - That section lists facts already stored in YOUR long-term memory from prior turns. NEVER emit a fact already covered there.
3622
3725
  - If this turn refines, corrects, or completes a stored fact, DO emit it \u2014 as one fuller, self-contained restatement (a full restatement of the corrected claim overwrites the old record in place; it is never a diff).
@@ -3672,4 +3775,4 @@ Compose the response from the snippets below. Include every snippet you can subs
3672
3775
  ${parts.join("\n\n")}`;
3673
3776
  }
3674
3777
 
3675
- export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, DEFAULT_VARIANT_ID, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_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, 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, 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, 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 };
3778
+ export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, DEFAULT_VARIANT_ID, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_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, 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 };
@@ -15,7 +15,9 @@ declare const NON_PAGE_EXTENSIONS: RegExp;
15
15
 
16
16
  declare const EncyclopediaClassifySchema: z.ZodObject<{
17
17
  category: z.ZodString;
18
+ community: z.ZodOptional<z.ZodString>;
18
19
  topic: z.ZodString;
20
+ icon: z.ZodOptional<z.ZodString>;
19
21
  }, z.core.$strip>;
20
22
  type EncyclopediaClassification = z.infer<typeof EncyclopediaClassifySchema>;
21
23
 
@@ -120,6 +122,7 @@ declare const ExtractedFactSchema: z.ZodObject<{
120
122
  text: z.ZodString;
121
123
  subject: z.ZodOptional<z.ZodString>;
122
124
  category: z.ZodOptional<z.ZodString>;
125
+ community: z.ZodOptional<z.ZodString>;
123
126
  kind: z.ZodEnum<{
124
127
  preference: "preference";
125
128
  decision: "decision";
@@ -141,6 +144,7 @@ declare const ExtractionSchema: z.ZodObject<{
141
144
  text: z.ZodString;
142
145
  subject: z.ZodOptional<z.ZodString>;
143
146
  category: z.ZodOptional<z.ZodString>;
147
+ community: z.ZodOptional<z.ZodString>;
144
148
  kind: z.ZodEnum<{
145
149
  preference: "preference";
146
150
  decision: "decision";
@@ -158,6 +162,7 @@ declare const ExtractionSchema: z.ZodObject<{
158
162
  }, z.core.$strip>>;
159
163
  tags: z.ZodArray<z.ZodString>;
160
164
  category: z.ZodOptional<z.ZodString>;
165
+ community: z.ZodOptional<z.ZodString>;
161
166
  }, z.core.$strip>;
162
167
  type MemoryExtraction = z.infer<typeof ExtractionSchema>;
163
168
 
@@ -310,6 +315,18 @@ declare const ResearchTriageSchema: z.ZodObject<{
310
315
  type ResearchTriageDecision = z.infer<typeof ResearchTriageDecisionSchema>;
311
316
  type ResearchTriage = z.infer<typeof ResearchTriageSchema>;
312
317
 
318
+ declare const TAXONOMY_ICON_ALLOWLIST: readonly ["activity", "plane", "anchor", "apple", "archive", "atom", "banknote", "bike", "bird", "bitcoin", "book", "book-open", "bot", "brain", "briefcase", "brush", "bug", "building", "cake", "calculator", "calendar", "camera", "car", "cat", "chart-line", "chef-hat", "clapperboard", "cloud", "code", "coffee", "cog", "coins", "compass", "contact", "cpu", "credit-card", "dumbbell", "factory", "file-text", "film", "fish", "flag", "flask-conical", "flower-2", "volleyball", "gamepad-2", "gem", "gift", "globe", "graduation-cap", "guitar", "hammer", "handshake", "headphones", "heart-pulse", "house", "hospital", "key", "landmark", "laptop", "leaf", "lightbulb", "map-pin", "medal", "mic", "microscope", "mountain", "music", "newspaper", "package", "palette", "paw-print", "phone", "piggy-bank", "rocket", "scale", "server", "shield", "ship", "shirt", "shopping-bag", "sprout", "star", "stethoscope", "sun", "trophy", "truck", "tv", "umbrella", "utensils", "wallet", "wifi", "wrench", "zap"];
319
+ type TaxonomyIconName = (typeof TAXONOMY_ICON_ALLOWLIST)[number];
320
+
321
+ declare const TaxonomyPairVerdictSchema: z.ZodObject<{
322
+ verdict: z.ZodEnum<{
323
+ same: "same";
324
+ distinct: "distinct";
325
+ }>;
326
+ reason: z.ZodOptional<z.ZodString>;
327
+ }, z.core.$strip>;
328
+ type TaxonomyPairVerdict = z.infer<typeof TaxonomyPairVerdictSchema>;
329
+
313
330
  declare const cardSchema: z.ZodObject<{
314
331
  url: z.ZodString;
315
332
  title: z.ZodOptional<z.ZodString>;
@@ -916,4 +933,4 @@ declare const videolistSchema: z.ZodObject<{
916
933
  }, z.core.$strip>>>;
917
934
  }, z.core.$strip>;
918
935
 
919
- export { BLOCKED_IMAGE_HOSTS, BLOCKED_URL_HOSTS, COGNITION_LIMIT_DEFAULT, COGNITION_LIMIT_MAX, COGNITION_LIMIT_MIN, COGNITION_PURGE_BATCH, CONVICTION_TAGS, CONVICTION_TEXT_LIMIT, type ConsolidationVerdict, ConsolidationVerdictSchema, DEFAULT_MEDIA_COUNT, EMBEDDABLE_VIDEO_PROVIDER_CLAUSE, EMBEDDABLE_VIDEO_PROVIDER_LABELS, EPISODE_PROBE_LIMIT_DEFAULT, EPISODE_PROBE_LIMIT_MIN, EPISODE_RECENCY_MIDPOINT_DEFAULT, EPISODE_RECENCY_MIDPOINT_MAX, EPISODE_RECENCY_MIDPOINT_MIN, EPISODE_RECENCY_SCALE_SECONDS_DEFAULT, EPISODE_RECENCY_SCALE_SECONDS_MAX, EPISODE_RECENCY_SCALE_SECONDS_MIN, EPISODE_RECENCY_WEIGHT_DEFAULT, EPISODE_RECENCY_WEIGHT_MAX, EPISODE_RECENCY_WEIGHT_MIN, EPISODE_SCORE_THRESHOLD_DEFAULT, EPISODE_SCORE_THRESHOLD_MAX, EPISODE_SCORE_THRESHOLD_MIN, EPISODE_TAGS, EPISODE_TEXT_LIMIT, type EncyclopediaClassification, EncyclopediaClassifySchema, type EncyclopediaSearchResult, type EncyclopediaSelectInput, type EncyclopediaSelectResult, type EncyclopediaSelectedChunk, type EncyclopediaSourceDocument, type ExtractedFact, ExtractedFactSchema, ExtractionSchema, FACT_KINDS, FACT_STABILITIES, HERO_VIDEO_TITLE_ISSUE, INSIGHTS_MAX_PER_TURN, INSIGHT_TAGS, INSIGHT_TEXT_LIMIT, MORE_MEDIA_COUNT, type MemoryClusterSummary, MemoryClusterSummarySchema, type MemoryCognitionProfile, type MemoryEnrichment, MemoryEnrichmentSchema, type MemoryExtraction, type MemoryProfileInsight, type MemoryProfileResponse, type MergedCognitionProfile, NON_PAGE_EXTENSIONS, type PruneProfileTopicOutcome, type ResearchFrictionQuery, type ResearchFrictionQueryDecision, ResearchFrictionQueryDecisionSchema, ResearchFrictionQuerySchema, type ResearchTriage, type ResearchTriageDecision, ResearchTriageDecisionSchema, ResearchTriageSchema, cardSchema, categorizeTools, clampCognitionLimit, clampEpisodeProbeLimit, clampEpisodeRecencyMidpoint, clampEpisodeRecencyScaleSeconds, clampEpisodeRecencyWeight, clampEpisodeScoreThreshold, compareSchema, createTextItemSchema, deriveSchemaKeys, describeSchema, discardedReferenceSchema, formatZodIssues, galleryItemSchema, hasBlockedImageHost, heroVideoHasTitle, imagelistSchema, internationalCoverageSchema, isAllFieldsNullWipe, isPrivateOrLocalhost, isTrustedImageUrl, isTrustedUrl, markerSchema, memoryProfileResponseSchema, mergeCognitionProfiles, normalizeInsightPath, ocrSchema, parseStoredProfile, productSchema, pruneProfileTopic, referenceGalleryItemSchema, referenceLineSchema, relatedStorySchema, safeMediaUrl, safeMediaUrlOrEmpty, safeUrl, safeVideoUrl, safeVideoUrlOrEmpty, shoplistSchema, sourceSchema, stockmarketItemSchema, stockmarketListSchema, summarySchema, videoGalleryItemSchema, videolistSchema };
936
+ export { BLOCKED_IMAGE_HOSTS, BLOCKED_URL_HOSTS, COGNITION_LIMIT_DEFAULT, COGNITION_LIMIT_MAX, COGNITION_LIMIT_MIN, COGNITION_PURGE_BATCH, CONVICTION_TAGS, CONVICTION_TEXT_LIMIT, type ConsolidationVerdict, ConsolidationVerdictSchema, DEFAULT_MEDIA_COUNT, EMBEDDABLE_VIDEO_PROVIDER_CLAUSE, EMBEDDABLE_VIDEO_PROVIDER_LABELS, EPISODE_PROBE_LIMIT_DEFAULT, EPISODE_PROBE_LIMIT_MIN, EPISODE_RECENCY_MIDPOINT_DEFAULT, EPISODE_RECENCY_MIDPOINT_MAX, EPISODE_RECENCY_MIDPOINT_MIN, EPISODE_RECENCY_SCALE_SECONDS_DEFAULT, EPISODE_RECENCY_SCALE_SECONDS_MAX, EPISODE_RECENCY_SCALE_SECONDS_MIN, EPISODE_RECENCY_WEIGHT_DEFAULT, EPISODE_RECENCY_WEIGHT_MAX, EPISODE_RECENCY_WEIGHT_MIN, EPISODE_SCORE_THRESHOLD_DEFAULT, EPISODE_SCORE_THRESHOLD_MAX, EPISODE_SCORE_THRESHOLD_MIN, EPISODE_TAGS, EPISODE_TEXT_LIMIT, type EncyclopediaClassification, EncyclopediaClassifySchema, type EncyclopediaSearchResult, type EncyclopediaSelectInput, type EncyclopediaSelectResult, type EncyclopediaSelectedChunk, type EncyclopediaSourceDocument, type ExtractedFact, ExtractedFactSchema, ExtractionSchema, FACT_KINDS, FACT_STABILITIES, HERO_VIDEO_TITLE_ISSUE, INSIGHTS_MAX_PER_TURN, INSIGHT_TAGS, INSIGHT_TEXT_LIMIT, MORE_MEDIA_COUNT, type MemoryClusterSummary, MemoryClusterSummarySchema, type MemoryCognitionProfile, type MemoryEnrichment, MemoryEnrichmentSchema, type MemoryExtraction, type MemoryProfileInsight, type MemoryProfileResponse, type MergedCognitionProfile, NON_PAGE_EXTENSIONS, type PruneProfileTopicOutcome, type ResearchFrictionQuery, type ResearchFrictionQueryDecision, ResearchFrictionQueryDecisionSchema, ResearchFrictionQuerySchema, type ResearchTriage, type ResearchTriageDecision, ResearchTriageDecisionSchema, ResearchTriageSchema, TAXONOMY_ICON_ALLOWLIST, type TaxonomyIconName, type TaxonomyPairVerdict, TaxonomyPairVerdictSchema, cardSchema, categorizeTools, clampCognitionLimit, clampEpisodeProbeLimit, clampEpisodeRecencyMidpoint, clampEpisodeRecencyScaleSeconds, clampEpisodeRecencyWeight, clampEpisodeScoreThreshold, compareSchema, createTextItemSchema, deriveSchemaKeys, describeSchema, discardedReferenceSchema, formatZodIssues, galleryItemSchema, hasBlockedImageHost, heroVideoHasTitle, imagelistSchema, internationalCoverageSchema, isAllFieldsNullWipe, isPrivateOrLocalhost, isTrustedImageUrl, isTrustedUrl, markerSchema, memoryProfileResponseSchema, mergeCognitionProfiles, normalizeInsightPath, ocrSchema, parseStoredProfile, productSchema, pruneProfileTopic, referenceGalleryItemSchema, referenceLineSchema, relatedStorySchema, safeMediaUrl, safeMediaUrlOrEmpty, safeUrl, safeVideoUrl, safeVideoUrlOrEmpty, shoplistSchema, sourceSchema, stockmarketItemSchema, stockmarketListSchema, summarySchema, videoGalleryItemSchema, videolistSchema };
@@ -71,16 +71,30 @@ var NON_PAGE_EXTENSIONS = /\.(js|css|json|xml|svg|png|jpg|jpeg|gif|webp|ico|mp4|
71
71
  var EncyclopediaClassifySchema = z.object({
72
72
  /**
73
73
  * One broad lowercase PLURAL family label for the document (e.g. `games`,
74
- * `work`, `health`) — the constellation's cluster tier. Never a specific
74
+ * `work`, `health`) — the constellation's CLUSTER tier. Never a specific
75
75
  * entity, product, company, or title.
76
76
  */
77
77
  category: z.string(),
78
78
  /**
79
- * The narrow topic the document is about (e.g. `wuthering waves`,
80
- * `q3 budget`) — the constellation's cluster tier. A short, specific,
81
- * reusable label, not a sentence and not a URL.
79
+ * One lowercase PLURAL sub-family label narrowing the category (e.g.
80
+ * `survival-games` under `games`) — the constellation's COMMUNITY tier, one
81
+ * level below the cluster. Optional: omit when no sub-family applies. Never
82
+ * a specific entity, product, company, or title.
82
83
  */
83
- topic: z.string()
84
+ community: z.string().optional(),
85
+ /**
86
+ * The narrow SINGULAR subject entity the document is about (e.g.
87
+ * `wuthering waves`, `q3 budget`) — the constellation's HUB tier. A short,
88
+ * specific, reusable label, not a sentence and not a URL.
89
+ */
90
+ topic: z.string(),
91
+ /**
92
+ * Lucide icon name for a label this classification CREATES (attached to
93
+ * the deepest NEW label: topic first, then community, then category).
94
+ * Only from the curated taxonomy icon set; omit when adopting existing
95
+ * labels or no icon fits.
96
+ */
97
+ icon: z.string().optional()
84
98
  });
85
99
 
86
100
  // src/schemas/helpers/tools/categorize-tools.helper.ts
@@ -535,16 +549,26 @@ var ExtractedFactSchema = z.object({
535
549
  text: z.string(),
536
550
  /**
537
551
  * The lowercase entity the fact is about (default `user`; a person,
538
- * product, or project name). Maintenance adjudication only ever compares
552
+ * product, or project name) — the constellation's HUB tier: singular,
553
+ * specific, stable. Maintenance adjudication only ever compares
539
554
  * facts about the SAME subject.
540
555
  */
541
556
  subject: z.string().optional(),
542
557
  /**
543
558
  * One broad lowercase PLURAL family label for THIS fact (e.g. `stocks`,
544
- * `pets`, `games`) — inherits the turn-side category when omitted. Never
559
+ * `pets`, `games`) — the constellation's CLUSTER tier. Inherits the
560
+ * turn-side category when omitted. Never
545
561
  * a specific entity, product, company, or game title.
546
562
  */
547
563
  category: z.string().optional(),
564
+ /**
565
+ * One lowercase PLURAL sub-family label narrowing THIS fact's category
566
+ * (e.g. `survival-games` under `games`) — the constellation's COMMUNITY
567
+ * tier, one level below the cluster. Inherits the turn-side community when
568
+ * omitted; omit when no sub-family applies. Never a specific entity,
569
+ * product, or title.
570
+ */
571
+ community: z.string().optional(),
548
572
  /** What kind of durable thing this is (see FACT_KINDS). */
549
573
  kind: z.enum(FACT_KINDS),
550
574
  /** Whether a newer statement is expected to replace this one (see FACT_STABILITIES). */
@@ -567,14 +591,23 @@ var ExtractionSchema = z.object({
567
591
  tags: z.array(z.string()),
568
592
  /**
569
593
  * One broad lowercase PLURAL family label for the whole turn-side (e.g.
570
- * `stocks`, `pets`, `games`) — groups the narrow tags into one topic family
571
- * for the constellation's community tier and the relink job's per-category
572
- * passes, and backstops facts that omit their own `category`. Never a
594
+ * `stocks`, `pets`, `games`) — the constellation's CLUSTER tier. Groups
595
+ * the narrow tags into one topic family, powers the relink job's
596
+ * per-category passes, and backstops facts that omit their own `category`. Never a
573
597
  * specific entity, product, company, or game title: `amd` belongs under
574
598
  * `stocks`; `stellar blade` belongs under `games`. Optional: a turn with
575
599
  * nothing durable may omit it.
576
600
  */
577
- category: z.string().optional()
601
+ category: z.string().optional(),
602
+ /**
603
+ * One lowercase PLURAL sub-family label narrowing the turn-side category
604
+ * (e.g. `survival-games` under `games`) — the constellation's COMMUNITY
605
+ * tier: a genre, project family, or domain branch one level below the
606
+ * cluster. Backstops facts that omit their own `community`. Optional:
607
+ * omit it when no sub-family applies. Never a specific entity, product,
608
+ * or title.
609
+ */
610
+ community: z.string().optional()
578
611
  });
579
612
  var nullishText = z.string().nullish();
580
613
  var nullishTopics = z.array(z.string()).nullish();
@@ -849,6 +882,114 @@ var ResearchTriageDecisionSchema = z.object({
849
882
  var ResearchTriageSchema = z.object({
850
883
  decisions: z.array(ResearchTriageDecisionSchema).max(50)
851
884
  });
885
+
886
+ // src/schemas/memory/taxonomy-icons.constant.ts
887
+ var TAXONOMY_ICON_ALLOWLIST = [
888
+ "activity",
889
+ "plane",
890
+ "anchor",
891
+ "apple",
892
+ "archive",
893
+ "atom",
894
+ "banknote",
895
+ "bike",
896
+ "bird",
897
+ "bitcoin",
898
+ "book",
899
+ "book-open",
900
+ "bot",
901
+ "brain",
902
+ "briefcase",
903
+ "brush",
904
+ "bug",
905
+ "building",
906
+ "cake",
907
+ "calculator",
908
+ "calendar",
909
+ "camera",
910
+ "car",
911
+ "cat",
912
+ "chart-line",
913
+ "chef-hat",
914
+ "clapperboard",
915
+ "cloud",
916
+ "code",
917
+ "coffee",
918
+ "cog",
919
+ "coins",
920
+ "compass",
921
+ "contact",
922
+ "cpu",
923
+ "credit-card",
924
+ "dumbbell",
925
+ "factory",
926
+ "file-text",
927
+ "film",
928
+ "fish",
929
+ "flag",
930
+ "flask-conical",
931
+ "flower-2",
932
+ "volleyball",
933
+ "gamepad-2",
934
+ "gem",
935
+ "gift",
936
+ "globe",
937
+ "graduation-cap",
938
+ "guitar",
939
+ "hammer",
940
+ "handshake",
941
+ "headphones",
942
+ "heart-pulse",
943
+ "house",
944
+ "hospital",
945
+ "key",
946
+ "landmark",
947
+ "laptop",
948
+ "leaf",
949
+ "lightbulb",
950
+ "map-pin",
951
+ "medal",
952
+ "mic",
953
+ "microscope",
954
+ "mountain",
955
+ "music",
956
+ "newspaper",
957
+ "package",
958
+ "palette",
959
+ "paw-print",
960
+ "phone",
961
+ "piggy-bank",
962
+ "rocket",
963
+ "scale",
964
+ "server",
965
+ "shield",
966
+ "ship",
967
+ "shirt",
968
+ "shopping-bag",
969
+ "sprout",
970
+ "star",
971
+ "stethoscope",
972
+ "sun",
973
+ "trophy",
974
+ "truck",
975
+ "tv",
976
+ "umbrella",
977
+ "utensils",
978
+ "wallet",
979
+ "wifi",
980
+ "wrench",
981
+ "zap"
982
+ ];
983
+ var TaxonomyPairVerdictSchema = z.object({
984
+ /**
985
+ * `same` — the two labels name the same concept (a wording/casing/plural
986
+ * variant) and merge. `distinct` — genuinely different concepts that only
987
+ * look alike; keep both. When in doubt: DISTINCT.
988
+ */
989
+ verdict: z.enum(["same", "distinct"]),
990
+ /** One short sentence justifying the verdict (audit trail). */
991
+ reason: z.string().optional()
992
+ });
852
993
  var cardSchema = z.object(
853
994
  {
854
995
  url: safeUrl({ message: "cards entries must have a valid url" }),
@@ -1229,4 +1370,4 @@ var videolistSchema = z.object({
1229
1370
  internationalCoverage: internationalCoverageSchema.optional()
1230
1371
  });
1231
1372
 
1232
- export { BLOCKED_IMAGE_HOSTS, BLOCKED_URL_HOSTS, BROWSER_TOOL_NAMES, COGNITION_LIMIT_DEFAULT, COGNITION_LIMIT_MAX, COGNITION_LIMIT_MIN, COGNITION_PURGE_BATCH, CONVICTION_TAGS, CONVICTION_TEXT_LIMIT, ConsolidationVerdictSchema, DEFAULT_MEDIA_COUNT, DEFAULT_VARIANT_ID, EMBEDDABLE_VIDEO_PROVIDER_CLAUSE, EMBEDDABLE_VIDEO_PROVIDER_LABELS, ENCYCLOPEDIA_TOOL_NAMES, EPISODE_PROBE_LIMIT_DEFAULT, EPISODE_PROBE_LIMIT_MIN, EPISODE_RECENCY_MIDPOINT_DEFAULT, EPISODE_RECENCY_MIDPOINT_MAX, EPISODE_RECENCY_MIDPOINT_MIN, EPISODE_RECENCY_SCALE_SECONDS_DEFAULT, EPISODE_RECENCY_SCALE_SECONDS_MAX, EPISODE_RECENCY_SCALE_SECONDS_MIN, EPISODE_RECENCY_WEIGHT_DEFAULT, EPISODE_RECENCY_WEIGHT_MAX, EPISODE_RECENCY_WEIGHT_MIN, EPISODE_SCORE_THRESHOLD_DEFAULT, EPISODE_SCORE_THRESHOLD_MAX, EPISODE_SCORE_THRESHOLD_MIN, EPISODE_TAGS, EPISODE_TEXT_LIMIT, EncyclopediaClassifySchema, ExtractedFactSchema, ExtractionSchema, FACT_KINDS, FACT_STABILITIES, HERO_VIDEO_TITLE_ISSUE, IMAGE_TASK_TEMPLATES, INSIGHTS_MAX_PER_TURN, INSIGHT_TAGS, INSIGHT_TEXT_LIMIT, IntentSchema, MEMORY_TOOL_NAMES, MORE_MEDIA_COUNT, MemoryClusterSummarySchema, MemoryEnrichmentSchema, NON_PAGE_EXTENSIONS, ResearchFrictionQueryDecisionSchema, ResearchFrictionQuerySchema, ResearchTriageDecisionSchema, ResearchTriageSchema, TOOL_DESCRIPTIONS, TOOL_NAMES, VARIANT_NAMES, cardSchema, categorizeTools, clampCognitionLimit, clampEpisodeProbeLimit, clampEpisodeRecencyMidpoint, clampEpisodeRecencyScaleSeconds, clampEpisodeRecencyWeight, clampEpisodeScoreThreshold, compareSchema, createTextItemSchema, deriveSchemaKeys, describeSchema, discardedReferenceSchema, formatZodIssues, formatZodShape, galleryItemSchema, hasBlockedImageHost, heroVideoHasTitle, imagelistSchema, internationalCoverageSchema, isAllFieldsNullWipe, isImageTaskTemplate, isPrivateOrLocalhost, isTrustedImageUrl, isTrustedUrl, markerSchema, memoryProfileResponseSchema, mergeCognitionProfiles, normalizeInsightPath, ocrSchema, parseStoredProfile, productSchema, pruneProfileTopic, referenceGalleryItemSchema, referenceLineSchema, relatedStorySchema, safeMediaUrl, safeMediaUrlOrEmpty, safeUrl, safeVideoUrl, safeVideoUrlOrEmpty, shoplistSchema, sourceSchema, stockmarketItemSchema, stockmarketListSchema, summarySchema, videoGalleryItemSchema, videolistSchema };
1373
+ export { BLOCKED_IMAGE_HOSTS, BLOCKED_URL_HOSTS, BROWSER_TOOL_NAMES, COGNITION_LIMIT_DEFAULT, COGNITION_LIMIT_MAX, COGNITION_LIMIT_MIN, COGNITION_PURGE_BATCH, CONVICTION_TAGS, CONVICTION_TEXT_LIMIT, ConsolidationVerdictSchema, DEFAULT_MEDIA_COUNT, DEFAULT_VARIANT_ID, EMBEDDABLE_VIDEO_PROVIDER_CLAUSE, EMBEDDABLE_VIDEO_PROVIDER_LABELS, ENCYCLOPEDIA_TOOL_NAMES, EPISODE_PROBE_LIMIT_DEFAULT, EPISODE_PROBE_LIMIT_MIN, EPISODE_RECENCY_MIDPOINT_DEFAULT, EPISODE_RECENCY_MIDPOINT_MAX, EPISODE_RECENCY_MIDPOINT_MIN, EPISODE_RECENCY_SCALE_SECONDS_DEFAULT, EPISODE_RECENCY_SCALE_SECONDS_MAX, EPISODE_RECENCY_SCALE_SECONDS_MIN, EPISODE_RECENCY_WEIGHT_DEFAULT, EPISODE_RECENCY_WEIGHT_MAX, EPISODE_RECENCY_WEIGHT_MIN, EPISODE_SCORE_THRESHOLD_DEFAULT, EPISODE_SCORE_THRESHOLD_MAX, EPISODE_SCORE_THRESHOLD_MIN, EPISODE_TAGS, EPISODE_TEXT_LIMIT, EncyclopediaClassifySchema, ExtractedFactSchema, ExtractionSchema, FACT_KINDS, FACT_STABILITIES, HERO_VIDEO_TITLE_ISSUE, IMAGE_TASK_TEMPLATES, INSIGHTS_MAX_PER_TURN, INSIGHT_TAGS, INSIGHT_TEXT_LIMIT, IntentSchema, MEMORY_TOOL_NAMES, MORE_MEDIA_COUNT, MemoryClusterSummarySchema, MemoryEnrichmentSchema, NON_PAGE_EXTENSIONS, ResearchFrictionQueryDecisionSchema, ResearchFrictionQuerySchema, ResearchTriageDecisionSchema, ResearchTriageSchema, TAXONOMY_ICON_ALLOWLIST, TOOL_DESCRIPTIONS, TOOL_NAMES, TaxonomyPairVerdictSchema, VARIANT_NAMES, cardSchema, categorizeTools, clampCognitionLimit, clampEpisodeProbeLimit, clampEpisodeRecencyMidpoint, clampEpisodeRecencyScaleSeconds, clampEpisodeRecencyWeight, clampEpisodeScoreThreshold, compareSchema, createTextItemSchema, deriveSchemaKeys, describeSchema, discardedReferenceSchema, formatZodIssues, formatZodShape, galleryItemSchema, hasBlockedImageHost, heroVideoHasTitle, imagelistSchema, internationalCoverageSchema, isAllFieldsNullWipe, isImageTaskTemplate, isPrivateOrLocalhost, isTrustedImageUrl, isTrustedUrl, markerSchema, memoryProfileResponseSchema, mergeCognitionProfiles, normalizeInsightPath, ocrSchema, parseStoredProfile, productSchema, pruneProfileTopic, referenceGalleryItemSchema, referenceLineSchema, relatedStorySchema, safeMediaUrl, safeMediaUrlOrEmpty, safeUrl, safeVideoUrl, safeVideoUrlOrEmpty, shoplistSchema, sourceSchema, stockmarketItemSchema, stockmarketListSchema, summarySchema, videoGalleryItemSchema, videolistSchema };
@@ -460,6 +460,9 @@ declare function createMemoryPartitionRecallTool(deps: MemoryPartitionRecallDeps
460
460
  declare const memoryPartitionRememberSchema: z.ZodObject<{
461
461
  text: z.ZodString;
462
462
  category: z.ZodOptional<z.ZodString>;
463
+ community: z.ZodOptional<z.ZodString>;
464
+ subject: z.ZodOptional<z.ZodString>;
465
+ icon: z.ZodOptional<z.ZodString>;
463
466
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
464
467
  }, z.core.$strip>;
465
468
  type MemoryPartitionRememberInput = z.infer<typeof memoryPartitionRememberSchema>;
@@ -474,10 +477,42 @@ interface MemoryPartitionRememberDeps {
474
477
  text: string;
475
478
  tags?: string[];
476
479
  category?: string;
480
+ community?: string;
481
+ subject?: string;
482
+ icon?: string;
477
483
  }) => Promise<string>;
478
484
  }
479
485
  declare function createMemoryPartitionRememberTool(deps: MemoryPartitionRememberDeps): Tool;
480
486
 
487
+ declare const memoryTaxonomyProbeSchema: z.ZodObject<{
488
+ kind: z.ZodEnum<{
489
+ community: "community";
490
+ cluster: "cluster";
491
+ hub: "hub";
492
+ }>;
493
+ query: z.ZodString;
494
+ parentId: z.ZodOptional<z.ZodString>;
495
+ }, z.core.$strip>;
496
+ type MemoryTaxonomyProbeInput = z.infer<typeof memoryTaxonomyProbeSchema>;
497
+
498
+ interface MemoryTaxonomyProbeCandidate {
499
+ id: string;
500
+ name: string;
501
+ score: number;
502
+ summary?: string;
503
+ icon?: string;
504
+ }
505
+ interface MemoryTaxonomyProbeResult {
506
+ kind: MemoryTaxonomyProbeInput['kind'];
507
+ query: string;
508
+ candidates: MemoryTaxonomyProbeCandidate[];
509
+ guidance: string;
510
+ }
511
+ interface MemoryTaxonomyProbeDeps {
512
+ probe: (input: MemoryTaxonomyProbeInput) => Promise<MemoryTaxonomyProbeResult>;
513
+ }
514
+ declare function createMemoryTaxonomyProbeTool(deps: MemoryTaxonomyProbeDeps): Tool;
515
+
481
516
  declare const serperBusinessReviewsSearchSchema: z.ZodObject<{
482
517
  query: z.ZodOptional<z.ZodString>;
483
518
  placeId: z.ZodOptional<z.ZodString>;
@@ -763,4 +798,4 @@ interface VideoStats {
763
798
  lang?: string;
764
799
  }
765
800
 
766
- export { BRIGHT_DATA_TIMEOUT_MS, type BrightDataConfig, type BrightDataImageSearchInput, type BrightDataImageSearchResponse, type BrightDataNewsSearchInput, type BrightDataNewsSearchResponse, type BrightDataPlacesSearchInput, type BrightDataPlacesSearchResponse, type BrightDataShoppingSearchInput, type BrightDataShoppingSearchResponse, type BrightDataVideoSearchInput, type BrightDataVideoSearchResponse, type BrightDataWebSearchInput, type BrightDataWebSearchResponse, type BrightDataWebpageScrapeInput, type BrightDataWebpageScrapeResponse, type EncyclopediaReadToolInput, type EncyclopediaSearchToolInput, type EodhdConfig, type EodhdNewsConfig, type FilterVariant, HEADERS, MIN_IMAGE_HEIGHT, MIN_IMAGE_WIDTH, type MarketDailyBar, type MemoryCognitionDeleteInput, type MemoryCognitionDeleteOutcome, type MemoryCognitionForgetInput, type MemoryCognitionRememberInput, type MemoryPartitionDeleteInput, type MemoryPartitionRecallInput, type MemoryPartitionRememberInput, MemoryPoint, type MemoryToolScope, type ProviderEndpointConfig, RECENCY_DESCRIPTION, type ResolvableOffer, SEARCH_RETRIES, SEARCH_TIMEOUT_MS, SOURCE, STANDALONE_QUERY_DESCRIPTION, STANDALONE_QUERY_TOOL_CLAUSE, type SearchRecency, type SerperBusinessReviewsSearchInput, type SerperBusinessReviewsSearchResponse, type SerperConfig, type SerperImageSearchInput, type SerperImageSearchResponse, type SerperNewsSearchInput, type SerperNewsSearchResponse, type SerperPlacesSearchInput, type SerperPlacesSearchResponse, type SerperShoppingSearchInput, type SerperShoppingSearchResponse, type SerperVideoSearchInput, type SerperVideoSearchResponse, type SerperWebSearchInput, type SerperWebSearchResponse, type SerperWebpageScrapeInput, type SerperWebpageScrapeResponse, type SourcesConfig, type ToolConfigSnapshot, type ToolDependencies, type ToolLogger, type ToolSummaryFn, type ToolWithSummary, type Variant, type VideoStats, type WebFetchInput, type YoutubeConfig, type YoutubeSearchResponse, type YoutubeVideoSearchInput, type YoutubeVideosResponse, applyLocaleParams, applyRecencyParam, brightDataImageSearchSchema, brightDataNewsSearchSchema, brightDataPlacesSearchSchema, brightDataShoppingSearchSchema, brightDataVideoSearchSchema, brightDataWebSearchSchema, brightDataWebpageScrapeSchema, buildGoogleUrl, buildYoutubeThumbnailUrl, createBrightDataImageSearch, createBrightDataNewsSearch, createBrightDataPlacesSearch, createBrightDataShoppingSearch, createBrightDataVideoSearch, createBrightDataWebSearch, createBrightDataWebpageScrape, createEncyclopediaReadTool, createEncyclopediaSearchTool, createMemoryCognitionDeleteTool, createMemoryCognitionForgetTool, createMemoryCognitionRememberTool, createMemoryPartitionDeleteTool, createMemoryPartitionRecallTool, createMemoryPartitionRememberTool, createSerperBusinessReviewsSearch, createSerperImageSearch, createSerperNewsSearch, createSerperPlacesSearch, createSerperShoppingSearch, createSerperVideoSearch, createSerperWebSearch, createSerperWebpageScrape, createVariantRequestTool, createWebFetchTool, createYoutubeVideoSearch, defaultSummarize, encyclopediaReadSchema, encyclopediaSearchSchema, engineEnabled, extractArticleText, fetchWithTimeout, isGoogleHostUrl, localizedQuerySuffix, meetsMinimumImageDimensions, memoryCognitionDeleteSchema, memoryCognitionForgetSchema, memoryCognitionRememberSchema, memoryPartitionDeleteSchema, memoryPartitionRecallSchema, memoryPartitionRememberSchema, pickMerchantResult, requestBrightData, resolveSerperShopOfferLinks, serperBusinessReviewsSearchSchema, serperImageSearchSchema, serperNewsSearchSchema, serperPlacesSearchSchema, serperShoppingSearchSchema, serperVideoSearchSchema, serperWebSearchSchema, serperWebpageScrapeSchema, storeHostToken, summarizeContent, summarizeFound, summarizeResults, tbsSizeLabelForPixels, variantRequestSchema, webFetchSchema, withSummary, youtubeVideoSearchSchema };
801
+ export { BRIGHT_DATA_TIMEOUT_MS, type BrightDataConfig, type BrightDataImageSearchInput, type BrightDataImageSearchResponse, type BrightDataNewsSearchInput, type BrightDataNewsSearchResponse, type BrightDataPlacesSearchInput, type BrightDataPlacesSearchResponse, type BrightDataShoppingSearchInput, type BrightDataShoppingSearchResponse, type BrightDataVideoSearchInput, type BrightDataVideoSearchResponse, type BrightDataWebSearchInput, type BrightDataWebSearchResponse, type BrightDataWebpageScrapeInput, type BrightDataWebpageScrapeResponse, type EncyclopediaReadToolInput, type EncyclopediaSearchToolInput, type EodhdConfig, type EodhdNewsConfig, type FilterVariant, HEADERS, MIN_IMAGE_HEIGHT, MIN_IMAGE_WIDTH, type MarketDailyBar, type MemoryCognitionDeleteInput, type MemoryCognitionDeleteOutcome, type MemoryCognitionForgetInput, type MemoryCognitionRememberInput, type MemoryPartitionDeleteInput, type MemoryPartitionRecallInput, type MemoryPartitionRememberInput, MemoryPoint, type MemoryTaxonomyProbeCandidate, type MemoryTaxonomyProbeInput, type MemoryTaxonomyProbeResult, type MemoryToolScope, type ProviderEndpointConfig, RECENCY_DESCRIPTION, type ResolvableOffer, SEARCH_RETRIES, SEARCH_TIMEOUT_MS, SOURCE, STANDALONE_QUERY_DESCRIPTION, STANDALONE_QUERY_TOOL_CLAUSE, type SearchRecency, type SerperBusinessReviewsSearchInput, type SerperBusinessReviewsSearchResponse, type SerperConfig, type SerperImageSearchInput, type SerperImageSearchResponse, type SerperNewsSearchInput, type SerperNewsSearchResponse, type SerperPlacesSearchInput, type SerperPlacesSearchResponse, type SerperShoppingSearchInput, type SerperShoppingSearchResponse, type SerperVideoSearchInput, type SerperVideoSearchResponse, type SerperWebSearchInput, type SerperWebSearchResponse, type SerperWebpageScrapeInput, type SerperWebpageScrapeResponse, type SourcesConfig, type ToolConfigSnapshot, type ToolDependencies, type ToolLogger, type ToolSummaryFn, type ToolWithSummary, type Variant, type VideoStats, type WebFetchInput, type YoutubeConfig, type YoutubeSearchResponse, type YoutubeVideoSearchInput, type YoutubeVideosResponse, applyLocaleParams, applyRecencyParam, brightDataImageSearchSchema, brightDataNewsSearchSchema, brightDataPlacesSearchSchema, brightDataShoppingSearchSchema, brightDataVideoSearchSchema, brightDataWebSearchSchema, brightDataWebpageScrapeSchema, buildGoogleUrl, buildYoutubeThumbnailUrl, createBrightDataImageSearch, createBrightDataNewsSearch, createBrightDataPlacesSearch, createBrightDataShoppingSearch, createBrightDataVideoSearch, createBrightDataWebSearch, createBrightDataWebpageScrape, createEncyclopediaReadTool, createEncyclopediaSearchTool, createMemoryCognitionDeleteTool, createMemoryCognitionForgetTool, createMemoryCognitionRememberTool, createMemoryPartitionDeleteTool, createMemoryPartitionRecallTool, createMemoryPartitionRememberTool, createMemoryTaxonomyProbeTool, createSerperBusinessReviewsSearch, createSerperImageSearch, createSerperNewsSearch, createSerperPlacesSearch, createSerperShoppingSearch, createSerperVideoSearch, createSerperWebSearch, createSerperWebpageScrape, createVariantRequestTool, createWebFetchTool, createYoutubeVideoSearch, defaultSummarize, encyclopediaReadSchema, encyclopediaSearchSchema, engineEnabled, extractArticleText, fetchWithTimeout, isGoogleHostUrl, localizedQuerySuffix, meetsMinimumImageDimensions, memoryCognitionDeleteSchema, memoryCognitionForgetSchema, memoryCognitionRememberSchema, memoryPartitionDeleteSchema, memoryPartitionRecallSchema, memoryPartitionRememberSchema, memoryTaxonomyProbeSchema, pickMerchantResult, requestBrightData, resolveSerperShopOfferLinks, serperBusinessReviewsSearchSchema, serperImageSearchSchema, serperNewsSearchSchema, serperPlacesSearchSchema, serperShoppingSearchSchema, serperVideoSearchSchema, serperWebSearchSchema, serperWebpageScrapeSchema, storeHostToken, summarizeContent, summarizeFound, summarizeResults, tbsSizeLabelForPixels, variantRequestSchema, webFetchSchema, withSummary, youtubeVideoSearchSchema };
@@ -1111,7 +1111,16 @@ ${lines.join("\n")}`;
1111
1111
  var memoryPartitionRememberSchema = z.object({
1112
1112
  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".'),
1113
1113
  category: z.string().min(1).max(40).optional().describe(
1114
- 'One broad lowercase PLURAL category the fact belongs to, e.g. "stocks", "games", "pets", "work" \u2014 a family noun, never a specific entity/product/company/game name ("amd" \u2192 "stocks"; "stellar blade" \u2192 "games"). Always include it.'
1114
+ '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"). Always include it.'
1115
+ ),
1116
+ community: z.string().min(1).max(60).optional().describe(
1117
+ 'One lowercase PLURAL sub-family narrowing the category, e.g. "survival games" under "games" \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch). Omit it when no sub-family applies; never a specific entity, product, or title.'
1118
+ ),
1119
+ subject: z.string().min(1).max(40).optional().describe(
1120
+ '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.'
1121
+ ),
1122
+ icon: z.string().min(1).max(64).optional().describe(
1123
+ '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.'
1115
1124
  ),
1116
1125
  tags: z.array(z.string().min(1).max(40)).max(8).optional().describe(
1117
1126
  'Optional topic labels (lowercase, reusable, NARROW \u2014 entity/product/game names) so future recall can filter by topic, e.g. ["contacts", "sam"], ["amd"], ["stellar blade"].'
@@ -1119,9 +1128,9 @@ var memoryPartitionRememberSchema = z.object({
1119
1128
  });
1120
1129
  function createMemoryPartitionRememberTool(deps) {
1121
1130
  return tool({
1122
- 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 `category` is one broad family label (games, pets, work, health \u2026) that groups narrow tags into one topic family \u2014 always include both.',
1131
+ 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 exactly once: `category` one broad PLURAL family label (games, pets, work, health \u2026 \u2014 the cluster tier), `community` one PLURAL sub-family under it when one applies (survival games, action rpgs \u2026), `subject` the SINGULAR entity the fact is about (project zomboid, amd, sam \u2026 \u2014 the hub tier). Always include category; include subject for entity facts; reuse existing labels whenever they fit.',
1123
1132
  inputSchema: memoryPartitionRememberSchema,
1124
- execute: async ({ text, tags, category }) => {
1133
+ execute: async ({ text, tags, category, community, subject, icon }) => {
1125
1134
  try {
1126
1135
  const id = await deps.storeRecord({
1127
1136
  memoryPartition: deps.scope.memoryPartition,
@@ -1130,7 +1139,10 @@ function createMemoryPartitionRememberTool(deps) {
1130
1139
  requestId: deps.scope.requestId,
1131
1140
  text,
1132
1141
  tags,
1133
- category
1142
+ category,
1143
+ community,
1144
+ subject,
1145
+ icon
1134
1146
  });
1135
1147
  return { stored: true, id };
1136
1148
  } catch (error) {
@@ -1142,6 +1154,35 @@ function createMemoryPartitionRememberTool(deps) {
1142
1154
  }
1143
1155
  });
1144
1156
  }
1157
+ var memoryTaxonomyProbeSchema = z.object({
1158
+ kind: z.enum(["cluster", "community", "hub"]).describe(
1159
+ "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)."
1160
+ ),
1161
+ query: z.string().min(1).max(120).describe(
1162
+ 'The label you are considering (e.g. "games", "survival games", "project zomboid") \u2014 scored against the existing taxonomy by name similarity and meaning.'
1163
+ ),
1164
+ parentId: z.string().optional().describe(
1165
+ "The adopted node id from the tier ABOVE (community probes pass the adopted cluster id; hub probes pass the adopted community or cluster id). Narrows the candidacy to that parent; omit only when you are about to CREATE the parent."
1166
+ )
1167
+ });
1168
+ function createMemoryTaxonomyProbeTool(deps) {
1169
+ return tool({
1170
+ description: 'Probe the macro-taxonomy before naming a label \u2014 MANDATORY before any community or hub you are not already certain exists. Work top-down: first probe kind="cluster" with the family label you intend; ADOPT a returned candidate by using its name verbatim (keep its id for the next probe), or CREATE when nothing fits. Then probe kind="community" with parentId = the cluster id (omit parentId when you are creating the cluster), then kind="hub" with parentId = the community or cluster id above it. Creation phrasing: cluster/community are PLURAL family nouns, never a specific entity or title; a hub is the SINGULAR main subject entity. The taxonomy is read-only: never invent a near-duplicate of a listed candidate \u2014 name the candidate VERBATIM.',
1171
+ inputSchema: memoryTaxonomyProbeSchema,
1172
+ execute: async (input) => {
1173
+ try {
1174
+ return await deps.probe(input);
1175
+ } catch (error) {
1176
+ return {
1177
+ kind: input.kind,
1178
+ query: input.query,
1179
+ candidates: [],
1180
+ guidance: `Probe failed (${error instanceof Error ? error.message : "unknown error"}) \u2014 fall back to the phrasing rules and create the label.`
1181
+ };
1182
+ }
1183
+ }
1184
+ });
1185
+ }
1145
1186
  var serperBusinessReviewsSearchSchema = z.object({
1146
1187
  query: z.string().optional().describe(
1147
1188
  "The exact business or place name, ideally with its location, named explicitly and resolved from the conversation. Used when neither placeId nor cid is known."
@@ -1706,8 +1747,8 @@ var defaultSummarize = (data) => {
1706
1747
  if (typeof data.content === "string") return summarizeContent(data);
1707
1748
  return {};
1708
1749
  };
1709
- function withSummary(tool27, summarize = defaultSummarize) {
1710
- const t = tool27;
1750
+ function withSummary(tool28, summarize = defaultSummarize) {
1751
+ const t = tool28;
1711
1752
  t.summarize = summarize;
1712
1753
  return t;
1713
1754
  }
@@ -1890,4 +1931,4 @@ function createYoutubeVideoSearch(deps) {
1890
1931
  });
1891
1932
  }
1892
1933
 
1893
- export { BRIGHT_DATA_TIMEOUT_MS, HEADERS, MIN_IMAGE_HEIGHT, MIN_IMAGE_WIDTH, RECENCY_DESCRIPTION, SEARCH_RETRIES, SEARCH_TIMEOUT_MS, SOURCE, STANDALONE_QUERY_DESCRIPTION, STANDALONE_QUERY_TOOL_CLAUSE, applyLocaleParams, applyRecencyParam, brightDataImageSearchSchema, brightDataNewsSearchSchema, brightDataPlacesSearchSchema, brightDataShoppingSearchSchema, brightDataVideoSearchSchema, brightDataWebSearchSchema, brightDataWebpageScrapeSchema, buildGoogleUrl, buildYoutubeThumbnailUrl, createBrightDataImageSearch, createBrightDataNewsSearch, createBrightDataPlacesSearch, createBrightDataShoppingSearch, createBrightDataVideoSearch, createBrightDataWebSearch, createBrightDataWebpageScrape, createEncyclopediaReadTool, createEncyclopediaSearchTool, createMemoryCognitionDeleteTool, createMemoryCognitionForgetTool, createMemoryCognitionRememberTool, createMemoryPartitionDeleteTool, createMemoryPartitionRecallTool, createMemoryPartitionRememberTool, createSerperBusinessReviewsSearch, createSerperImageSearch, createSerperNewsSearch, createSerperPlacesSearch, createSerperShoppingSearch, createSerperVideoSearch, createSerperWebSearch, createSerperWebpageScrape, createVariantRequestTool, createWebFetchTool, createYoutubeVideoSearch, defaultSummarize, encyclopediaReadSchema, encyclopediaSearchSchema, engineEnabled, extractArticleText, fetchWithTimeout, isGoogleHostUrl, localizedQuerySuffix, meetsMinimumImageDimensions, memoryCognitionDeleteSchema, memoryCognitionForgetSchema, memoryCognitionRememberSchema, memoryPartitionDeleteSchema, memoryPartitionRecallSchema, memoryPartitionRememberSchema, pickMerchantResult, requestBrightData, resolveSerperShopOfferLinks, serperBusinessReviewsSearchSchema, serperImageSearchSchema, serperNewsSearchSchema, serperPlacesSearchSchema, serperShoppingSearchSchema, serperVideoSearchSchema, serperWebSearchSchema, serperWebpageScrapeSchema, storeHostToken, summarizeContent, summarizeFound, summarizeResults, tbsSizeLabelForPixels, variantRequestSchema, webFetchSchema, withSummary, youtubeVideoSearchSchema };
1934
+ export { BRIGHT_DATA_TIMEOUT_MS, HEADERS, MIN_IMAGE_HEIGHT, MIN_IMAGE_WIDTH, RECENCY_DESCRIPTION, SEARCH_RETRIES, SEARCH_TIMEOUT_MS, SOURCE, STANDALONE_QUERY_DESCRIPTION, STANDALONE_QUERY_TOOL_CLAUSE, applyLocaleParams, applyRecencyParam, brightDataImageSearchSchema, brightDataNewsSearchSchema, brightDataPlacesSearchSchema, brightDataShoppingSearchSchema, brightDataVideoSearchSchema, brightDataWebSearchSchema, brightDataWebpageScrapeSchema, buildGoogleUrl, buildYoutubeThumbnailUrl, createBrightDataImageSearch, createBrightDataNewsSearch, createBrightDataPlacesSearch, createBrightDataShoppingSearch, createBrightDataVideoSearch, createBrightDataWebSearch, createBrightDataWebpageScrape, createEncyclopediaReadTool, createEncyclopediaSearchTool, createMemoryCognitionDeleteTool, createMemoryCognitionForgetTool, createMemoryCognitionRememberTool, createMemoryPartitionDeleteTool, createMemoryPartitionRecallTool, createMemoryPartitionRememberTool, createMemoryTaxonomyProbeTool, createSerperBusinessReviewsSearch, createSerperImageSearch, createSerperNewsSearch, createSerperPlacesSearch, createSerperShoppingSearch, createSerperVideoSearch, createSerperWebSearch, createSerperWebpageScrape, createVariantRequestTool, createWebFetchTool, createYoutubeVideoSearch, defaultSummarize, encyclopediaReadSchema, encyclopediaSearchSchema, engineEnabled, extractArticleText, fetchWithTimeout, isGoogleHostUrl, localizedQuerySuffix, meetsMinimumImageDimensions, memoryCognitionDeleteSchema, memoryCognitionForgetSchema, memoryCognitionRememberSchema, memoryPartitionDeleteSchema, memoryPartitionRecallSchema, memoryPartitionRememberSchema, memoryTaxonomyProbeSchema, pickMerchantResult, requestBrightData, resolveSerperShopOfferLinks, serperBusinessReviewsSearchSchema, serperImageSearchSchema, serperNewsSearchSchema, serperPlacesSearchSchema, serperShoppingSearchSchema, serperVideoSearchSchema, serperWebSearchSchema, serperWebpageScrapeSchema, storeHostToken, summarizeContent, summarizeFound, summarizeResults, tbsSizeLabelForPixels, variantRequestSchema, webFetchSchema, withSummary, youtubeVideoSearchSchema };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@triplef/agent",
3
3
  "description": "tripleF (3F) agent domain — structured-output schemas, prompt builders, and model tools shared across the apps.",
4
- "version": "0.1.25",
4
+ "version": "0.1.26",
5
5
  "packageManager": "pnpm@11.25.0",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "turndown": "^7.2.4"
61
61
  },
62
62
  "peerDependencies": {
63
- "ai": "^7.0.92",
63
+ "ai": "^7.0.93",
64
64
  "zod": "^4.5.4"
65
65
  },
66
66
  "peerDependenciesMeta": {