@triplef/agent 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/prompts/index.d.ts +23 -8
- package/dist/prompts/index.mjs +153 -35
- package/dist/schemas/index.d.ts +18 -1
- package/dist/schemas/index.mjs +168 -15
- package/dist/tools/index.d.ts +36 -1
- package/dist/tools/index.mjs +48 -7
- package/package.json +4 -4
package/dist/prompts/index.d.ts
CHANGED
|
@@ -131,7 +131,15 @@ interface ConvictionEvidenceItem {
|
|
|
131
131
|
}
|
|
132
132
|
declare function buildConvictionSynthesisPrompt(evidence: readonly ConvictionEvidenceItem[]): string;
|
|
133
133
|
|
|
134
|
-
|
|
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-
|
|
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\", \"tv shows\" under \"shows\"); omit when no sub-family applies.\n - subject (HUB): the lowercase SINGULAR main subject entity the fact is about (\"project zomboid\", \"amd\", \"sam\") \u2014 a specific name, never pluralized; always include when the fact is about a specific entity.\n A category or community is NEVER a specific entity, product, company, or game title: \"amd\" is a subject under the category \"stocks\"; \"stellar blade\" is a subject under the category \"games\"; a show/work title like \"breaking-bad\" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.\n- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category \"shows\", community \"tv shows\", hub the show's title or the persona name); never \"family\", \"education\", \"business\", or \"science\" for invented content.\n\nTAXONOMY PROBING (pick first, create if necessary): before naming a 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
|
-
|
|
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
|
|
228
|
-
declare function
|
|
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
|
|
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 };
|
package/dist/prompts/index.mjs
CHANGED
|
@@ -3018,48 +3018,89 @@ 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
|
|
3022
|
-
* entity, product, company, or title.
|
|
3021
|
+
* `work`, `health`) — the constellation's CLUSTER tier. Never a specific
|
|
3022
|
+
* entity, product, company, or title. Fiction/entertainment content takes
|
|
3023
|
+
* the medium family (e.g. `shows`) — never an in-universe domain (`family`,
|
|
3024
|
+
* `education`, `business` describe reality, not an invented life).
|
|
3023
3025
|
*/
|
|
3024
3026
|
category: z.string(),
|
|
3025
3027
|
/**
|
|
3026
|
-
*
|
|
3027
|
-
* `
|
|
3028
|
-
*
|
|
3028
|
+
* One lowercase PLURAL sub-family label narrowing the category (e.g.
|
|
3029
|
+
* `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3030
|
+
* constellation's COMMUNITY tier, one level below the cluster. Optional:
|
|
3031
|
+
* omit when no sub-family applies. Never a specific entity, product,
|
|
3032
|
+
* company, or title — a show/work title like `breaking-bad` is a topic or
|
|
3033
|
+
* tag, never a community.
|
|
3029
3034
|
*/
|
|
3030
|
-
|
|
3035
|
+
community: z.string().optional(),
|
|
3036
|
+
/**
|
|
3037
|
+
* The narrow SINGULAR subject entity the document is about (e.g.
|
|
3038
|
+
* `wuthering waves`, `q3 budget`) — the constellation's HUB tier. A short,
|
|
3039
|
+
* specific, reusable label, not a sentence and not a URL.
|
|
3040
|
+
*/
|
|
3041
|
+
topic: z.string(),
|
|
3042
|
+
/**
|
|
3043
|
+
* Lucide icon name for a label this classification CREATES (attached to
|
|
3044
|
+
* the deepest NEW label: topic first, then community, then category).
|
|
3045
|
+
* Only from the curated taxonomy icon set; omit when adopting existing
|
|
3046
|
+
* labels or no icon fits.
|
|
3047
|
+
*/
|
|
3048
|
+
icon: z.string().optional()
|
|
3031
3049
|
});
|
|
3032
3050
|
|
|
3033
3051
|
// src/prompts/memory/vocabulary-section.helper.ts
|
|
3034
|
-
function buildVocabularySection(
|
|
3035
|
-
|
|
3052
|
+
function buildVocabularySection(vocab = {}) {
|
|
3053
|
+
const { categories = [], communities = [], hubs = [], tags = [] } = vocab;
|
|
3054
|
+
if (categories.length === 0 && communities.length === 0 && hubs.length === 0 && tags.length === 0) {
|
|
3055
|
+
return "";
|
|
3056
|
+
}
|
|
3036
3057
|
const lines = [];
|
|
3037
|
-
if (
|
|
3058
|
+
if (categories.length > 0) {
|
|
3038
3059
|
lines.push(
|
|
3039
|
-
`KNOWN CATEGORIES (reuse one when it fits; only mint a new plural family noun when none applies): ${
|
|
3060
|
+
`KNOWN CATEGORIES (cluster tier \u2014 reuse one when it fits; only mint a new plural family noun when none applies): ${categories.join(", ")}`
|
|
3040
3061
|
);
|
|
3041
3062
|
}
|
|
3042
|
-
if (
|
|
3043
|
-
lines.push(
|
|
3063
|
+
if (communities.length > 0) {
|
|
3064
|
+
lines.push(
|
|
3065
|
+
`KNOWN COMMUNITIES (community tier \u2014 plural sub-families under a category; reuse when they fit): ${communities.join(", ")}`
|
|
3066
|
+
);
|
|
3067
|
+
}
|
|
3068
|
+
if (hubs.length > 0) {
|
|
3069
|
+
lines.push(
|
|
3070
|
+
`KNOWN HUBS (hub tier \u2014 singular subject entities; name them verbatim when the text is about one): ${hubs.join(", ")}`
|
|
3071
|
+
);
|
|
3072
|
+
}
|
|
3073
|
+
if (tags.length > 0) {
|
|
3074
|
+
lines.push(`KNOWN TOPICS (reuse these tag labels when they fit): ${tags.join(", ")}`);
|
|
3044
3075
|
}
|
|
3045
3076
|
return lines.join("\n");
|
|
3046
3077
|
}
|
|
3047
3078
|
|
|
3048
3079
|
// src/prompts/memory/encyclopedia-classify-prompt.constant.ts
|
|
3049
|
-
function buildEncyclopediaClassifyPrompt(
|
|
3080
|
+
function buildEncyclopediaClassifyPrompt(vocabulary = {}) {
|
|
3050
3081
|
return buildStructuredPrompt(EncyclopediaClassifySchema, {
|
|
3051
3082
|
before: "OUTPUT FORMAT \u2014 output ONLY valid JSON matching this exact schema:",
|
|
3052
3083
|
after: `
|
|
3053
|
-
YOUR TASK \u2014 label one stored source document with its
|
|
3084
|
+
YOUR TASK \u2014 label one stored source document with its place in the macro-taxonomy:
|
|
3085
|
+
|
|
3086
|
+
TAXONOMY HIERARCHY (top-down): CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE
|
|
3087
|
+
- CLUSTER = a broad PLURAL family noun ("games", "work", "health") \u2014 the highest logical bucket.
|
|
3088
|
+
- COMMUNITY = a PLURAL sub-family under one cluster ("survival-games" under "games") \u2014 a genre or domain branch.
|
|
3089
|
+
- HUB = the SINGULAR main subject entity anchoring the document ("project zomboid", "wuthering waves") \u2014 a specific name, never pluralized.
|
|
3090
|
+
- NODE = the individual chunks of the document itself \u2014 the leaves attached to the hub (you never name these).
|
|
3091
|
+
|
|
3054
3092
|
- 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
|
-
-
|
|
3056
|
-
-
|
|
3093
|
+
- FICTION & ENTERTAINMENT CONTENT (absolute): a document about an entertainment work or fictional universe classifies by its real-world MEDIUM, never by the work's in-universe domains. A TV episode page about a character's family or career is NOT "family", "education", "business", or "science" \u2014 the category is the medium family (e.g. "shows"), the community a true plural sub-family (e.g. "tv-shows"), and the work's title is the topic (e.g. "breaking bad"), never the community.
|
|
3094
|
+
- 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.
|
|
3095
|
+
- 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 \u2014 a show/work title like "breaking-bad" is a topic or a tag, never a community.
|
|
3096
|
+
- 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
3097
|
- When the document is about a KNOWN TOPIC, output that label VERBATIM \u2014 prefer "neverness to everness" over minting a variant like "nte".
|
|
3058
|
-
|
|
3098
|
+
- 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.
|
|
3099
|
+
${buildVocabularySection(vocabulary)}
|
|
3059
3100
|
RULES:
|
|
3060
3101
|
- Return ONLY a single valid JSON object matching the exact schema above.
|
|
3061
3102
|
- No markdown code fences, no explanations, preamble, or postscript.
|
|
3062
|
-
- Never output undefined or null.
|
|
3103
|
+
- Never output undefined or null. "category" and "topic" are always present; "community" and "icon" are omitted when they don't apply.
|
|
3063
3104
|
|
|
3064
3105
|
FINAL REMINDER:
|
|
3065
3106
|
- Output ONLY valid JSON matching the exact schema above. No markdown code fences, no explanations, preamble, or postscript.`
|
|
@@ -3406,7 +3447,14 @@ STORAGE MECHANICS \u2014 how your memory works (write for the retriever):
|
|
|
3406
3447
|
- 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
3448
|
- Restating a record verbatim OVERWRITES it in place \u2014 updates are restatements of the full corrected statement, not diffs.
|
|
3408
3449
|
- 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
|
-
-
|
|
3450
|
+
- 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):
|
|
3451
|
+
- category (CLUSTER): ONE lowercase PLURAL family noun \u2014 stocks, games, pets, work, health, finance, contacts \u2026
|
|
3452
|
+
- community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category ("survival games" under "games", "tv shows" under "shows"); omit when no sub-family applies.
|
|
3453
|
+
- 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.
|
|
3454
|
+
A category or community is NEVER a specific entity, product, company, or game title: "amd" is a subject under the category "stocks"; "stellar blade" is a subject under the category "games"; a show/work title like "breaking-bad" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.
|
|
3455
|
+
- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category "shows", community "tv shows", hub the show's title or the persona name); never "family", "education", "business", or "science" for invented content.
|
|
3456
|
+
|
|
3457
|
+
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
3458
|
|
|
3411
3459
|
Do NOT store:
|
|
3412
3460
|
- Public facts merely fetched this turn that do not relate to the user (e.g. generic web results).
|
|
@@ -3419,7 +3467,7 @@ Rules:
|
|
|
3419
3467
|
- Call each remember tool once per distinct durable item \u2014 no more.
|
|
3420
3468
|
- 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
3469
|
function buildMemoryWritePrompt(params) {
|
|
3422
|
-
const vocabulary = buildVocabularySection(params.
|
|
3470
|
+
const vocabulary = buildVocabularySection(params.vocabulary);
|
|
3423
3471
|
return [
|
|
3424
3472
|
`USER REQUEST: ${params.userRequest}`,
|
|
3425
3473
|
`PRIOR MEMORY: ${params.priorMemory?.trim() || "(none stored yet)"}`,
|
|
@@ -3525,6 +3573,42 @@ function buildResearchTriagePrompt(gaps, maxPayloadChars) {
|
|
|
3525
3573
|
return [`GAPS:
|
|
3526
3574
|
${limitText(body, maxPayloadChars)}`, "Write the decisions JSON object now."].join("\n\n");
|
|
3527
3575
|
}
|
|
3576
|
+
var TaxonomyPairVerdictSchema = z.object({
|
|
3577
|
+
/**
|
|
3578
|
+
* `same` — the two labels name the same concept (a wording/casing/plural
|
|
3579
|
+
* variant) and merge. `distinct` — genuinely different concepts that only
|
|
3580
|
+
* look alike; keep both. When in doubt: DISTINCT.
|
|
3581
|
+
*/
|
|
3582
|
+
verdict: z.enum(["same", "distinct"]),
|
|
3583
|
+
/** One short sentence justifying the verdict (audit trail). */
|
|
3584
|
+
reason: z.string().optional()
|
|
3585
|
+
});
|
|
3586
|
+
|
|
3587
|
+
// src/prompts/memory/taxonomy-reconcile-prompt.constant.ts
|
|
3588
|
+
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.
|
|
3589
|
+
|
|
3590
|
+
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).
|
|
3591
|
+
|
|
3592
|
+
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").
|
|
3593
|
+
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.`;
|
|
3594
|
+
function buildTaxonomyPairPrompt(params) {
|
|
3595
|
+
return `TIER: ${params.kind}
|
|
3596
|
+
LABEL A: "${params.labelA}" (used by ${params.countA} records)
|
|
3597
|
+
LABEL B: "${params.labelB}" (used by ${params.countB} records)
|
|
3598
|
+
|
|
3599
|
+
Decide: do these two labels name the SAME concept (merge) or are they DISTINCT (keep both)?`;
|
|
3600
|
+
}
|
|
3601
|
+
function buildTaxonomyReconcileSystemPrompt() {
|
|
3602
|
+
return buildStructuredPrompt(TaxonomyPairVerdictSchema, {
|
|
3603
|
+
before: `${TAXONOMY_RECONCILE_INSTRUCTIONS}
|
|
3604
|
+
|
|
3605
|
+
OUTPUT FORMAT \u2014 output ONLY valid JSON matching this exact schema:`,
|
|
3606
|
+
after: `
|
|
3607
|
+
RULES:
|
|
3608
|
+
- Return ONLY a single valid JSON object matching the exact schema above.
|
|
3609
|
+
- No markdown code fences, no explanations, preamble, or postscript.`
|
|
3610
|
+
});
|
|
3611
|
+
}
|
|
3528
3612
|
var FACT_KINDS = [
|
|
3529
3613
|
"preference",
|
|
3530
3614
|
"decision",
|
|
@@ -3544,16 +3628,30 @@ var ExtractedFactSchema = z.object({
|
|
|
3544
3628
|
text: z.string(),
|
|
3545
3629
|
/**
|
|
3546
3630
|
* The lowercase entity the fact is about (default `user`; a person,
|
|
3547
|
-
* product, or project name)
|
|
3631
|
+
* product, or project name) — the constellation's HUB tier: singular,
|
|
3632
|
+
* specific, stable. Maintenance adjudication only ever compares
|
|
3548
3633
|
* facts about the SAME subject.
|
|
3549
3634
|
*/
|
|
3550
3635
|
subject: z.string().optional(),
|
|
3551
3636
|
/**
|
|
3552
3637
|
* One broad lowercase PLURAL family label for THIS fact (e.g. `stocks`,
|
|
3553
|
-
* `pets`, `games`) —
|
|
3554
|
-
*
|
|
3638
|
+
* `pets`, `games`) — the constellation's CLUSTER tier. Inherits the
|
|
3639
|
+
* turn-side category when omitted. Never
|
|
3640
|
+
* a specific entity, product, company, or game title. Persona/roleplay or
|
|
3641
|
+
* fictional content classifies by its real-world medium (a TV persona's
|
|
3642
|
+
* biography belongs under `shows`), never by in-universe domains (`family`,
|
|
3643
|
+
* `education`, `business` describe reality, not an invented life).
|
|
3555
3644
|
*/
|
|
3556
3645
|
category: z.string().optional(),
|
|
3646
|
+
/**
|
|
3647
|
+
* One lowercase PLURAL sub-family label narrowing THIS fact's category
|
|
3648
|
+
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3649
|
+
* constellation's COMMUNITY tier, one level below the cluster. Inherits the
|
|
3650
|
+
* turn-side community when omitted; omit when no sub-family applies. Never
|
|
3651
|
+
* a specific entity, product, or title — a show/work title like
|
|
3652
|
+
* `breaking-bad` is a tag or hub, never a community.
|
|
3653
|
+
*/
|
|
3654
|
+
community: z.string().optional(),
|
|
3557
3655
|
/** What kind of durable thing this is (see FACT_KINDS). */
|
|
3558
3656
|
kind: z.enum(FACT_KINDS),
|
|
3559
3657
|
/** Whether a newer statement is expected to replace this one (see FACT_STABILITIES). */
|
|
@@ -3576,18 +3674,31 @@ var ExtractionSchema = z.object({
|
|
|
3576
3674
|
tags: z.array(z.string()),
|
|
3577
3675
|
/**
|
|
3578
3676
|
* One broad lowercase PLURAL family label for the whole turn-side (e.g.
|
|
3579
|
-
* `stocks`, `pets`, `games`) —
|
|
3580
|
-
*
|
|
3581
|
-
* passes, and backstops facts that omit their own `category`. Never a
|
|
3677
|
+
* `stocks`, `pets`, `games`) — the constellation's CLUSTER tier. Groups
|
|
3678
|
+
* the narrow tags into one topic family, powers the relink job's
|
|
3679
|
+
* per-category passes, and backstops facts that omit their own `category`. Never a
|
|
3582
3680
|
* specific entity, product, company, or game title: `amd` belongs under
|
|
3583
|
-
* `stocks`; `stellar blade` belongs under `games`.
|
|
3681
|
+
* `stocks`; `stellar blade` belongs under `games`. Persona/roleplay or
|
|
3682
|
+
* fictional content classifies by its real-world medium (e.g. `shows`
|
|
3683
|
+
* for a TV persona), never by in-universe domains (`family`, `education`,
|
|
3684
|
+
* `business` describe reality, not an invented life). Optional: a turn with
|
|
3584
3685
|
* nothing durable may omit it.
|
|
3585
3686
|
*/
|
|
3586
|
-
category: z.string().optional()
|
|
3687
|
+
category: z.string().optional(),
|
|
3688
|
+
/**
|
|
3689
|
+
* One lowercase PLURAL sub-family label narrowing the turn-side category
|
|
3690
|
+
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3691
|
+
* constellation's COMMUNITY tier: a genre, project family, or domain branch
|
|
3692
|
+
* one level below the cluster. Backstops facts that omit their own
|
|
3693
|
+
* `community`. Optional: omit it when no sub-family applies. Never a
|
|
3694
|
+
* specific entity, product, or title — a show/work title like
|
|
3695
|
+
* `breaking-bad` is a tag or hub, never a community.
|
|
3696
|
+
*/
|
|
3697
|
+
community: z.string().optional()
|
|
3587
3698
|
});
|
|
3588
3699
|
|
|
3589
3700
|
// src/prompts/memory/vectorize-prompt.constant.ts
|
|
3590
|
-
function buildExtractionPrompt(
|
|
3701
|
+
function buildExtractionPrompt(vocabulary = {}) {
|
|
3591
3702
|
return buildStructuredPrompt(ExtractionSchema, {
|
|
3592
3703
|
before: "OUTPUT FORMAT \u2014 output ONLY valid JSON matching this exact schema:",
|
|
3593
3704
|
after: `
|
|
@@ -3599,10 +3710,16 @@ YOUR TASK \u2014 decide what is worth remembering:
|
|
|
3599
3710
|
- 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
3711
|
- 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
3712
|
|
|
3602
|
-
FACT METADATA \u2014 every fact object carries the fields the maintenance passes (consolidate/reflect/conviction) interpret:
|
|
3713
|
+
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:
|
|
3714
|
+
- CLUSTER (category): a broad PLURAL family noun ("games", "stocks", "pets").
|
|
3715
|
+
- COMMUNITY (community): a PLURAL sub-family under one cluster ("survival-games" under "games") \u2014 a genre or domain branch.
|
|
3716
|
+
- HUB (subject): the SINGULAR main subject entity anchoring the fact ("project zomboid", "amd", "sam") \u2014 a specific name, never pluralized.
|
|
3717
|
+
PERSONA & FICTION CONTENT (absolute): facts about an adopted persona, a roleplay, or a fictional/entertainment work classify by the content's real-world MEDIUM, never by its in-universe domains. A TV persona's biography, family, career, or studies are NOT real-world walk-of-life categories \u2014 never "family", "education", "business", or "science" for invented content: the cluster is the medium family (e.g. "shows"), the community a true plural sub-family (e.g. "tv-shows"), and the show's title goes to the hub or the tags ("breaking bad"), never to the community.
|
|
3718
|
+
Fields:
|
|
3603
3719
|
- 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
|
|
3720
|
+
- 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.
|
|
3721
|
+
- 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.
|
|
3722
|
+
- 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
3723
|
- kind (required): what kind of durable thing it is:
|
|
3607
3724
|
- preference \u2014 RESERVED, never emit: likes, dislikes, wants, and interests are subjective user data owned by the cognition tier (see ROUTING BOUNDARY)
|
|
3608
3725
|
- decision \u2014 a choice that was made (adoptions, migrations, purchases committed to)
|
|
@@ -3614,9 +3731,10 @@ FACT METADATA \u2014 every fact object carries the fields the maintenance passes
|
|
|
3614
3731
|
- fact \u2014 any other durable fact
|
|
3615
3732
|
- 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
3733
|
- 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.
|
|
3734
|
+
- Category: ONE broad lowercase PLURAL family noun for the whole text (e.g. "stocks", "pets", "games", "health") \u2014 the CLUSTER tier \u2014 that groups the narrow tags into one topic family. A category is NEVER a specific entity, product, company, or game title: "amd" belongs under "stocks"; "stellar blade" and "stellar blade blood rain" belong under "games". Persona/fictional content follows the PERSONA & FICTION rule above (medium family, not in-universe domains). Always include it when facts are emitted; omit it when nothing durable is found.
|
|
3735
|
+
- Community: ONE broad lowercase PLURAL sub-family that narrows the category (e.g. "survival-games", "action-rpgs" under "games"; "tv-shows" under "shows") \u2014 the COMMUNITY tier between the cluster and the hub. Omit it when no sub-family applies; never a specific entity, product, or title \u2014 a show/work title like "breaking-bad" is a tag or hub, never a community.
|
|
3618
3736
|
- If nothing durable is found, return an empty facts array; tags may still label the topic when useful.
|
|
3619
|
-
${buildVocabularySection(
|
|
3737
|
+
${buildVocabularySection(vocabulary)}
|
|
3620
3738
|
PRIOR MEMORY (when the user message ends with an "ALREADY STORED IN MEMORY" section):
|
|
3621
3739
|
- That section lists facts already stored in YOUR long-term memory from prior turns. NEVER emit a fact already covered there.
|
|
3622
3740
|
- 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 +3790,4 @@ Compose the response from the snippets below. Include every snippet you can subs
|
|
|
3672
3790
|
${parts.join("\n\n")}`;
|
|
3673
3791
|
}
|
|
3674
3792
|
|
|
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 };
|
|
3793
|
+
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 };
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -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 };
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -71,16 +71,34 @@ 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
|
|
75
|
-
* entity, product, company, or title.
|
|
74
|
+
* `work`, `health`) — the constellation's CLUSTER tier. Never a specific
|
|
75
|
+
* entity, product, company, or title. Fiction/entertainment content takes
|
|
76
|
+
* the medium family (e.g. `shows`) — never an in-universe domain (`family`,
|
|
77
|
+
* `education`, `business` describe reality, not an invented life).
|
|
76
78
|
*/
|
|
77
79
|
category: z.string(),
|
|
78
80
|
/**
|
|
79
|
-
*
|
|
80
|
-
* `
|
|
81
|
-
*
|
|
81
|
+
* One lowercase PLURAL sub-family label narrowing the category (e.g.
|
|
82
|
+
* `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
83
|
+
* constellation's COMMUNITY tier, one level below the cluster. Optional:
|
|
84
|
+
* omit when no sub-family applies. Never a specific entity, product,
|
|
85
|
+
* company, or title — a show/work title like `breaking-bad` is a topic or
|
|
86
|
+
* tag, never a community.
|
|
82
87
|
*/
|
|
83
|
-
|
|
88
|
+
community: z.string().optional(),
|
|
89
|
+
/**
|
|
90
|
+
* The narrow SINGULAR subject entity the document is about (e.g.
|
|
91
|
+
* `wuthering waves`, `q3 budget`) — the constellation's HUB tier. A short,
|
|
92
|
+
* specific, reusable label, not a sentence and not a URL.
|
|
93
|
+
*/
|
|
94
|
+
topic: z.string(),
|
|
95
|
+
/**
|
|
96
|
+
* Lucide icon name for a label this classification CREATES (attached to
|
|
97
|
+
* the deepest NEW label: topic first, then community, then category).
|
|
98
|
+
* Only from the curated taxonomy icon set; omit when adopting existing
|
|
99
|
+
* labels or no icon fits.
|
|
100
|
+
*/
|
|
101
|
+
icon: z.string().optional()
|
|
84
102
|
});
|
|
85
103
|
|
|
86
104
|
// src/schemas/helpers/tools/categorize-tools.helper.ts
|
|
@@ -535,16 +553,30 @@ var ExtractedFactSchema = z.object({
|
|
|
535
553
|
text: z.string(),
|
|
536
554
|
/**
|
|
537
555
|
* The lowercase entity the fact is about (default `user`; a person,
|
|
538
|
-
* product, or project name)
|
|
556
|
+
* product, or project name) — the constellation's HUB tier: singular,
|
|
557
|
+
* specific, stable. Maintenance adjudication only ever compares
|
|
539
558
|
* facts about the SAME subject.
|
|
540
559
|
*/
|
|
541
560
|
subject: z.string().optional(),
|
|
542
561
|
/**
|
|
543
562
|
* One broad lowercase PLURAL family label for THIS fact (e.g. `stocks`,
|
|
544
|
-
* `pets`, `games`) —
|
|
545
|
-
*
|
|
563
|
+
* `pets`, `games`) — the constellation's CLUSTER tier. Inherits the
|
|
564
|
+
* turn-side category when omitted. Never
|
|
565
|
+
* a specific entity, product, company, or game title. Persona/roleplay or
|
|
566
|
+
* fictional content classifies by its real-world medium (a TV persona's
|
|
567
|
+
* biography belongs under `shows`), never by in-universe domains (`family`,
|
|
568
|
+
* `education`, `business` describe reality, not an invented life).
|
|
546
569
|
*/
|
|
547
570
|
category: z.string().optional(),
|
|
571
|
+
/**
|
|
572
|
+
* One lowercase PLURAL sub-family label narrowing THIS fact's category
|
|
573
|
+
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
574
|
+
* constellation's COMMUNITY tier, one level below the cluster. Inherits the
|
|
575
|
+
* turn-side community when omitted; omit when no sub-family applies. Never
|
|
576
|
+
* a specific entity, product, or title — a show/work title like
|
|
577
|
+
* `breaking-bad` is a tag or hub, never a community.
|
|
578
|
+
*/
|
|
579
|
+
community: z.string().optional(),
|
|
548
580
|
/** What kind of durable thing this is (see FACT_KINDS). */
|
|
549
581
|
kind: z.enum(FACT_KINDS),
|
|
550
582
|
/** Whether a newer statement is expected to replace this one (see FACT_STABILITIES). */
|
|
@@ -567,14 +599,27 @@ var ExtractionSchema = z.object({
|
|
|
567
599
|
tags: z.array(z.string()),
|
|
568
600
|
/**
|
|
569
601
|
* One broad lowercase PLURAL family label for the whole turn-side (e.g.
|
|
570
|
-
* `stocks`, `pets`, `games`) —
|
|
571
|
-
*
|
|
572
|
-
* passes, and backstops facts that omit their own `category`. Never a
|
|
602
|
+
* `stocks`, `pets`, `games`) — the constellation's CLUSTER tier. Groups
|
|
603
|
+
* the narrow tags into one topic family, powers the relink job's
|
|
604
|
+
* per-category passes, and backstops facts that omit their own `category`. Never a
|
|
573
605
|
* specific entity, product, company, or game title: `amd` belongs under
|
|
574
|
-
* `stocks`; `stellar blade` belongs under `games`.
|
|
606
|
+
* `stocks`; `stellar blade` belongs under `games`. Persona/roleplay or
|
|
607
|
+
* fictional content classifies by its real-world medium (e.g. `shows`
|
|
608
|
+
* for a TV persona), never by in-universe domains (`family`, `education`,
|
|
609
|
+
* `business` describe reality, not an invented life). Optional: a turn with
|
|
575
610
|
* nothing durable may omit it.
|
|
576
611
|
*/
|
|
577
|
-
category: z.string().optional()
|
|
612
|
+
category: z.string().optional(),
|
|
613
|
+
/**
|
|
614
|
+
* One lowercase PLURAL sub-family label narrowing the turn-side category
|
|
615
|
+
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
616
|
+
* constellation's COMMUNITY tier: a genre, project family, or domain branch
|
|
617
|
+
* one level below the cluster. Backstops facts that omit their own
|
|
618
|
+
* `community`. Optional: omit it when no sub-family applies. Never a
|
|
619
|
+
* specific entity, product, or title — a show/work title like
|
|
620
|
+
* `breaking-bad` is a tag or hub, never a community.
|
|
621
|
+
*/
|
|
622
|
+
community: z.string().optional()
|
|
578
623
|
});
|
|
579
624
|
var nullishText = z.string().nullish();
|
|
580
625
|
var nullishTopics = z.array(z.string()).nullish();
|
|
@@ -849,6 +894,114 @@ var ResearchTriageDecisionSchema = z.object({
|
|
|
849
894
|
var ResearchTriageSchema = z.object({
|
|
850
895
|
decisions: z.array(ResearchTriageDecisionSchema).max(50)
|
|
851
896
|
});
|
|
897
|
+
|
|
898
|
+
// src/schemas/memory/taxonomy-icons.constant.ts
|
|
899
|
+
var TAXONOMY_ICON_ALLOWLIST = [
|
|
900
|
+
"activity",
|
|
901
|
+
"plane",
|
|
902
|
+
"anchor",
|
|
903
|
+
"apple",
|
|
904
|
+
"archive",
|
|
905
|
+
"atom",
|
|
906
|
+
"banknote",
|
|
907
|
+
"bike",
|
|
908
|
+
"bird",
|
|
909
|
+
"bitcoin",
|
|
910
|
+
"book",
|
|
911
|
+
"book-open",
|
|
912
|
+
"bot",
|
|
913
|
+
"brain",
|
|
914
|
+
"briefcase",
|
|
915
|
+
"brush",
|
|
916
|
+
"bug",
|
|
917
|
+
"building",
|
|
918
|
+
"cake",
|
|
919
|
+
"calculator",
|
|
920
|
+
"calendar",
|
|
921
|
+
"camera",
|
|
922
|
+
"car",
|
|
923
|
+
"cat",
|
|
924
|
+
"chart-line",
|
|
925
|
+
"chef-hat",
|
|
926
|
+
"clapperboard",
|
|
927
|
+
"cloud",
|
|
928
|
+
"code",
|
|
929
|
+
"coffee",
|
|
930
|
+
"cog",
|
|
931
|
+
"coins",
|
|
932
|
+
"compass",
|
|
933
|
+
"contact",
|
|
934
|
+
"cpu",
|
|
935
|
+
"credit-card",
|
|
936
|
+
"dumbbell",
|
|
937
|
+
"factory",
|
|
938
|
+
"file-text",
|
|
939
|
+
"film",
|
|
940
|
+
"fish",
|
|
941
|
+
"flag",
|
|
942
|
+
"flask-conical",
|
|
943
|
+
"flower-2",
|
|
944
|
+
"volleyball",
|
|
945
|
+
"gamepad-2",
|
|
946
|
+
"gem",
|
|
947
|
+
"gift",
|
|
948
|
+
"globe",
|
|
949
|
+
"graduation-cap",
|
|
950
|
+
"guitar",
|
|
951
|
+
"hammer",
|
|
952
|
+
"handshake",
|
|
953
|
+
"headphones",
|
|
954
|
+
"heart-pulse",
|
|
955
|
+
"house",
|
|
956
|
+
"hospital",
|
|
957
|
+
"key",
|
|
958
|
+
"landmark",
|
|
959
|
+
"laptop",
|
|
960
|
+
"leaf",
|
|
961
|
+
"lightbulb",
|
|
962
|
+
"map-pin",
|
|
963
|
+
"medal",
|
|
964
|
+
"mic",
|
|
965
|
+
"microscope",
|
|
966
|
+
"mountain",
|
|
967
|
+
"music",
|
|
968
|
+
"newspaper",
|
|
969
|
+
"package",
|
|
970
|
+
"palette",
|
|
971
|
+
"paw-print",
|
|
972
|
+
"phone",
|
|
973
|
+
"piggy-bank",
|
|
974
|
+
"rocket",
|
|
975
|
+
"scale",
|
|
976
|
+
"server",
|
|
977
|
+
"shield",
|
|
978
|
+
"ship",
|
|
979
|
+
"shirt",
|
|
980
|
+
"shopping-bag",
|
|
981
|
+
"sprout",
|
|
982
|
+
"star",
|
|
983
|
+
"stethoscope",
|
|
984
|
+
"sun",
|
|
985
|
+
"trophy",
|
|
986
|
+
"truck",
|
|
987
|
+
"tv",
|
|
988
|
+
"umbrella",
|
|
989
|
+
"utensils",
|
|
990
|
+
"wallet",
|
|
991
|
+
"wifi",
|
|
992
|
+
"wrench",
|
|
993
|
+
"zap"
|
|
994
|
+
];
|
|
995
|
+
var TaxonomyPairVerdictSchema = z.object({
|
|
996
|
+
/**
|
|
997
|
+
* `same` — the two labels name the same concept (a wording/casing/plural
|
|
998
|
+
* variant) and merge. `distinct` — genuinely different concepts that only
|
|
999
|
+
* look alike; keep both. When in doubt: DISTINCT.
|
|
1000
|
+
*/
|
|
1001
|
+
verdict: z.enum(["same", "distinct"]),
|
|
1002
|
+
/** One short sentence justifying the verdict (audit trail). */
|
|
1003
|
+
reason: z.string().optional()
|
|
1004
|
+
});
|
|
852
1005
|
var cardSchema = z.object(
|
|
853
1006
|
{
|
|
854
1007
|
url: safeUrl({ message: "cards entries must have a valid url" }),
|
|
@@ -1229,4 +1382,4 @@ var videolistSchema = z.object({
|
|
|
1229
1382
|
internationalCoverage: internationalCoverageSchema.optional()
|
|
1230
1383
|
});
|
|
1231
1384
|
|
|
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 };
|
|
1385
|
+
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 };
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -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 };
|
package/dist/tools/index.mjs
CHANGED
|
@@ -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"). Persona/roleplay or fictional content classifies by its real-world medium (a TV persona\u2019s biography \u2192 "shows"), never by in-universe domains ("family", "education", "business" describe reality, not an invented life). Always include it.'
|
|
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", "tv shows" under "shows" \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 \u2014 a show/work title like "breaking-bad" is a tag or hub, never a community.'
|
|
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`
|
|
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(
|
|
1710
|
-
const t =
|
|
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.
|
|
4
|
+
"version": "0.1.27",
|
|
5
5
|
"packageManager": "pnpm@11.25.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@mozilla/readability": "^0.6.0",
|
|
58
|
-
"@triplef/helpers": "^1.5.
|
|
58
|
+
"@triplef/helpers": "^1.5.6",
|
|
59
59
|
"linkedom": "^0.18.13",
|
|
60
60
|
"turndown": "^7.2.4"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"ai": "^7.0.
|
|
63
|
+
"ai": "^7.0.93",
|
|
64
64
|
"zod": "^4.5.4"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"globals": "^17.12.0",
|
|
86
86
|
"husky": "^9.1.7",
|
|
87
87
|
"jiti": "^2.7.0",
|
|
88
|
-
"lint-staged": "^17.
|
|
88
|
+
"lint-staged": "^17.5.0",
|
|
89
89
|
"npm-check-updates": "^23.1.0",
|
|
90
90
|
"prettier": "^3.9.6",
|
|
91
91
|
"rimraf": "^6.1.3",
|