@triplef/agent 0.1.1 → 0.1.3
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.mjs
CHANGED
|
@@ -368,7 +368,7 @@ var TOOL_DESCRIPTIONS = {
|
|
|
368
368
|
eodhdIntraday: "Fetch intraday OHLCV bars for an EODHD ticker and return a per-day, per-price-band volume profile as chartData for the client heatmap. Use to render a volume heatmap across fixed price bands.",
|
|
369
369
|
eodhdNews: "Fetch recent financial news for an EODHD ticker \u2014 headlines, links, sources, publish dates. Use to ground a stock-market answer in what is happening around a company.",
|
|
370
370
|
eodhdFundamentals: "Fetch company fundamentals for an EODHD ticker \u2014 general info, valuation, and key financial highlights (sector, market cap, P/E, revenue, margins).",
|
|
371
|
-
webFetch: "Fetch the full content of a specific URL.
|
|
371
|
+
webFetch: "Fetch the full content of a specific URL (e.g. a search result page) as clean Markdown. Prefer fetching the most relevant search results to ground the answer in full source text rather than relying on snippets alone.",
|
|
372
372
|
browser_navigate: "Control a real browser: navigate to a URL. Use for interactive browsing \u2014 JS-heavy pages, content behind clicks, tabs, scrolling, or forms \u2014 that static search/fetch cannot reach. Follow up with browser_snapshot to read the page before acting on it.",
|
|
373
373
|
browser_navigate_back: "Go back to the previous page in the browser history.",
|
|
374
374
|
browser_snapshot: "Read the current browser page as an accessibility snapshot (structured text with element refs). The primary way to see page content and obtain the refs that browser_click/browser_type need.",
|
|
@@ -2652,6 +2652,12 @@ WHEN TO USE TOOLS
|
|
|
2652
2652
|
- user asks about a specific product to buy, prices, or best deals \u2192 product template with a *WebSearch tool, shopping search, and reviews search
|
|
2653
2653
|
- user asks about specific factual entities, specifications, data, statistics \u2192 the enabled *WebSearch tool
|
|
2654
2654
|
|
|
2655
|
+
FETCH-AFTER-SEARCH RULES
|
|
2656
|
+
- When you include a *WebSearch tool for factual research (article, news, evaluation, product, or text), also include a fetch tool \u2014 webFetch, serperWebpageScrape, or brightDataWebpageScrape \u2014 to fetch the 1-3 most relevant result pages.
|
|
2657
|
+
- The fetched full content grounds the answer in source text (not just snippets) and populates the knowledge cache for future turns.
|
|
2658
|
+
- You decide which pages are worth fetching: fetch only pages whose full content would meaningfully improve the answer. Skip fetching for trivial lookups, quick facts, or when the snippets already answer the request completely.
|
|
2659
|
+
- Prefer webFetch for plain pages; use a scrape tool for pages behind anti-bot protection.
|
|
2660
|
+
|
|
2655
2661
|
MEDIA-TYPE TOOL SELECTION
|
|
2656
2662
|
When the user explicitly or implicitly requests specific media types, include the corresponding concrete tools (never category names):
|
|
2657
2663
|
- images, photos, pictures, screenshots, artwork \u2192 include every enabled *ImageSearch tool (e.g. serperImageSearch)
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -154,6 +154,7 @@ interface LexiconSelectInput {
|
|
|
154
154
|
query: string;
|
|
155
155
|
documents: LexiconSourceDocument[];
|
|
156
156
|
budgetChars?: number;
|
|
157
|
+
partitionScope?: string;
|
|
157
158
|
}
|
|
158
159
|
interface LexiconSelectResult {
|
|
159
160
|
chunks: LexiconSelectedChunk[];
|
|
@@ -161,6 +162,9 @@ interface LexiconSelectResult {
|
|
|
161
162
|
selectedChunks: number;
|
|
162
163
|
droppedByThreshold: number;
|
|
163
164
|
inputChunksDropped: number;
|
|
165
|
+
pastChunks?: LexiconSelectedChunk[];
|
|
166
|
+
reusedDocs?: number;
|
|
167
|
+
storedDocs?: number;
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
declare const ConsolidationVerdictSchema: z.ZodObject<{
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -110,7 +110,7 @@ var TOOL_DESCRIPTIONS = {
|
|
|
110
110
|
eodhdIntraday: "Fetch intraday OHLCV bars for an EODHD ticker and return a per-day, per-price-band volume profile as chartData for the client heatmap. Use to render a volume heatmap across fixed price bands.",
|
|
111
111
|
eodhdNews: "Fetch recent financial news for an EODHD ticker \u2014 headlines, links, sources, publish dates. Use to ground a stock-market answer in what is happening around a company.",
|
|
112
112
|
eodhdFundamentals: "Fetch company fundamentals for an EODHD ticker \u2014 general info, valuation, and key financial highlights (sector, market cap, P/E, revenue, margins).",
|
|
113
|
-
webFetch: "Fetch the full content of a specific URL.
|
|
113
|
+
webFetch: "Fetch the full content of a specific URL (e.g. a search result page) as clean Markdown. Prefer fetching the most relevant search results to ground the answer in full source text rather than relying on snippets alone.",
|
|
114
114
|
browser_navigate: "Control a real browser: navigate to a URL. Use for interactive browsing \u2014 JS-heavy pages, content behind clicks, tabs, scrolling, or forms \u2014 that static search/fetch cannot reach. Follow up with browser_snapshot to read the page before acting on it.",
|
|
115
115
|
browser_navigate_back: "Go back to the previous page in the browser history.",
|
|
116
116
|
browser_snapshot: "Read the current browser page as an accessibility snapshot (structured text with element refs). The primary way to see page content and obtain the refs that browser_click/browser_type need.",
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -84,12 +84,6 @@ interface MarketDailyBar {
|
|
|
84
84
|
interface ToolDependencies {
|
|
85
85
|
getLiveConfig: () => ToolConfigSnapshot;
|
|
86
86
|
logger: ToolLogger;
|
|
87
|
-
compactContent: (content: string, opts?: {
|
|
88
|
-
model?: string;
|
|
89
|
-
notify?: (event: string, data?: unknown) => void;
|
|
90
|
-
}) => Promise<{
|
|
91
|
-
text: string;
|
|
92
|
-
}>;
|
|
93
87
|
model?: string;
|
|
94
88
|
notify?: (event: string, data?: unknown) => void;
|
|
95
89
|
getOrFetchHistory?: (ticker: string, from: string, to: string) => Promise<MarketDailyBar[]>;
|
package/dist/tools/index.mjs
CHANGED
|
@@ -669,7 +669,7 @@ function createBrightDataWebpageScrape(deps) {
|
|
|
669
669
|
});
|
|
670
670
|
const content = data.text || "";
|
|
671
671
|
deps.logger.log(`Bright Data webpage scraped ${content.length} chars from "${url}"`);
|
|
672
|
-
return { content, title: "" };
|
|
672
|
+
return { url, content, title: "" };
|
|
673
673
|
} catch (err) {
|
|
674
674
|
deps.logger.warn(`Bright Data webpage scrape failed for "${url}": ${String(err)}`);
|
|
675
675
|
return { content: "", error: String(err) };
|
|
@@ -1416,7 +1416,7 @@ function createSerperWebpageScrape(deps) {
|
|
|
1416
1416
|
const content = data.text || "";
|
|
1417
1417
|
const title = data.title || "";
|
|
1418
1418
|
deps.logger.log(`Serper.dev Webpage scraped ${content.length} chars from "${url}"`);
|
|
1419
|
-
return { content, title };
|
|
1419
|
+
return { url, content, title };
|
|
1420
1420
|
}
|
|
1421
1421
|
});
|
|
1422
1422
|
}
|
|
@@ -1474,7 +1474,7 @@ function extractArticleText(html) {
|
|
|
1474
1474
|
// src/tools/web-fetch/web-fetch.tool.ts
|
|
1475
1475
|
function createWebFetchTool() {
|
|
1476
1476
|
return tool({
|
|
1477
|
-
description: "Fetch the full content of a specific URL. Returns the main article text as Markdown (boilerplate removed).
|
|
1477
|
+
description: "Fetch the full content of a specific URL (e.g. a search result page). Returns the main article text as Markdown (boilerplate removed). Prefer fetching the most relevant search results to ground the answer in full source text.",
|
|
1478
1478
|
inputSchema: webFetchSchema,
|
|
1479
1479
|
execute: async ({ url }) => {
|
|
1480
1480
|
const response = await fetchWithTimeout(
|
|
@@ -1488,7 +1488,7 @@ function createWebFetchTool() {
|
|
|
1488
1488
|
{ timeoutMs: SEARCH_TIMEOUT_MS }
|
|
1489
1489
|
);
|
|
1490
1490
|
const html = await response.text();
|
|
1491
|
-
return { content: extractArticleText(html) };
|
|
1491
|
+
return { url, content: extractArticleText(html) };
|
|
1492
1492
|
}
|
|
1493
1493
|
});
|
|
1494
1494
|
}
|
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.3",
|
|
5
5
|
"packageManager": "pnpm@11.24.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|