@triplef/agent 1.0.7 → 1.0.8
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/{format-zod-shape.types-iJugcVmt.d.ts → format-zod-shape.types-pA32lgh8.d.ts} +8 -10
- package/dist/prompts/index.d.ts +3 -12
- package/dist/prompts/index.mjs +35 -104
- package/dist/schemas/index.d.ts +4 -5
- package/dist/schemas/index.mjs +12 -19
- package/dist/tools/index.d.ts +3 -51
- package/dist/tools/index.mjs +3 -85
- package/package.json +11 -11
|
@@ -4,9 +4,9 @@ declare const VARIANT_NAMES: readonly ["grayscale", "denoised", "sharpened", "cl
|
|
|
4
4
|
type VariantName = (typeof VARIANT_NAMES)[number];
|
|
5
5
|
declare const TOOL_DESCRIPTIONS: Record<string, string>;
|
|
6
6
|
declare const BROWSER_TOOL_NAMES: readonly ["browser_navigate", "browser_navigate_back", "browser_snapshot", "browser_click", "browser_type", "browser_fill_form", "browser_select_option", "browser_press_key", "browser_wait_for", "browser_take_screenshot", "browser_tabs", "browser_console_messages", "browser_network_requests", "browser_verify_element_visible", "browser_verify_text_visible"];
|
|
7
|
-
declare const MEMORY_TOOL_NAMES: readonly ["memory-partition-
|
|
7
|
+
declare const MEMORY_TOOL_NAMES: readonly ["memory-partition-recall", "memory-partition-delete", "memory-cognition-delete", "memory-cognition-forget"];
|
|
8
8
|
declare const ENCYCLOPEDIA_TOOL_NAMES: readonly ["encyclopedia-search", "encyclopedia-read"];
|
|
9
|
-
declare const TOOL_NAMES: readonly ["webFetch", "brightDataWebSearch", "brightDataImageSearch", "brightDataNewsSearch", "brightDataPlacesSearch", "brightDataShoppingSearch", "brightDataVideoSearch", "brightDataWebpageScrape", "serperWebSearch", "serperImageSearch", "serperNewsSearch", "serperPlacesSearch", "serperShoppingSearch", "serperBusinessReviewsSearch", "serperVideoSearch", "serperWebpageScrape", "youtubeVideoSearch", "eodhdSearch", "eodhdQuote", "eodhdHistory", "eodhdTechnical", "eodhdIntraday", "eodhdNews", "eodhdFundamentals", "requestGrayscale", "requestDenoised", "requestSharpened", "requestClahe", "memory-partition-
|
|
9
|
+
declare const TOOL_NAMES: readonly ["webFetch", "brightDataWebSearch", "brightDataImageSearch", "brightDataNewsSearch", "brightDataPlacesSearch", "brightDataShoppingSearch", "brightDataVideoSearch", "brightDataWebpageScrape", "serperWebSearch", "serperImageSearch", "serperNewsSearch", "serperPlacesSearch", "serperShoppingSearch", "serperBusinessReviewsSearch", "serperVideoSearch", "serperWebpageScrape", "youtubeVideoSearch", "eodhdSearch", "eodhdQuote", "eodhdHistory", "eodhdTechnical", "eodhdIntraday", "eodhdNews", "eodhdFundamentals", "requestGrayscale", "requestDenoised", "requestSharpened", "requestClahe", "memory-partition-recall", "memory-partition-delete", "memory-cognition-forget", "browser_navigate", "browser_navigate_back", "browser_snapshot", "browser_click", "browser_type", "browser_fill_form", "browser_select_option", "browser_press_key", "browser_wait_for", "browser_take_screenshot", "browser_tabs", "browser_console_messages", "browser_network_requests", "browser_verify_element_visible", "browser_verify_text_visible"];
|
|
10
10
|
type ToolName = (typeof TOOL_NAMES)[number];
|
|
11
11
|
|
|
12
12
|
declare const DEFAULT_VARIANT_ID = "default";
|
|
@@ -17,21 +17,21 @@ type ImageTaskTemplate = (typeof IMAGE_TASK_TEMPLATES)[number];
|
|
|
17
17
|
declare function isImageTaskTemplate(template: string): template is ImageTaskTemplate;
|
|
18
18
|
declare const IntentSchema: z.ZodObject<{
|
|
19
19
|
template: z.ZodEnum<{
|
|
20
|
-
text: "text";
|
|
21
|
-
summary: "summary";
|
|
22
20
|
article: "article";
|
|
23
|
-
evaluation: "evaluation";
|
|
24
|
-
merge: "merge";
|
|
25
21
|
news: "news";
|
|
26
|
-
stockmarketitem: "stockmarketitem";
|
|
27
|
-
stockmarketlist: "stockmarketlist";
|
|
28
22
|
describe: "describe";
|
|
29
23
|
compare: "compare";
|
|
30
24
|
ocr: "ocr";
|
|
25
|
+
summary: "summary";
|
|
26
|
+
evaluation: "evaluation";
|
|
31
27
|
product: "product";
|
|
32
28
|
shoplist: "shoplist";
|
|
33
29
|
imagelist: "imagelist";
|
|
34
30
|
videolist: "videolist";
|
|
31
|
+
stockmarketitem: "stockmarketitem";
|
|
32
|
+
stockmarketlist: "stockmarketlist";
|
|
33
|
+
merge: "merge";
|
|
34
|
+
text: "text";
|
|
35
35
|
}>;
|
|
36
36
|
prompt: z.ZodDefault<z.ZodString>;
|
|
37
37
|
tools: z.ZodArray<z.ZodEnum<{
|
|
@@ -78,10 +78,8 @@ declare const IntentSchema: z.ZodObject<{
|
|
|
78
78
|
requestDenoised: "requestDenoised";
|
|
79
79
|
requestSharpened: "requestSharpened";
|
|
80
80
|
requestClahe: "requestClahe";
|
|
81
|
-
"memory-partition-remember": "memory-partition-remember";
|
|
82
81
|
"memory-partition-recall": "memory-partition-recall";
|
|
83
82
|
"memory-partition-delete": "memory-partition-delete";
|
|
84
|
-
"memory-cognition-remember": "memory-cognition-remember";
|
|
85
83
|
"memory-cognition-forget": "memory-cognition-forget";
|
|
86
84
|
}>>;
|
|
87
85
|
getDate: z.ZodDefault<z.ZodBoolean>;
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as VariantName, I as IntentResult, T as TemplateName, F as FormatZodShapeOptions } from '../format-zod-shape.types-
|
|
2
|
-
export { D as DEFAULT_VARIANT_ID } from '../format-zod-shape.types-
|
|
1
|
+
import { V as VariantName, I as IntentResult, T as TemplateName, F as FormatZodShapeOptions } from '../format-zod-shape.types-pA32lgh8.js';
|
|
2
|
+
export { D as DEFAULT_VARIANT_ID } from '../format-zod-shape.types-pA32lgh8.js';
|
|
3
3
|
import { M as MemoryPoint } from '../memory-point.model-C4wvvjAY.js';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import { z, ZodTypeAny, ZodType } from 'zod';
|
|
@@ -219,15 +219,6 @@ declare function buildMemoryProfilePrompt(params: {
|
|
|
219
219
|
maxPayloadChars?: number;
|
|
220
220
|
}): string;
|
|
221
221
|
|
|
222
|
-
declare const MEMORY_WRITE_INSTRUCTIONS = "MEMORY WRITE JOB \u2014 one purpose: decide whether THIS turn yielded anything worth persisting, and store it in the correct lane via the memory-partition-remember or memory-cognition-remember tool.\n\nTwo lanes, never confused:\n- memory-partition = the OBJECTIVE fact store: external-world facts, factual records, project details, and events the user stated, subjects gathered this turn, or facts the user asked you to remember.\n- memory-cognition = the SUBJECTIVE profile store: every preference, interest, trait, or internal state of the user (stated or inferred) \u2014 YOUR understanding of the user, persona learnings included.\n\nYou receive:\n- USER REQUEST: what the user asked.\n- PRIOR MEMORY: facts already stored for this user (may be empty).\n- PROBED THIS TURN: what memory-partition-recall already surfaced for this turn (may be empty) \u2014 already known, never re-store.\n- GATHERED DATA: summarized tool results from this turn (web searches, lookups).\n\nStore into the PARTITION lane (call memory-partition-remember) only when it is durable, objective, and user-specific:\n- A factual record the user states or asks you to track (contact info, a decision, a project detail, an event, their setup \u2014 however phrased, any language).\n- Knowledge about a subject the user cares about that was gathered this turn and extends what is already in PRIOR MEMORY.\n\nROUTING CONSTRAINT (absolute): extract ONLY objective, external facts to the partition. You MUST NOT store user preferences, behavioral traits, or internal states there (\"the user likes\u2026\", \"the user is interested in\u2026\", \"the user prefers\u2026\"). All user profile and persona data is deferred to the cognition tier.\n\nStore into the COGNITION lane (call memory-cognition-remember) whenever the turn yields SUBJECTIVE user data, stated or derived:\n- A preference or interest the user states outright (favorite X, a like or dislike, a style choice) \u2014 stated preferences live HERE, never in the partition.\n- An inferred trait, a standing interest, a working nuance, or a connection between facts the turn supports.\n- Never an objective fact \u2014 those belong in the partition lane.\n\nSTORAGE MECHANICS \u2014 how your memory works (write for the retriever):\n- Each stored record is embedded as a whole AND matched sentence-by-sentence at recall time (multi-variant retrieval). One self-contained fact per call; a single long, dense sentence is fine, but lead with the subject (\"Sam's phone number is 555-1234\", never \"His number is \u2026\").\n- Restating a record verbatim OVERWRITES it in place \u2014 updates are restatements of the full corrected statement, not diffs.\n- tags are the ONLY topic-filter vocabulary at recall \u2014 reuse stable, lowercase topic labels (partition lane only). Tags are NARROW and specific: entity names, product names, game titles (\"amd\", \"stellar blade\", \"stellar blade blood rain\").\n- The macro-taxonomy routes a fact into its family hierarchy (partition lane only), top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE (the NODE is the stored record itself \u2014 never named):\n - category (CLUSTER): ONE lowercase PLURAL family noun \u2014 stocks, games, pets, work, health, finance, contacts \u2026\n - community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category (\"survival games\" under \"games\", \"tv shows\" under \"shows\"); omit when no sub-family applies.\n - subject (HUB): the lowercase SINGULAR main subject entity the fact is about (\"project zomboid\", \"amd\", \"sam\") \u2014 a specific name, never pluralized; always include when the fact is about a specific entity.\n A category or community is NEVER a specific entity, product, company, or game title: \"amd\" is a subject under the category \"stocks\"; \"stellar blade\" is a subject under the category \"games\"; a show/work title like \"breaking-bad\" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.\n- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category \"shows\", community \"tv shows\", hub the show's title or the persona name); never \"family\", \"education\", \"business\", or \"science\" for invented content.\n\nTAXONOMY PROBING (pick first, create if necessary): before naming a tier label you are not certain exists, call memory-taxonomy-probe top-down \u2014 cluster \u2192 community \u2192 hub \u2192 node \u2014 and ADOPT a returned candidate by naming it VERBATIM in the remember call (its id becomes the next probe's parentId). CREATE a new label only when every candidate misses the meaning \u2014 then follow the phrasing rules (plural family/sub-family, singular hub, singular node aspect) and optionally pass an \"icon\" from the curated set for the label you create. The known-vocabulary section below already lists likely fits; probing confirms them or finds better ones.\n\nDo NOT store:\n- Public facts merely fetched this turn that do not relate to the user (e.g. generic web results).\n- Anything already covered by PRIOR MEMORY or PROBED THIS TURN \u2014 extend or update it via the remember call; do not repeat.\n- Tool artifacts: URLs, search scores, image metadata, raw JSON keys.\n- Inferred, assumed, or extrapolated details about the user that neither their words nor GATHERED DATA support \u2014 if the user did not state it (or clearly imply it), it is not memory; when in doubt, answer \"none\".\n\nRules:\n- Each remember call stores ONE self-contained statement (stand-alone, understandable weeks later without this conversation's context).\n- Call each remember tool once per distinct durable item \u2014 no more.\n- If nothing durable surfaced, produce a one-word text answer (\"none\") and make NO tool call. An empty memory write is a correct outcome, never a failure.";
|
|
223
|
-
declare function buildMemoryWritePrompt(params: {
|
|
224
|
-
userRequest: string;
|
|
225
|
-
priorMemory?: string;
|
|
226
|
-
probedMemory?: string;
|
|
227
|
-
gathered?: string;
|
|
228
|
-
vocabulary?: TaxonomyVocabulary;
|
|
229
|
-
}): string;
|
|
230
|
-
|
|
231
222
|
declare const RESEARCH_FRICTION_QUERY_INSTRUCTIONS: string;
|
|
232
223
|
declare function buildResearchFrictionQueryPrompt(contests: Array<{
|
|
233
224
|
id: string;
|
|
@@ -426,4 +417,4 @@ declare const verdictSpineSnippet: TemplateSnippet;
|
|
|
426
417
|
|
|
427
418
|
declare const videoGallerySnippet: TemplateSnippet;
|
|
428
419
|
|
|
429
|
-
export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, type ContentSystemPromptParams, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, ENCYCLOPEDIA_INGEST_TRIAGE_INSTRUCTIONS, type ExtractionSourceRole, FINAL_REMINDER, FRICTION_INSTRUCTIONS, type FrictionFact, HISTORY_URLS_RULES, IMAGELIST_INSTRUCTIONS, IMAGE_TASK_RULE, INTERNATIONAL_COVERAGE_INSTRUCTIONS, ITEM_SHAPES, JSON_RULES, MEDIA_COUNTS, MEDIA_RULES, MEMORY_CLUSTER_INSTRUCTIONS, MEMORY_CONSOLIDATE_INSTRUCTIONS, MEMORY_PROFILE_INSTRUCTIONS,
|
|
420
|
+
export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, type ContentSystemPromptParams, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, ENCYCLOPEDIA_INGEST_TRIAGE_INSTRUCTIONS, type ExtractionSourceRole, FINAL_REMINDER, FRICTION_INSTRUCTIONS, type FrictionFact, HISTORY_URLS_RULES, IMAGELIST_INSTRUCTIONS, IMAGE_TASK_RULE, INTERNATIONAL_COVERAGE_INSTRUCTIONS, ITEM_SHAPES, JSON_RULES, MEDIA_COUNTS, MEDIA_RULES, MEMORY_CLUSTER_INSTRUCTIONS, MEMORY_CONSOLIDATE_INSTRUCTIONS, MEMORY_PROFILE_INSTRUCTIONS, MERGE_MEDIA_RULES, MERGE_TOPIC_RULE, MULTIMODAL_POLICY, NOISE_RULES, OCR_INSTRUCTIONS, OCR_VERBATIM_INSTRUCTIONS, PRECEDENCE_RULES, PRODUCT_INSTRUCTIONS, RESEARCH_FRICTION_QUERY_INSTRUCTIONS, RESEARCH_TRIAGE_INSTRUCTIONS, RESPONSE_LAYOUTS, type ResponseLayout, SECURITY_RULES, SHOPLIST_INSTRUCTIONS, SNIPPET_TEMPLATE_PRESETS, SOURCE_TRUTH_RULES, SOURCE_VOICE_RULES, STOCKMARKET_ITEM_INSTRUCTIONS, STOCKMARKET_LIST_INSTRUCTIONS, SUMMARY_INSTRUCTIONS, type SnippetTemplatePreset, type SourcePolicyConfig, type StructuredPromptTemplate, TAXONOMY_RECONCILE_INSTRUCTIONS, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TEXT_OPINION_INSTRUCTIONS, TOOL_RESULTS_RULES, type TaxonomyVocabulary, type TemplateSnippet, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildCognitionProfileSection, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildConvictionSynthesisPrompt, buildCorrectionPrompt, buildDescribePdfPagePrompt, buildEncyclopediaClassifyPrompt, buildEncyclopediaIngestTriagePrompt, buildEnrichPrompt, buildExecuteLanguageInstruction, buildExtractionCorrectionPrompt, buildExtractionPrompt, buildFrictionPrompt, buildImageExecutePrompt, buildIntentCorrectionPrompt, buildIntentSelectionPrompt, buildLanguageRule, buildLayoutInstruction, buildLocalizationRule, buildMemoryProbeSection, buildMemoryProfilePrompt, 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
|
@@ -1341,10 +1341,8 @@ var TOOL_DESCRIPTIONS = {
|
|
|
1341
1341
|
requestDenoised: "Request a denoised (blurred) version of the images. Use when the original has noise, grain, or artifacts that hide details.",
|
|
1342
1342
|
requestSharpened: "Request a sharpened version of the images. Use when edges or fine details are blurry.",
|
|
1343
1343
|
requestClahe: "Request a CLAHE (contrast-enhanced) version of the images. Use when details are hidden in shadows or highlights.",
|
|
1344
|
-
"memory-partition-remember": `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, people, past topics), objective details they state (contact info, decisions, constraints), and objective facts they explicitly ask you to remember. Subjective user data (preferences, interests, traits, internal states) belongs to memory-cognition-remember, never here. Storing gathered knowledge is expected \u2014 do not wait for an explicit "remember" instruction.`,
|
|
1345
1344
|
"memory-partition-recall": "Retrieve from the user's fact partition (memory-partition) \u2014 things they told you in past conversations or asked you to remember. These are trusted user statements, not public facts; attribute them to the user and prefer them over web results for anything personal. Check this tool whenever a request touches a subject this user has cared about before.",
|
|
1346
1345
|
"memory-partition-delete": "Delete one exact fact record from the user's fact partition (memory-partition), quoted verbatim from a memory-partition-recall result. Never delete on a guess: recall first, delete the verbatim statement. Needs memory-partition-recall alongside it.",
|
|
1347
|
-
"memory-cognition-remember": "Store one insight into your cognition space (memory-cognition) \u2014 the exclusive store for subjective user data: preferences and interests the user states, inferred traits, standing interests, working nuances, connections between facts. Objective facts (contact info, decisions, project details, events) belong in memory-partition-remember.",
|
|
1348
1346
|
"memory-cognition-delete": 'Delete one targeted piece of your cognition space (memory-cognition): a verbatim stored insight (quoted from your cognition context) and/or one standing profile topic by its path ("likes.jazz"). The per-item forget for subjective user data; memory-cognition-forget is the whole-space wipe.',
|
|
1349
1347
|
"memory-cognition-forget": "Wipe your entire cognition space (memory-cognition) of the user \u2014 the structured profile AND every derived insight \u2014 only when the user asks you to forget your learned understanding of them or to start over. Fact records in the partition are untouched."
|
|
1350
1348
|
};
|
|
@@ -1394,10 +1392,8 @@ var TOOL_NAMES = [
|
|
|
1394
1392
|
"requestDenoised",
|
|
1395
1393
|
"requestSharpened",
|
|
1396
1394
|
"requestClahe",
|
|
1397
|
-
"memory-partition-remember",
|
|
1398
1395
|
"memory-partition-recall",
|
|
1399
1396
|
"memory-partition-delete",
|
|
1400
|
-
"memory-cognition-remember",
|
|
1401
1397
|
"memory-cognition-forget",
|
|
1402
1398
|
...BROWSER_TOOL_NAMES
|
|
1403
1399
|
];
|
|
@@ -2432,18 +2428,12 @@ ${CONTENT_LANGUAGE_RULE}`;
|
|
|
2432
2428
|
|
|
2433
2429
|
// src/prompts/harness/intent-selection/memory-rules.prompt.ts
|
|
2434
2430
|
var MEMORY_RULES = `MEMORY RULES (ABSOLUTE \u2014 when memory tools are enabled)
|
|
2435
|
-
Memory is an active growth loop, not a passive store: the model
|
|
2436
|
-
|
|
2437
|
-
without needing an explicit "remember" instruction. Two lanes, never confused:
|
|
2438
|
-
- memory-partition = the OBJECTIVE fact store: external-world facts, factual records, project details, and events the user stated, subjects gathered, or facts the user asked you to remember.
|
|
2431
|
+
Memory is an active growth loop, not a passive store: the model probes its memory on every turn, and an automatic background pass after each answered turn decides what (if anything) is worth persisting. Two lanes, never confused:
|
|
2432
|
+
- memory-partition = the OBJECTIVE fact store: external-world facts, factual records, project details, and events the user stated, subjects gathered, or facts the user asked to remember.
|
|
2439
2433
|
- memory-cognition = the SUBJECTIVE profile store: EVERY preference, interest, trait, or internal state of the user (stated or inferred) plus your persona learnings \u2014 subjective user data NEVER goes to the partition.
|
|
2434
|
+
- AUTOMATIC WRITE: persisting needs NO tool and no instruction from you \u2014 after every turn, a judged memory pass reads the turn with its gathered data and stores what is durably worth remembering (objective facts to the partition, preferences and derived understanding to cognition, explicit "remember this" asks included). Never claim you stored something during the turn, and never skip capturing because no write tool exists \u2014 the background pass has it covered.
|
|
2440
2435
|
- ALWAYS-PROBE: include the enabled memory-partition-recall tool in EVERY request as a cheap probe \u2014 regardless of topic, template, or how public the answer looks. The classifier cannot know whether the user has stored memory about the subject without checking; the probe is that check. memory-partition-recall returns any stored objective facts about the request's subject (saved vital data, contact details, decisions, notes, earlier statements) which the answer must include alongside public data, keeping the two sources distinct.
|
|
2441
|
-
-
|
|
2442
|
-
- FACT CAPTURE: when the user states an objective, durable detail (their contact info, their setup, a decision, a project fact), include the enabled memory-partition-remember tool so that fact is recorded.
|
|
2443
|
-
- PREFERENCE CAPTURE: when the user states a preference, interest, or trait about themselves (their favorite X, a like or dislike, a style choice \u2014 however phrased, any language), include the enabled memory-cognition-remember tool so that preference is recorded in the cognition lane \u2014 even when the user did not say "remember". Preferences never belong in the partition; noticing and storing them is expected behavior.
|
|
2444
|
-
- DERIVED UNDERSTANDING: when the turn reveals something you LEARN about the user that they did not state outright (an inferred trait, a standing interest, a connection between facts), include the enabled memory-cognition-remember tool so that understanding is recorded in the cognition lane \u2014 never in the partition lane.
|
|
2445
|
-
- EXPLICIT INSTRUCTION: when the user explicitly asks to remember, track, follow, or learn something (however phrased, in any language), act on it: an objective fact goes to the enabled memory-partition-remember tool, a preference or any other subjective profile datum ("remember that I like\u2026") goes to the enabled memory-cognition-remember tool.
|
|
2446
|
-
- UPDATE-LOOP: when memory-partition-recall shows the user already has facts on the subject, the remember call must UPDATE or EXTEND them, never duplicate or contradict. The turn pipeline also extracts notable facts automatically, so the remember tool is the explicit agentic write, not the only write path.
|
|
2436
|
+
- UPDATE-LOOP: when memory-partition-recall shows the user already has facts on the subject, the answer reflects them and the automatic write pass refines or extends them when the user restates or corrects a detail \u2014 restating a stored record updates it in place, never duplicates it.
|
|
2447
2437
|
- FORGET A FACT: when the user asks to forget, delete, or stop remembering a specific statement (however phrased, in any language), include the enabled memory-partition-recall AND memory-partition-delete tools \u2014 recall surfaces the verbatim stored statement, delete removes exactly that record. Deletion is exact: the model recalls first, then deletes the verbatim text (records have no ids).
|
|
2448
2438
|
- FORGET A PREFERENCE: when the user asks to forget a preference, an interest, or any other subjective profile datum ("forget that I like\u2026", however phrased, in any language), include the enabled memory-cognition-delete tool \u2014 it deletes one verbatim insight (quoted from your injected cognition context) and/or prunes one standing profile topic by its path ("likes.jazz"). Targeted and confirmable \u2014 no wipe involved.
|
|
2449
2439
|
- FORGET UNDERSTANDING: when the user asks to forget what you know or have LEARNED about them (preferences, traits, persona \u2014 not an objective fact), include the enabled memory-cognition-forget tool \u2014 it wipes your whole cognition space (the structured profile AND every derived insight), the AI's own accumulated model of the user. For a single preference or insight, memory-cognition-delete is the targeted path; the wipe is for starting over. Full fact-store wipes stay a settings (settings) action, never a tool call.
|
|
@@ -3516,66 +3506,6 @@ ${limitText(priorFacts, params.maxPayloadChars)}`
|
|
|
3516
3506
|
return parts.join("\n\n");
|
|
3517
3507
|
}
|
|
3518
3508
|
var MEMORY_PROFILE_VERDICT = "Decide: output the JSON object now \u2014 the profile patch (or null when unchanged), any new insights, and an optional episode.";
|
|
3519
|
-
|
|
3520
|
-
// src/prompts/memory/memory-write-prompt.constant.ts
|
|
3521
|
-
var 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.
|
|
3522
|
-
|
|
3523
|
-
Two lanes, never confused:
|
|
3524
|
-
- 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.
|
|
3525
|
-
- 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.
|
|
3526
|
-
|
|
3527
|
-
You receive:
|
|
3528
|
-
- USER REQUEST: what the user asked.
|
|
3529
|
-
- PRIOR MEMORY: facts already stored for this user (may be empty).
|
|
3530
|
-
- PROBED THIS TURN: what memory-partition-recall already surfaced for this turn (may be empty) \u2014 already known, never re-store.
|
|
3531
|
-
- GATHERED DATA: summarized tool results from this turn (web searches, lookups).
|
|
3532
|
-
|
|
3533
|
-
Store into the PARTITION lane (call memory-partition-remember) only when it is durable, objective, and user-specific:
|
|
3534
|
-
- 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).
|
|
3535
|
-
- Knowledge about a subject the user cares about that was gathered this turn and extends what is already in PRIOR MEMORY.
|
|
3536
|
-
|
|
3537
|
-
ROUTING 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.
|
|
3538
|
-
|
|
3539
|
-
Store into the COGNITION lane (call memory-cognition-remember) whenever the turn yields SUBJECTIVE user data, stated or derived:
|
|
3540
|
-
- 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.
|
|
3541
|
-
- An inferred trait, a standing interest, a working nuance, or a connection between facts the turn supports.
|
|
3542
|
-
- Never an objective fact \u2014 those belong in the partition lane.
|
|
3543
|
-
|
|
3544
|
-
STORAGE MECHANICS \u2014 how your memory works (write for the retriever):
|
|
3545
|
-
- 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").
|
|
3546
|
-
- Restating a record verbatim OVERWRITES it in place \u2014 updates are restatements of the full corrected statement, not diffs.
|
|
3547
|
-
- 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").
|
|
3548
|
-
- 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):
|
|
3549
|
-
- category (CLUSTER): ONE lowercase PLURAL family noun \u2014 stocks, games, pets, work, health, finance, contacts \u2026
|
|
3550
|
-
- community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category ("survival games" under "games", "tv shows" under "shows"); omit when no sub-family applies.
|
|
3551
|
-
- 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.
|
|
3552
|
-
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.
|
|
3553
|
-
- 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.
|
|
3554
|
-
|
|
3555
|
-
TAXONOMY PROBING (pick first, create if necessary): before naming a tier label you are not certain exists, call memory-taxonomy-probe top-down \u2014 cluster \u2192 community \u2192 hub \u2192 node \u2014 and ADOPT a returned candidate by naming it VERBATIM in the remember call (its id becomes the next probe's parentId). CREATE a new label only when every candidate misses the meaning \u2014 then follow the phrasing rules (plural family/sub-family, singular hub, singular node aspect) and optionally pass an "icon" from the curated set for the label you create. The known-vocabulary section below already lists likely fits; probing confirms them or finds better ones.
|
|
3556
|
-
|
|
3557
|
-
Do NOT store:
|
|
3558
|
-
- Public facts merely fetched this turn that do not relate to the user (e.g. generic web results).
|
|
3559
|
-
- Anything already covered by PRIOR MEMORY or PROBED THIS TURN \u2014 extend or update it via the remember call; do not repeat.
|
|
3560
|
-
- Tool artifacts: URLs, search scores, image metadata, raw JSON keys.
|
|
3561
|
-
- 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".
|
|
3562
|
-
|
|
3563
|
-
Rules:
|
|
3564
|
-
- Each remember call stores ONE self-contained statement (stand-alone, understandable weeks later without this conversation's context).
|
|
3565
|
-
- Call each remember tool once per distinct durable item \u2014 no more.
|
|
3566
|
-
- 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.`;
|
|
3567
|
-
function buildMemoryWritePrompt(params) {
|
|
3568
|
-
const vocabulary = buildVocabularySection(params.vocabulary);
|
|
3569
|
-
return [
|
|
3570
|
-
`USER REQUEST: ${params.userRequest}`,
|
|
3571
|
-
`PRIOR MEMORY: ${params.priorMemory?.trim() || "(none stored yet)"}`,
|
|
3572
|
-
`PROBED THIS TURN: ${params.probedMemory?.trim() || "(nothing probed this turn)"}`,
|
|
3573
|
-
`GATHERED DATA: ${params.gathered?.trim() || "(no tools produced data this turn)"}`,
|
|
3574
|
-
vocabulary,
|
|
3575
|
-
MEMORY_WRITE_VERDICT
|
|
3576
|
-
].filter(Boolean).join("\n\n");
|
|
3577
|
-
}
|
|
3578
|
-
var MEMORY_WRITE_VERDICT = 'Decide: store each durable objective fact with one memory-partition-remember call, each subjective user datum (stated or derived) with one memory-cognition-remember call, or answer "none" if the turn surfaced nothing durable about this user.';
|
|
3579
3509
|
var ResearchFrictionQueryDecisionSchema = z.object({
|
|
3580
3510
|
/** The friction id — echoed back so the worker maps the verdict to its candidate. */
|
|
3581
3511
|
id: z.string(),
|
|
@@ -3707,16 +3637,7 @@ RULES:
|
|
|
3707
3637
|
- No markdown code fences, no explanations, preamble, or postscript.`
|
|
3708
3638
|
});
|
|
3709
3639
|
}
|
|
3710
|
-
var FACT_KINDS = [
|
|
3711
|
-
"preference",
|
|
3712
|
-
"decision",
|
|
3713
|
-
"state",
|
|
3714
|
-
"contact",
|
|
3715
|
-
"project",
|
|
3716
|
-
"possession",
|
|
3717
|
-
"relationship",
|
|
3718
|
-
"fact"
|
|
3719
|
-
];
|
|
3640
|
+
var FACT_KINDS = ["decision", "state", "contact", "project", "possession", "relationship", "fact"];
|
|
3720
3641
|
var FACT_STABILITIES = ["durable", "volatile"];
|
|
3721
3642
|
var ExtractedFactSchema = z.object({
|
|
3722
3643
|
/**
|
|
@@ -3760,11 +3681,19 @@ var ExtractedFactSchema = z.object({
|
|
|
3760
3681
|
stability: z.enum(FACT_STABILITIES)
|
|
3761
3682
|
});
|
|
3762
3683
|
var ExtractionSchema = z.object({
|
|
3684
|
+
/**
|
|
3685
|
+
* The verdict, committed BEFORE any record is written: does this text
|
|
3686
|
+
* carry anything worth recalling in a later, unrelated conversation?
|
|
3687
|
+
* `false` is the default outcome for ordinary turns — greetings, answered
|
|
3688
|
+
* questions, one-off requests — and requires facts, tags, category, and
|
|
3689
|
+
* community to all be empty. `true` requires at least one fact.
|
|
3690
|
+
*/
|
|
3691
|
+
remember: z.boolean(),
|
|
3763
3692
|
/**
|
|
3764
3693
|
* Durable, self-contained facts worth remembering in a later, unrelated
|
|
3765
|
-
* conversation (
|
|
3766
|
-
*
|
|
3767
|
-
*
|
|
3694
|
+
* conversation (decisions, contact details, project facts, events), each
|
|
3695
|
+
* carrying its maintenance metadata (subject, category, kind, stability).
|
|
3696
|
+
* MUST be empty when `remember` is false, non-empty when it is true.
|
|
3768
3697
|
*/
|
|
3769
3698
|
facts: z.array(ExtractedFactSchema),
|
|
3770
3699
|
/**
|
|
@@ -3804,7 +3733,7 @@ var ExtractionSchema = z.object({
|
|
|
3804
3733
|
var USER_SOURCE_VOICE_RULES = `SOURCE VOICE: this extraction source is the USER's own message \u2014 statements in it are the user's voice and may be attributed to the user.`;
|
|
3805
3734
|
var ASSISTANT_SOURCE_VOICE_RULES = `SOURCE VOICE (absolute): this extraction source is the ASSISTANT's own generated answer \u2014 a flattened digest of its titles, verdicts, and findings \u2014 NOT the user's words.
|
|
3806
3735
|
- First-person statements, verdicts, scores, recommendations, and "my take" phrasing are the ASSISTANT's voice. NEVER attribute them to the user: no fact of the form "the user thinks / describes / wants / would / decided \u2026" may be drawn from this source.
|
|
3807
|
-
- The assistant's opinions, judgments, verdicts, and recommendations are NOT durable objective facts \u2014 never extract them. When the source only conveys the assistant's opinion, return
|
|
3736
|
+
- The assistant's opinions, judgments, verdicts, and recommendations are NOT durable objective facts \u2014 never extract them. When the source only conveys the assistant's opinion, return remember=false.
|
|
3808
3737
|
- Extract only objective, checkable world facts the answer asserts, with the subject ENTITY as the hub \u2014 never "user" as the subject of assistant-voice content.
|
|
3809
3738
|
- Statements about reception or coverage keep their true source ("available coverage of X notes \u2026"), never "the user";`;
|
|
3810
3739
|
function buildExtractionPrompt(vocabulary = {}, role = "user") {
|
|
@@ -3812,14 +3741,17 @@ function buildExtractionPrompt(vocabulary = {}, role = "user") {
|
|
|
3812
3741
|
return buildStructuredPrompt(ExtractionSchema, {
|
|
3813
3742
|
before: "OUTPUT FORMAT \u2014 output ONLY valid JSON matching this exact schema:",
|
|
3814
3743
|
after: `
|
|
3815
|
-
YOUR TASK \u2014 decide
|
|
3816
|
-
|
|
3817
|
-
-
|
|
3818
|
-
-
|
|
3819
|
-
-
|
|
3744
|
+
YOUR TASK \u2014 decide FIRST whether this text is worth long-term memory, then distill:
|
|
3745
|
+
- VERDICT FIRST (absolute): "remember" is the gate, and it comes first. Set remember=false whenever the text carries nothing worth recalling in a later, unrelated conversation \u2014 greetings, small talk, filler, questions that were merely answered, one-off requests. Most ordinary turns are remember=false. When remember=false, facts, tags, category, and community are ALL empty; remember=true REQUIRES at least one fact.
|
|
3746
|
+
- ONE-OFF REQUESTS ARE NEVER FACTS: a task the user asks the assistant to do right now ("find X", "play Y", "summarize Z") is the current request, not knowledge about anyone. Never emit facts of the form "the user wants to find / watch / buy / do \u2026" \u2014 from "find japanese dark trap music by katame on youtube" there is nothing to store, period. A STANDING preference or interest the request reveals ("the user is into japanese dark trap") is subjective user data \u2014 never emitted here either (see ROUTING BOUNDARY).
|
|
3747
|
+
- ROUTING BOUNDARY (absolute): this extraction feeds the memory partition \u2014 the OBJECTIVE fact store ONLY. Extract only objective, external-world facts and events: factual records, project details, decisions, states, possessions, contacts, relationships between people. You MUST NOT extract subjective user data \u2014 no preferences, likes/dislikes, interests, wants, behavioral traits, or internal states ("the user likes\u2026", "the user is interested in\u2026", "the user prefers\u2026"). All user profile and persona data is deferred to the cognition tier; when the turn reveals ONLY subjective user data, return remember=false.
|
|
3748
|
+
- What IS worth remembering: durable, objective information that remains useful in a later, unrelated conversation \u2014 decisions, contact details, project facts, technical constraints, events (e.g. "Sam's phone number is 555-1234", "The user is building a vector memory feature", "The payments service migrated to PostgreSQL in November").
|
|
3749
|
+
- DROP-BIAS (absolute): when in doubt whether a detail is durable, DROP it. A worthless record pollutes the fact store, the taxonomy, and every future recall; a detail that truly matters will be re-stated another day. Extracting nothing is always better than extracting noise.
|
|
3820
3750
|
- Facts must be self-contained \u2014 no "this"/"that" references; write them as third-person statements.
|
|
3821
3751
|
- 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").
|
|
3822
|
-
|
|
3752
|
+
${sourceVoiceRules}
|
|
3753
|
+
- GATHERED DATA (when the source text is followed by a "GATHERED DATA" section \u2014 this turn's tool results): durable knowledge about subjects the USER cares about may be distilled from it ("Katame is a japanese dark-trap producer releasing on YouTube" counts only when the turn shows the user tracks that artist). Never store tool artifacts \u2014 URLs, search scores, image metadata, raw JSON keys \u2014 and never store public trivia unrelated to the user's subjects.
|
|
3754
|
+
- ATTACHED FILES (when an "ATTACHED FILES" section lists this turn's uploads): distill what a file durably IS when the turn reveals it ("bauplan.pdf is the floor plan for the user's garage conversion") \u2014 never the mere act of uploading, never bare file metadata.
|
|
3823
3755
|
|
|
3824
3756
|
FACT METADATA \u2014 every fact object carries the fields the maintenance passes (consolidate/reflect/conviction) interpret. Labels place the fact in the macro-taxonomy, top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE \u2192 LEAF, where the LEAF is the fact's text itself and every tier above it is a NAMED label that narrows where it is filed. The chain is strict: a fact is emitted with ALL FOUR labels or not at all.
|
|
3825
3757
|
- CLUSTER (category): a broad PLURAL family noun ("games", "stocks", "pets").
|
|
@@ -3834,7 +3766,6 @@ Fields:
|
|
|
3834
3766
|
- category (required): ONE broad lowercase PLURAL family label for this fact \u2014 the CLUSTER tier \u2014 reusing the known vocabulary.
|
|
3835
3767
|
- community (required): ONE broad lowercase PLURAL sub-family narrowing the fact's category \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch \u2014 "survival-games" under "games").
|
|
3836
3768
|
- kind (required): what kind of durable thing it is:
|
|
3837
|
-
- preference \u2014 RESERVED, never emit: likes, dislikes, wants, and interests are subjective user data owned by the cognition tier (see ROUTING BOUNDARY)
|
|
3838
3769
|
- decision \u2014 a choice that was made (adoptions, migrations, purchases committed to)
|
|
3839
3770
|
- state \u2014 the CURRENT, changeable situation (lives in X, uses version Y, runs Z) \u2014 newer statements supersede these
|
|
3840
3771
|
- contact \u2014 contact details of a person (phone, email, address)
|
|
@@ -3843,21 +3774,21 @@ Fields:
|
|
|
3843
3774
|
- relationship \u2014 how people relate ("sam is the user's brother")
|
|
3844
3775
|
- fact \u2014 any other durable fact
|
|
3845
3776
|
- 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.
|
|
3846
|
-
- 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.
|
|
3847
|
-
- 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).
|
|
3848
|
-
- 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.
|
|
3849
|
-
- If nothing durable is found, return an empty facts array; tags may still label the topic when useful.
|
|
3777
|
+
- 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. Only when remember=true.
|
|
3778
|
+
- 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). Only when remember=true.
|
|
3779
|
+
- 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. Never a specific entity, product, or title \u2014 a show/work title like "breaking-bad" is a tag or hub, never a community. Only when remember=true.
|
|
3850
3780
|
${buildVocabularySection(vocabulary)}
|
|
3851
|
-
PRIOR MEMORY (when the
|
|
3781
|
+
PRIOR MEMORY (when the source text ends with an "ALREADY STORED IN MEMORY" section):
|
|
3852
3782
|
- That section lists facts already stored in YOUR long-term memory from prior turns. NEVER emit a fact already covered there.
|
|
3853
3783
|
- 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).
|
|
3854
3784
|
- A statement that flips or adds negation to a stored fact is NEW information \u2014 always emit it.
|
|
3855
|
-
- Everything not covered by the section is
|
|
3785
|
+
- Everything not covered by the section is judged as usual.
|
|
3856
3786
|
|
|
3857
3787
|
RULES:
|
|
3858
3788
|
- Return ONLY a single valid JSON object matching the exact schema above.
|
|
3789
|
+
- The "remember" boolean is always present and consistent with the output: false exactly when facts is empty, true exactly when it is not \u2014 and when false, tags, category, and community are empty too.
|
|
3859
3790
|
- No markdown code fences, no explanations, preamble, or postscript.
|
|
3860
|
-
- Never output undefined or null.
|
|
3791
|
+
- Never output undefined or null. The "remember" and "facts" keys are always present.
|
|
3861
3792
|
|
|
3862
3793
|
FINAL REMINDER:
|
|
3863
3794
|
- Output ONLY valid JSON matching the exact schema above. No markdown code fences, no explanations, preamble, or postscript.`
|
|
@@ -3869,7 +3800,7 @@ Error: ${error}
|
|
|
3869
3800
|
|
|
3870
3801
|
Return ONLY a single valid JSON object matching the extraction schema exactly:
|
|
3871
3802
|
${formatZodShape(ExtractionSchema)}
|
|
3872
|
-
All object keys must be quoted with double quotes. Per fact, "subject", "node", "category", and "community" are required alongside "kind" and "stability".
|
|
3803
|
+
All object keys must be quoted with double quotes. "remember" is always required and must be true exactly when facts is non-empty, false when it is empty. Per fact, "subject", "node", "category", and "community" are required alongside "kind" and "stability".
|
|
3873
3804
|
Do not add markdown code fences, explanations, placeholders, or extra text.
|
|
3874
3805
|
|
|
3875
3806
|
FINAL REMINDER:
|
|
@@ -3903,4 +3834,4 @@ Compose the response from the snippets below. Include every snippet you can subs
|
|
|
3903
3834
|
${parts.join("\n\n")}`;
|
|
3904
3835
|
}
|
|
3905
3836
|
|
|
3906
|
-
export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, DEFAULT_VARIANT_ID, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, ENCYCLOPEDIA_INGEST_TRIAGE_INSTRUCTIONS, FINAL_REMINDER, FRICTION_INSTRUCTIONS, HISTORY_URLS_RULES, IMAGELIST_INSTRUCTIONS, IMAGE_TASK_RULE, INTERNATIONAL_COVERAGE_INSTRUCTIONS, ITEM_SHAPES, JSON_RULES, MEDIA_COUNTS, MEDIA_RULES, MEMORY_CLUSTER_INSTRUCTIONS, MEMORY_CONSOLIDATE_INSTRUCTIONS, MEMORY_PROFILE_INSTRUCTIONS,
|
|
3837
|
+
export { COMMONMARK_FORMAT, COMPARE_INSTRUCTIONS, COMPARE_VISUAL_INSTRUCTIONS, CONVICTION_INSTRUCTIONS, DEFAULT_VARIANT_ID, DESCRIBE_CONCISE_INSTRUCTIONS, DESCRIBE_DETAILED_INSTRUCTIONS, DESCRIBE_INSTRUCTIONS, ENCYCLOPEDIA_INGEST_TRIAGE_INSTRUCTIONS, FINAL_REMINDER, FRICTION_INSTRUCTIONS, HISTORY_URLS_RULES, IMAGELIST_INSTRUCTIONS, IMAGE_TASK_RULE, INTERNATIONAL_COVERAGE_INSTRUCTIONS, ITEM_SHAPES, JSON_RULES, MEDIA_COUNTS, MEDIA_RULES, MEMORY_CLUSTER_INSTRUCTIONS, MEMORY_CONSOLIDATE_INSTRUCTIONS, MEMORY_PROFILE_INSTRUCTIONS, MERGE_MEDIA_RULES, MERGE_TOPIC_RULE, MULTIMODAL_POLICY, NOISE_RULES, OCR_INSTRUCTIONS, OCR_VERBATIM_INSTRUCTIONS, PRECEDENCE_RULES, PRODUCT_INSTRUCTIONS, RESEARCH_FRICTION_QUERY_INSTRUCTIONS, RESEARCH_TRIAGE_INSTRUCTIONS, RESPONSE_LAYOUTS, SECURITY_RULES, SHOPLIST_INSTRUCTIONS, SNIPPET_TEMPLATE_PRESETS, SOURCE_TRUTH_RULES, SOURCE_VOICE_RULES, STOCKMARKET_ITEM_INSTRUCTIONS, STOCKMARKET_LIST_INSTRUCTIONS, SUMMARY_INSTRUCTIONS, TAXONOMY_RECONCILE_INSTRUCTIONS, TEMPLATE_VARIANTS, TEXT_CODING_INSTRUCTIONS, TEXT_FAMILIARITY_INSTRUCTIONS, TEXT_INSTRUCTIONS, TEXT_OPINION_INSTRUCTIONS, TOOL_RESULTS_RULES, VIDEOLIST_INSTRUCTIONS, articlePreset, assessmentListsSnippet, authorMetaSnippet, bodyBriefSnippet, bodyExtensiveSnippet, buildBaseSystemPrompt, buildClarificationTranslationSystemPrompt, buildClarificationTranslationUserPrompt, buildClassifyTranscript, buildClusterSummaryPrompt, buildCognitionProfileSection, buildConsolidatePrompt, buildContentSystemPrompt, buildContextSummarySection, buildConvictionSynthesisPrompt, buildCorrectionPrompt, buildDescribePdfPagePrompt, buildEncyclopediaClassifyPrompt, buildEncyclopediaIngestTriagePrompt, buildEnrichPrompt, buildExecuteLanguageInstruction, buildExtractionCorrectionPrompt, buildExtractionPrompt, buildFrictionPrompt, buildImageExecutePrompt, buildIntentCorrectionPrompt, buildIntentSelectionPrompt, buildLanguageRule, buildLayoutInstruction, buildLocalizationRule, buildMemoryProbeSection, buildMemoryProfilePrompt, 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export { E as EncyclopediaDocumentInput, a as EncyclopediaDocumentResult, b as EncyclopediaSearchHit, c as EncyclopediaSearchInput } from '../encyclopedia-search.model-oFW8_rUT.js';
|
|
3
|
-
import { F as FormatZodShapeOptions } from '../format-zod-shape.types-
|
|
4
|
-
export { B as BROWSER_TOOL_NAMES, D as DEFAULT_VARIANT_ID, E as ENCYCLOPEDIA_TOOL_NAMES, a as IMAGE_TASK_TEMPLATES, b as ImageTaskTemplate, I as IntentResult, c as IntentSchema, M as MEMORY_TOOL_NAMES, d as TOOL_DESCRIPTIONS, e as TOOL_NAMES, T as TemplateName, f as ToolName, g as VARIANT_NAMES, V as VariantName, i as isImageTaskTemplate } from '../format-zod-shape.types-
|
|
3
|
+
import { F as FormatZodShapeOptions } from '../format-zod-shape.types-pA32lgh8.js';
|
|
4
|
+
export { B as BROWSER_TOOL_NAMES, D as DEFAULT_VARIANT_ID, E as ENCYCLOPEDIA_TOOL_NAMES, a as IMAGE_TASK_TEMPLATES, b as ImageTaskTemplate, I as IntentResult, c as IntentSchema, M as MEMORY_TOOL_NAMES, d as TOOL_DESCRIPTIONS, e as TOOL_NAMES, T as TemplateName, f as ToolName, g as VARIANT_NAMES, V as VariantName, i as isImageTaskTemplate } from '../format-zod-shape.types-pA32lgh8.js';
|
|
5
5
|
|
|
6
6
|
declare const BLOCKED_IMAGE_HOSTS: Set<string>;
|
|
7
7
|
|
|
@@ -244,7 +244,7 @@ declare const MemoryEnrichmentSchema: z.ZodObject<{
|
|
|
244
244
|
}, z.core.$strip>;
|
|
245
245
|
type MemoryEnrichment = z.infer<typeof MemoryEnrichmentSchema>;
|
|
246
246
|
|
|
247
|
-
declare const FACT_KINDS: readonly ["
|
|
247
|
+
declare const FACT_KINDS: readonly ["decision", "state", "contact", "project", "possession", "relationship", "fact"];
|
|
248
248
|
declare const FACT_STABILITIES: readonly ["durable", "volatile"];
|
|
249
249
|
declare const ExtractedFactSchema: z.ZodObject<{
|
|
250
250
|
text: z.ZodString;
|
|
@@ -253,7 +253,6 @@ declare const ExtractedFactSchema: z.ZodObject<{
|
|
|
253
253
|
category: z.ZodString;
|
|
254
254
|
community: z.ZodString;
|
|
255
255
|
kind: z.ZodEnum<{
|
|
256
|
-
preference: "preference";
|
|
257
256
|
decision: "decision";
|
|
258
257
|
state: "state";
|
|
259
258
|
contact: "contact";
|
|
@@ -269,6 +268,7 @@ declare const ExtractedFactSchema: z.ZodObject<{
|
|
|
269
268
|
}, z.core.$strip>;
|
|
270
269
|
type ExtractedFact = z.infer<typeof ExtractedFactSchema>;
|
|
271
270
|
declare const ExtractionSchema: z.ZodObject<{
|
|
271
|
+
remember: z.ZodBoolean;
|
|
272
272
|
facts: z.ZodArray<z.ZodObject<{
|
|
273
273
|
text: z.ZodString;
|
|
274
274
|
subject: z.ZodString;
|
|
@@ -276,7 +276,6 @@ declare const ExtractionSchema: z.ZodObject<{
|
|
|
276
276
|
category: z.ZodString;
|
|
277
277
|
community: z.ZodString;
|
|
278
278
|
kind: z.ZodEnum<{
|
|
279
|
-
preference: "preference";
|
|
280
279
|
decision: "decision";
|
|
281
280
|
state: "state";
|
|
282
281
|
contact: "contact";
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -172,10 +172,8 @@ var TOOL_DESCRIPTIONS = {
|
|
|
172
172
|
requestDenoised: "Request a denoised (blurred) version of the images. Use when the original has noise, grain, or artifacts that hide details.",
|
|
173
173
|
requestSharpened: "Request a sharpened version of the images. Use when edges or fine details are blurry.",
|
|
174
174
|
requestClahe: "Request a CLAHE (contrast-enhanced) version of the images. Use when details are hidden in shadows or highlights.",
|
|
175
|
-
"memory-partition-remember": `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, people, past topics), objective details they state (contact info, decisions, constraints), and objective facts they explicitly ask you to remember. Subjective user data (preferences, interests, traits, internal states) belongs to memory-cognition-remember, never here. Storing gathered knowledge is expected \u2014 do not wait for an explicit "remember" instruction.`,
|
|
176
175
|
"memory-partition-recall": "Retrieve from the user's fact partition (memory-partition) \u2014 things they told you in past conversations or asked you to remember. These are trusted user statements, not public facts; attribute them to the user and prefer them over web results for anything personal. Check this tool whenever a request touches a subject this user has cared about before.",
|
|
177
176
|
"memory-partition-delete": "Delete one exact fact record from the user's fact partition (memory-partition), quoted verbatim from a memory-partition-recall result. Never delete on a guess: recall first, delete the verbatim statement. Needs memory-partition-recall alongside it.",
|
|
178
|
-
"memory-cognition-remember": "Store one insight into your cognition space (memory-cognition) \u2014 the exclusive store for subjective user data: preferences and interests the user states, inferred traits, standing interests, working nuances, connections between facts. Objective facts (contact info, decisions, project details, events) belong in memory-partition-remember.",
|
|
179
177
|
"memory-cognition-delete": 'Delete one targeted piece of your cognition space (memory-cognition): a verbatim stored insight (quoted from your cognition context) and/or one standing profile topic by its path ("likes.jazz"). The per-item forget for subjective user data; memory-cognition-forget is the whole-space wipe.',
|
|
180
178
|
"memory-cognition-forget": "Wipe your entire cognition space (memory-cognition) of the user \u2014 the structured profile AND every derived insight \u2014 only when the user asks you to forget your learned understanding of them or to start over. Fact records in the partition are untouched."
|
|
181
179
|
};
|
|
@@ -197,10 +195,8 @@ var BROWSER_TOOL_NAMES = [
|
|
|
197
195
|
"browser_verify_text_visible"
|
|
198
196
|
];
|
|
199
197
|
var MEMORY_TOOL_NAMES = [
|
|
200
|
-
"memory-partition-remember",
|
|
201
198
|
"memory-partition-recall",
|
|
202
199
|
"memory-partition-delete",
|
|
203
|
-
"memory-cognition-remember",
|
|
204
200
|
"memory-cognition-delete",
|
|
205
201
|
"memory-cognition-forget"
|
|
206
202
|
];
|
|
@@ -234,10 +230,8 @@ var TOOL_NAMES = [
|
|
|
234
230
|
"requestDenoised",
|
|
235
231
|
"requestSharpened",
|
|
236
232
|
"requestClahe",
|
|
237
|
-
"memory-partition-remember",
|
|
238
233
|
"memory-partition-recall",
|
|
239
234
|
"memory-partition-delete",
|
|
240
|
-
"memory-cognition-remember",
|
|
241
235
|
"memory-cognition-forget",
|
|
242
236
|
...BROWSER_TOOL_NAMES
|
|
243
237
|
];
|
|
@@ -615,16 +609,7 @@ var MemoryEnrichmentSchema = z.object({
|
|
|
615
609
|
*/
|
|
616
610
|
tags: z.array(z.string())
|
|
617
611
|
});
|
|
618
|
-
var FACT_KINDS = [
|
|
619
|
-
"preference",
|
|
620
|
-
"decision",
|
|
621
|
-
"state",
|
|
622
|
-
"contact",
|
|
623
|
-
"project",
|
|
624
|
-
"possession",
|
|
625
|
-
"relationship",
|
|
626
|
-
"fact"
|
|
627
|
-
];
|
|
612
|
+
var FACT_KINDS = ["decision", "state", "contact", "project", "possession", "relationship", "fact"];
|
|
628
613
|
var FACT_STABILITIES = ["durable", "volatile"];
|
|
629
614
|
var ExtractedFactSchema = z.object({
|
|
630
615
|
/**
|
|
@@ -668,11 +653,19 @@ var ExtractedFactSchema = z.object({
|
|
|
668
653
|
stability: z.enum(FACT_STABILITIES)
|
|
669
654
|
});
|
|
670
655
|
var ExtractionSchema = z.object({
|
|
656
|
+
/**
|
|
657
|
+
* The verdict, committed BEFORE any record is written: does this text
|
|
658
|
+
* carry anything worth recalling in a later, unrelated conversation?
|
|
659
|
+
* `false` is the default outcome for ordinary turns — greetings, answered
|
|
660
|
+
* questions, one-off requests — and requires facts, tags, category, and
|
|
661
|
+
* community to all be empty. `true` requires at least one fact.
|
|
662
|
+
*/
|
|
663
|
+
remember: z.boolean(),
|
|
671
664
|
/**
|
|
672
665
|
* Durable, self-contained facts worth remembering in a later, unrelated
|
|
673
|
-
* conversation (
|
|
674
|
-
*
|
|
675
|
-
*
|
|
666
|
+
* conversation (decisions, contact details, project facts, events), each
|
|
667
|
+
* carrying its maintenance metadata (subject, category, kind, stability).
|
|
668
|
+
* MUST be empty when `remember` is false, non-empty when it is true.
|
|
676
669
|
*/
|
|
677
670
|
facts: z.array(ExtractedFactSchema),
|
|
678
671
|
/**
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -416,25 +416,6 @@ interface MemoryCognitionForgetDeps {
|
|
|
416
416
|
}
|
|
417
417
|
declare function createMemoryCognitionForgetTool(deps: MemoryCognitionForgetDeps): Tool;
|
|
418
418
|
|
|
419
|
-
declare const memoryCognitionRememberSchema: z.ZodObject<{
|
|
420
|
-
text: z.ZodString;
|
|
421
|
-
path: z.ZodOptional<z.ZodString>;
|
|
422
|
-
}, z.core.$strip>;
|
|
423
|
-
type MemoryCognitionRememberInput = z.infer<typeof memoryCognitionRememberSchema>;
|
|
424
|
-
|
|
425
|
-
interface MemoryCognitionRememberDeps {
|
|
426
|
-
scope: MemoryToolScope;
|
|
427
|
-
storeInsight: (input: {
|
|
428
|
-
memoryCognition: string;
|
|
429
|
-
sessionId?: string;
|
|
430
|
-
conversationId?: string;
|
|
431
|
-
requestId?: string;
|
|
432
|
-
text: string;
|
|
433
|
-
path?: string;
|
|
434
|
-
}) => Promise<string>;
|
|
435
|
-
}
|
|
436
|
-
declare function createMemoryCognitionRememberTool(deps: MemoryCognitionRememberDeps): Tool;
|
|
437
|
-
|
|
438
419
|
declare const memoryPartitionDeleteSchema: z.ZodObject<{
|
|
439
420
|
text: z.ZodString;
|
|
440
421
|
}, z.core.$strip>;
|
|
@@ -473,41 +454,12 @@ interface MemoryPartitionRecallDeps {
|
|
|
473
454
|
}
|
|
474
455
|
declare function createMemoryPartitionRecallTool(deps: MemoryPartitionRecallDeps): Tool;
|
|
475
456
|
|
|
476
|
-
declare const memoryPartitionRememberSchema: z.ZodObject<{
|
|
477
|
-
text: z.ZodString;
|
|
478
|
-
category: z.ZodString;
|
|
479
|
-
community: z.ZodString;
|
|
480
|
-
subject: z.ZodString;
|
|
481
|
-
node: z.ZodString;
|
|
482
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
483
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
484
|
-
}, z.core.$strip>;
|
|
485
|
-
type MemoryPartitionRememberInput = z.infer<typeof memoryPartitionRememberSchema>;
|
|
486
|
-
|
|
487
|
-
interface MemoryPartitionRememberDeps {
|
|
488
|
-
scope: MemoryToolScope;
|
|
489
|
-
storeRecord: (input: {
|
|
490
|
-
memoryPartition: string;
|
|
491
|
-
sessionId?: string;
|
|
492
|
-
conversationId?: string;
|
|
493
|
-
requestId?: string;
|
|
494
|
-
text: string;
|
|
495
|
-
tags?: string[];
|
|
496
|
-
category: string;
|
|
497
|
-
community: string;
|
|
498
|
-
subject: string;
|
|
499
|
-
node: string;
|
|
500
|
-
icon?: string;
|
|
501
|
-
}) => Promise<string>;
|
|
502
|
-
}
|
|
503
|
-
declare function createMemoryPartitionRememberTool(deps: MemoryPartitionRememberDeps): Tool;
|
|
504
|
-
|
|
505
457
|
declare const memoryTaxonomyProbeSchema: z.ZodObject<{
|
|
506
458
|
kind: z.ZodEnum<{
|
|
507
|
-
community: "community";
|
|
508
|
-
node: "node";
|
|
509
459
|
cluster: "cluster";
|
|
460
|
+
community: "community";
|
|
510
461
|
hub: "hub";
|
|
462
|
+
node: "node";
|
|
511
463
|
}>;
|
|
512
464
|
query: z.ZodString;
|
|
513
465
|
parentId: z.ZodOptional<z.ZodString>;
|
|
@@ -806,4 +758,4 @@ interface VideoStats {
|
|
|
806
758
|
lang?: string;
|
|
807
759
|
}
|
|
808
760
|
|
|
809
|
-
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
|
|
761
|
+
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 MemoryPartitionDeleteInput, type MemoryPartitionRecallInput, 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, createMemoryPartitionDeleteTool, createMemoryPartitionRecallTool, createMemoryTaxonomyProbeTool, createSerperBusinessReviewsSearch, createSerperImageSearch, createSerperNewsSearch, createSerperPlacesSearch, createSerperShoppingSearch, createSerperVideoSearch, createSerperWebSearch, createSerperWebpageScrape, createVariantRequestTool, createWebFetchTool, createYoutubeVideoSearch, encyclopediaReadSchema, encyclopediaSearchSchema, engineEnabled, extractArticleText, fetchWithTimeout, isGoogleHostUrl, localizedQuerySuffix, meetsMinimumImageDimensions, memoryCognitionDeleteSchema, memoryCognitionForgetSchema, memoryPartitionDeleteSchema, memoryPartitionRecallSchema, 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
|
@@ -1002,8 +1002,8 @@ var defaultSummarize = (data) => {
|
|
|
1002
1002
|
};
|
|
1003
1003
|
|
|
1004
1004
|
// src/tools/helpers/with-summary.helper.ts
|
|
1005
|
-
function withSummary(
|
|
1006
|
-
const t =
|
|
1005
|
+
function withSummary(tool26, summarize = defaultSummarize) {
|
|
1006
|
+
const t = tool26;
|
|
1007
1007
|
t.summarize = summarize;
|
|
1008
1008
|
return t;
|
|
1009
1009
|
}
|
|
@@ -1087,38 +1087,6 @@ function createMemoryCognitionForgetTool(deps) {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
});
|
|
1089
1089
|
}
|
|
1090
|
-
var memoryCognitionRememberSchema = z.object({
|
|
1091
|
-
text: z.string().min(1).max(2e3).describe(
|
|
1092
|
-
'The derived insight to store, as one self-contained third-person sentence, e.g. "The user prefers single-line if statements".'
|
|
1093
|
-
),
|
|
1094
|
-
path: z.string().min(1).max(200).optional().describe(
|
|
1095
|
-
'Optional profile facet this insight deepens, e.g. "likes.cars" \u2014 only when it deepens a stored profile value.'
|
|
1096
|
-
)
|
|
1097
|
-
});
|
|
1098
|
-
function createMemoryCognitionRememberTool(deps) {
|
|
1099
|
-
return tool({
|
|
1100
|
-
description: 'Store one insight into your cognition space (memory-cognition) \u2014 the exclusive store for SUBJECTIVE user data: preferences and interests the user STATES ("the user likes\u2026", "the user is interested in\u2026") plus what you LEARN about them (inferred traits, standing interests, working nuances, connections between facts). Objective facts (contact info, decisions, project details, events) belong in memory-partition-remember, never here. One self-contained third-person sentence per call, lead with the topic. Optionally attach a path (e.g. "likes.cars") when the insight deepens a stored profile value. Restating an insight verbatim updates it in place.',
|
|
1101
|
-
inputSchema: memoryCognitionRememberSchema,
|
|
1102
|
-
execute: async ({ text, path }) => {
|
|
1103
|
-
try {
|
|
1104
|
-
const id = await deps.storeInsight({
|
|
1105
|
-
memoryCognition: deps.scope.memoryCognition ?? deps.scope.memoryPartition,
|
|
1106
|
-
sessionId: deps.scope.sessionId,
|
|
1107
|
-
conversationId: deps.scope.conversationId,
|
|
1108
|
-
requestId: deps.scope.requestId,
|
|
1109
|
-
text,
|
|
1110
|
-
path
|
|
1111
|
-
});
|
|
1112
|
-
return { stored: true, id };
|
|
1113
|
-
} catch (error) {
|
|
1114
|
-
return {
|
|
1115
|
-
stored: false,
|
|
1116
|
-
error: error instanceof Error ? error.message : "cognition store failed"
|
|
1117
|
-
};
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
1122
1090
|
var memoryPartitionDeleteSchema = z.object({
|
|
1123
1091
|
text: z.string().min(3).max(2e3).describe(
|
|
1124
1092
|
"The exact stored statement to delete, quoted verbatim from a memory-partition-recall result. Record texts are the record identity \u2014 no ids needed. Never paraphrase: recall first, then delete the exact text."
|
|
@@ -1179,56 +1147,6 @@ ${lines.join("\n")}`;
|
|
|
1179
1147
|
}
|
|
1180
1148
|
});
|
|
1181
1149
|
}
|
|
1182
|
-
var memoryPartitionRememberSchema = z.object({
|
|
1183
|
-
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".'),
|
|
1184
|
-
category: z.string().min(1).max(40).describe(
|
|
1185
|
-
'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.'
|
|
1186
|
-
),
|
|
1187
|
-
community: z.string().min(1).max(60).describe(
|
|
1188
|
-
'One lowercase PLURAL sub-family narrowing the category, e.g. "survival games" under "games", "tv shows" under "shows" \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch). Always present; never a specific entity, product, or title \u2014 a show/work title like "breaking-bad" is a hub, never a community.'
|
|
1189
|
-
),
|
|
1190
|
-
subject: z.string().min(1).max(40).describe(
|
|
1191
|
-
'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.'
|
|
1192
|
-
),
|
|
1193
|
-
node: z.string().min(1).max(120).describe(
|
|
1194
|
-
'The lowercase SINGULAR aspect the fact addresses under its hub \u2014 the NODE tier, e.g. "base building" under "project zomboid", "ryzen 9950x3d" under "amd". Reuse existing labels whenever they fit; never pluralized, never a sentence.'
|
|
1195
|
-
),
|
|
1196
|
-
icon: z.string().min(1).max(64).optional().describe(
|
|
1197
|
-
'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.'
|
|
1198
|
-
),
|
|
1199
|
-
tags: z.array(z.string().min(1).max(40)).max(8).optional().describe(
|
|
1200
|
-
'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"].'
|
|
1201
|
-
)
|
|
1202
|
-
});
|
|
1203
|
-
function createMemoryPartitionRememberTool(deps) {
|
|
1204
|
-
return tool({
|
|
1205
|
-
description: 'Store into the user\'s fact partition (memory-partition) \u2014 OBJECTIVE facts only: notable external-world facts about subjects they care about (projects, followed stocks, games, people, past topics), objective details they state as fact (contact info, decisions, constraints, their setup), and objective facts they explicitly ask you to remember. You MUST NOT store subjective user data here \u2014 preferences, interests, likes/dislikes, behavioral traits, or internal states ("the user likes\u2026") belong to the cognition tier (memory-cognition-remember). Storing gathered knowledge is expected \u2014 do not wait for an explicit "remember" instruction. This memory outlives the conversation and is recalled later with memory-partition-recall. STORAGE MECHANICS: each record is embedded as a whole and matched sentence-by-sentence at recall time \u2014 write ONE self-contained statement per call (a single dense sentence is fine, subject up front), restating a record verbatim updates it in place, tags are the recall filter vocabulary (lowercase, reusable), and the macro-taxonomy routes each record down its strict chain: `category` one broad PLURAL family label (games, pets, work, health \u2026 \u2014 the cluster tier), `community` one PLURAL sub-family under it (survival games, action rpgs \u2026), `subject` the SINGULAR entity the fact is about (project zomboid, amd, sam \u2026 \u2014 the hub tier), `node` the SINGULAR aspect under the hub (base building, ryzen 9950x3d \u2026 \u2014 the node tier). ALL FOUR labels are always required; reuse existing labels whenever they fit.',
|
|
1206
|
-
inputSchema: memoryPartitionRememberSchema,
|
|
1207
|
-
execute: async ({ text, tags, category, community, subject, node, icon }) => {
|
|
1208
|
-
try {
|
|
1209
|
-
const id = await deps.storeRecord({
|
|
1210
|
-
memoryPartition: deps.scope.memoryPartition,
|
|
1211
|
-
sessionId: deps.scope.sessionId,
|
|
1212
|
-
conversationId: deps.scope.conversationId,
|
|
1213
|
-
requestId: deps.scope.requestId,
|
|
1214
|
-
text,
|
|
1215
|
-
tags,
|
|
1216
|
-
category,
|
|
1217
|
-
community,
|
|
1218
|
-
subject,
|
|
1219
|
-
node,
|
|
1220
|
-
icon
|
|
1221
|
-
});
|
|
1222
|
-
return { stored: true, id };
|
|
1223
|
-
} catch (error) {
|
|
1224
|
-
return {
|
|
1225
|
-
stored: false,
|
|
1226
|
-
error: error instanceof Error ? error.message : "memory store failed"
|
|
1227
|
-
};
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
1150
|
var memoryTaxonomyProbeSchema = z.object({
|
|
1233
1151
|
kind: z.enum(["cluster", "community", "hub", "node"]).describe(
|
|
1234
1152
|
"Which tier to probe. Top-down order: cluster (PLURAL family noun) \u2192 community (PLURAL sub-family under one cluster) \u2192 hub (SINGULAR main subject entity) \u2192 node (SINGULAR aspect under the hub)."
|
|
@@ -2013,4 +1931,4 @@ function createYoutubeVideoSearch(deps) {
|
|
|
2013
1931
|
});
|
|
2014
1932
|
}
|
|
2015
1933
|
|
|
2016
|
-
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,
|
|
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, createMemoryPartitionDeleteTool, createMemoryPartitionRecallTool, createMemoryTaxonomyProbeTool, createSerperBusinessReviewsSearch, createSerperImageSearch, createSerperNewsSearch, createSerperPlacesSearch, createSerperShoppingSearch, createSerperVideoSearch, createSerperWebSearch, createSerperWebpageScrape, createVariantRequestTool, createWebFetchTool, createYoutubeVideoSearch, encyclopediaReadSchema, encyclopediaSearchSchema, engineEnabled, extractArticleText, fetchWithTimeout, isGoogleHostUrl, localizedQuerySuffix, meetsMinimumImageDimensions, memoryCognitionDeleteSchema, memoryCognitionForgetSchema, memoryPartitionDeleteSchema, memoryPartitionRecallSchema, 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": "1.0.
|
|
4
|
+
"version": "1.0.8",
|
|
5
5
|
"packageManager": "pnpm@12.17.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.6.
|
|
59
|
-
"linkedom": "^0.18.
|
|
60
|
-
"turndown": "^7.2.
|
|
58
|
+
"@triplef/helpers": "^1.6.3",
|
|
59
|
+
"linkedom": "^0.18.15",
|
|
60
|
+
"turndown": "^7.2.5"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"ai": "^7.0.
|
|
63
|
+
"ai": "^7.0.162",
|
|
64
64
|
"zod": "^4.6.7"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
@@ -74,25 +74,25 @@
|
|
|
74
74
|
"@types/eslint": "^9.6.1",
|
|
75
75
|
"@types/node": "^26.6.6",
|
|
76
76
|
"@types/turndown": "^5.0.6",
|
|
77
|
-
"@vitest/coverage-v8": "5.0
|
|
77
|
+
"@vitest/coverage-v8": "5.1.0",
|
|
78
78
|
"depcheck": "^1.4.7",
|
|
79
|
-
"dependency-cruiser": "^18.7.
|
|
80
|
-
"eslint": "^10.
|
|
79
|
+
"dependency-cruiser": "^18.7.2",
|
|
80
|
+
"eslint": "^10.14.0",
|
|
81
81
|
"eslint-config-prettier": "^10.1.8",
|
|
82
82
|
"eslint-plugin-prettier": "^5.5.7",
|
|
83
83
|
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
84
84
|
"eslint-plugin-sonarjs": "^4.2.2",
|
|
85
|
-
"globals": "^17.
|
|
85
|
+
"globals": "^17.14.0",
|
|
86
86
|
"husky": "^9.1.7",
|
|
87
87
|
"jiti": "^2.7.0",
|
|
88
88
|
"lint-staged": "^17.6.0",
|
|
89
89
|
"npm-check-updates": "^23.1.1",
|
|
90
90
|
"prettier": "^3.9.10",
|
|
91
|
-
"rimraf": "^6.1.
|
|
91
|
+
"rimraf": "^6.1.4",
|
|
92
92
|
"ts-unused-exports": "^11.0.1",
|
|
93
93
|
"tsup": "^8.5.1",
|
|
94
94
|
"typescript": "^5.9.3",
|
|
95
95
|
"typescript-eslint": "^8.72.1",
|
|
96
|
-
"vitest": "^5.0
|
|
96
|
+
"vitest": "^5.1.0"
|
|
97
97
|
}
|
|
98
98
|
}
|