@memberjunction/core-actions 6.1.0-edge.4 → 6.1.0-edge.6
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/README.md +4 -1
- package/dist/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +22 -11
- package/dist/config.js.map +1 -1
- package/dist/custom/geo/scheduled-geocoding.action.d.ts +8 -0
- package/dist/custom/geo/scheduled-geocoding.action.d.ts.map +1 -1
- package/dist/custom/geo/scheduled-geocoding.action.js +26 -12
- package/dist/custom/geo/scheduled-geocoding.action.js.map +1 -1
- package/dist/custom/integration/graphql-query.action.d.ts.map +1 -1
- package/dist/custom/integration/graphql-query.action.js +2 -1
- package/dist/custom/integration/graphql-query.action.js.map +1 -1
- package/dist/custom/lists/get-list-records.action.d.ts.map +1 -1
- package/dist/custom/lists/get-list-records.action.js +3 -14
- package/dist/custom/lists/get-list-records.action.js.map +1 -1
- package/dist/custom/search/scoped-search.action.d.ts +38 -1
- package/dist/custom/search/scoped-search.action.d.ts.map +1 -1
- package/dist/custom/search/scoped-search.action.js +230 -26
- package/dist/custom/search/scoped-search.action.js.map +1 -1
- package/dist/custom/utilities/base-file-handler.d.ts.map +1 -1
- package/dist/custom/utilities/base-file-handler.js +2 -0
- package/dist/custom/utilities/base-file-handler.js.map +1 -1
- package/dist/custom/web/rss-feed-parsing.d.ts +135 -0
- package/dist/custom/web/rss-feed-parsing.d.ts.map +1 -0
- package/dist/custom/web/rss-feed-parsing.js +271 -0
- package/dist/custom/web/rss-feed-parsing.js.map +1 -0
- package/dist/custom/web/rss-feed-read.action.d.ts +108 -0
- package/dist/custom/web/rss-feed-read.action.d.ts.map +1 -0
- package/dist/custom/web/rss-feed-read.action.js +325 -0
- package/dist/custom/web/rss-feed-read.action.js.map +1 -0
- package/dist/custom/web/tavily-search.action.d.ts +108 -0
- package/dist/custom/web/tavily-search.action.d.ts.map +1 -0
- package/dist/custom/web/tavily-search.action.js +275 -0
- package/dist/custom/web/tavily-search.action.js.map +1 -0
- package/dist/custom/web/url-metadata-extractor.action.d.ts.map +1 -1
- package/dist/custom/web/url-metadata-extractor.action.js +3 -1
- package/dist/custom/web/url-metadata-extractor.action.js.map +1 -1
- package/dist/custom/web/web-page-content.action.d.ts.map +1 -1
- package/dist/custom/web/web-page-content.action.js +6 -1
- package/dist/custom/web/web-page-content.action.js.map +1 -1
- package/dist/custom/workflow/conditional.action.d.ts +14 -1
- package/dist/custom/workflow/conditional.action.d.ts.map +1 -1
- package/dist/custom/workflow/conditional.action.js +60 -5
- package/dist/custom/workflow/conditional.action.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +39 -39
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var ReadRSSFeedAction_1;
|
|
8
|
+
import { BaseAction } from "@memberjunction/actions";
|
|
9
|
+
import { RegisterClass } from "@memberjunction/global";
|
|
10
|
+
import { LogError, LogStatus } from "@memberjunction/core";
|
|
11
|
+
import { filterByAge, filterRelevant, parseFeedArticles, scoreAndRankArticles, } from "./rss-feed-parsing.js";
|
|
12
|
+
/**
|
|
13
|
+
* Action that reads one or more RSS or Atom feeds and returns their articles,
|
|
14
|
+
* optionally scored and ranked against a keyword list.
|
|
15
|
+
*
|
|
16
|
+
* Feeds are fetched concurrently and a failing feed does not fail the action: its
|
|
17
|
+
* error is reported in `FeedStatuses` while the other feeds still return their
|
|
18
|
+
* articles. A feed being unreachable is the normal case at any scale — one dead
|
|
19
|
+
* URL in a list of twenty should not cost the caller the other nineteen.
|
|
20
|
+
*
|
|
21
|
+
* No credential. These are public HTTP endpoints.
|
|
22
|
+
*
|
|
23
|
+
* Scoring is a keyword-relevance weight (title 3, category 2, description 1)
|
|
24
|
+
* plus a recency decay across the time window, combined as
|
|
25
|
+
* `relevance * 10 + recency * 5` so relevance dominates and recency breaks ties.
|
|
26
|
+
* The numeric scores come back on every article rather than being bucketed into
|
|
27
|
+
* labels, because what counts as "high" depends on the caller's corpus, not on
|
|
28
|
+
* this action's batch.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Just read a feed
|
|
33
|
+
* await runAction({
|
|
34
|
+
* ActionName: 'Read RSS Feed',
|
|
35
|
+
* Params: [{ Name: 'FeedURLs', Value: 'https://example.org/news/feed.xml' }]
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // Several named feeds, ranked against keywords, last 7 days
|
|
39
|
+
* await runAction({
|
|
40
|
+
* ActionName: 'Read RSS Feed',
|
|
41
|
+
* Params: [
|
|
42
|
+
* { Name: 'Feeds', Value: [
|
|
43
|
+
* { name: 'Associations Now', url: 'https://associationsnow.com/feed/' },
|
|
44
|
+
* { name: 'NonprofitPRO', url: 'https://www.nonprofitpro.com/feed/' }
|
|
45
|
+
* ]},
|
|
46
|
+
* { Name: 'Keywords', Value: ['membership', 'dues', 'retention'] },
|
|
47
|
+
* { Name: 'MaxAgeDays', Value: 7 },
|
|
48
|
+
* { Name: 'MaxResults', Value: 25 }
|
|
49
|
+
* ]
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
let ReadRSSFeedAction = class ReadRSSFeedAction extends BaseAction {
|
|
54
|
+
static { ReadRSSFeedAction_1 = this; }
|
|
55
|
+
static { this.DEFAULT_MAX_AGE_DAYS = 7; }
|
|
56
|
+
static { this.DEFAULT_MAX_RESULTS = 25; }
|
|
57
|
+
static { this.FETCH_TIMEOUT_MS = 15000; }
|
|
58
|
+
/** Bounded so one enormous feed cannot exhaust memory. */
|
|
59
|
+
static { this.MAX_FEED_BYTES = 10 * 1024 * 1024; }
|
|
60
|
+
static { this.USER_AGENT = 'MemberJunction-CoreActions/1.0'; }
|
|
61
|
+
/**
|
|
62
|
+
* Executes the feed read.
|
|
63
|
+
*
|
|
64
|
+
* @param params - The action parameters containing:
|
|
65
|
+
* - Feeds: Array of `{ name, url }` (or a JSON string of one). Either this
|
|
66
|
+
* or FeedURLs is required
|
|
67
|
+
* - FeedURLs: Array or comma-separated string of URLs, named after their host
|
|
68
|
+
* - Keywords: Array or comma-separated string. Optional — with none supplied,
|
|
69
|
+
* articles come back ranked purely by recency
|
|
70
|
+
* - MaxAgeDays: Age window, default 7. News has a short shelf life
|
|
71
|
+
* - MaxResults: Cap on returned articles, default 25
|
|
72
|
+
* - IncludeUndated: Keep articles the feed gave no parseable date (default
|
|
73
|
+
* false). They cannot be age-filtered, so this is an explicit choice
|
|
74
|
+
* - RequireAllFeeds: Fail the action if any feed failed (default false)
|
|
75
|
+
*
|
|
76
|
+
* @returns Ranked articles, plus a per-feed status list
|
|
77
|
+
*/
|
|
78
|
+
async InternalRunAction(params) {
|
|
79
|
+
const feedsResult = this.resolveFeeds(params);
|
|
80
|
+
if (feedsResult.error !== null) {
|
|
81
|
+
return feedsResult.error;
|
|
82
|
+
}
|
|
83
|
+
const feeds = feedsResult.feeds;
|
|
84
|
+
const keywords = this.getStringArrayParam(params, 'keywords');
|
|
85
|
+
const maxAgeDays = Math.max(this.getNumericParam(params, 'maxagedays', ReadRSSFeedAction_1.DEFAULT_MAX_AGE_DAYS), 0);
|
|
86
|
+
const maxResults = Math.max(Math.floor(this.getNumericParam(params, 'maxresults', ReadRSSFeedAction_1.DEFAULT_MAX_RESULTS)), 1);
|
|
87
|
+
const includeUndated = this.getBooleanParam(params, 'includeundated', false);
|
|
88
|
+
const requireAllFeeds = this.getBooleanParam(params, 'requireallfeeds', false);
|
|
89
|
+
// One clock for the whole run: the age filter and the recency score must
|
|
90
|
+
// agree, or an article can pass the filter and then score as out-of-window.
|
|
91
|
+
const now = this.Now();
|
|
92
|
+
const settled = await Promise.allSettled(feeds.map(feed => this.fetchAndParse(feed)));
|
|
93
|
+
const statuses = [];
|
|
94
|
+
const allArticles = [];
|
|
95
|
+
for (let i = 0; i < settled.length; i++) {
|
|
96
|
+
const outcome = settled[i];
|
|
97
|
+
const feed = feeds[i];
|
|
98
|
+
if (outcome.status === 'fulfilled') {
|
|
99
|
+
allArticles.push(...outcome.value);
|
|
100
|
+
statuses.push({ name: feed.name, url: feed.url, success: true, articleCount: outcome.value.length, error: null });
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
const message = outcome.reason instanceof Error ? outcome.reason.message : String(outcome.reason);
|
|
104
|
+
LogError(`ReadRSSFeed: failed to read '${feed.name}' (${feed.url}): ${message}`);
|
|
105
|
+
statuses.push({ name: feed.name, url: feed.url, success: false, articleCount: 0, error: message });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const failedFeeds = statuses.filter(s => !s.success);
|
|
109
|
+
if (requireAllFeeds && failedFeeds.length > 0) {
|
|
110
|
+
return {
|
|
111
|
+
Success: false,
|
|
112
|
+
Message: `${failedFeeds.length} of ${feeds.length} feed(s) failed and RequireAllFeeds is set: ` +
|
|
113
|
+
failedFeeds.map(f => `${f.name} (${f.error})`).join('; '),
|
|
114
|
+
ResultCode: 'FEED_FETCH_FAILED',
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const aged = filterByAge(allArticles, maxAgeDays, now, includeUndated);
|
|
118
|
+
const ranked = scoreAndRankArticles(aged.kept, keywords, maxAgeDays, now);
|
|
119
|
+
const relevant = filterRelevant(ranked, keywords);
|
|
120
|
+
const top = relevant.slice(0, maxResults);
|
|
121
|
+
LogStatus(`ReadRSSFeed: ${allArticles.length} article(s) from ${statuses.filter(s => s.success).length}/${feeds.length} feed(s); ` +
|
|
122
|
+
`${aged.kept.length} within ${maxAgeDays} day(s), ${relevant.length} relevant, returning ${top.length}.`);
|
|
123
|
+
this.addOutputParam(params, 'Articles', top.map(this.toOutputArticle));
|
|
124
|
+
this.addOutputParam(params, 'ArticleCount', top.length);
|
|
125
|
+
this.addOutputParam(params, 'FeedStatuses', statuses);
|
|
126
|
+
this.addOutputParam(params, 'TotalFetched', allArticles.length);
|
|
127
|
+
this.addOutputParam(params, 'FilteredOutTooOld', aged.tooOldCount);
|
|
128
|
+
this.addOutputParam(params, 'UndatedCount', aged.undatedCount);
|
|
129
|
+
this.addOutputParam(params, 'FailedFeedCount', failedFeeds.length);
|
|
130
|
+
// Every count that shaped the answer is stated, so an empty or short result
|
|
131
|
+
// set is explainable without re-running anything. An empty result is a real
|
|
132
|
+
// answer — a quiet week is not a failure.
|
|
133
|
+
const message = `Read ${allArticles.length} article(s) from ${statuses.filter(s => s.success).length} of ${feeds.length} feed(s); ` +
|
|
134
|
+
`returning ${top.length}` +
|
|
135
|
+
(aged.tooOldCount > 0 ? `, ${aged.tooOldCount} older than ${maxAgeDays} day(s)` : '') +
|
|
136
|
+
(aged.undatedCount > 0 ? `, ${aged.undatedCount} undated (${includeUndated ? 'kept' : 'excluded'})` : '') +
|
|
137
|
+
(keywords.length > 0 ? `, ${ranked.length - relevant.length} matched no keyword and were not fresh enough` : '') +
|
|
138
|
+
(failedFeeds.length > 0 ? `, ${failedFeeds.length} feed(s) failed` : '') +
|
|
139
|
+
'.';
|
|
140
|
+
return { Success: true, Message: message, ResultCode: 'SUCCESS' };
|
|
141
|
+
}
|
|
142
|
+
/** The current time. Overridable so tests can pin the clock. */
|
|
143
|
+
Now() {
|
|
144
|
+
return new Date();
|
|
145
|
+
}
|
|
146
|
+
/** Fetch, with a timeout and a size bound. Overridable for tests. */
|
|
147
|
+
async FetchFeed(url) {
|
|
148
|
+
const controller = new AbortController();
|
|
149
|
+
const timeout = setTimeout(() => controller.abort(), ReadRSSFeedAction_1.FETCH_TIMEOUT_MS);
|
|
150
|
+
try {
|
|
151
|
+
const response = await fetch(url, {
|
|
152
|
+
signal: controller.signal,
|
|
153
|
+
headers: {
|
|
154
|
+
'User-Agent': ReadRSSFeedAction_1.USER_AGENT,
|
|
155
|
+
accept: 'application/rss+xml, application/atom+xml, application/xml, text/xml, */*',
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
if (!response.ok) {
|
|
159
|
+
const body = await response.text().catch(() => '');
|
|
160
|
+
throw new Error(`HTTP ${response.status}${body ? `: ${body.slice(0, 200)}` : ''}`);
|
|
161
|
+
}
|
|
162
|
+
// Reject on the DECLARED size before reading a byte of the body. Checking only after
|
|
163
|
+
// `await response.text()` bounded nothing: the whole feed was already buffered in memory
|
|
164
|
+
// by the time the limit was consulted, which is exactly what the limit exists to prevent.
|
|
165
|
+
const declared = Number(response.headers.get('content-length'));
|
|
166
|
+
if (Number.isFinite(declared) && declared > ReadRSSFeedAction_1.MAX_FEED_BYTES) {
|
|
167
|
+
throw new Error(`feed declares ${declared} bytes, above the ${ReadRSSFeedAction_1.MAX_FEED_BYTES}-byte limit`);
|
|
168
|
+
}
|
|
169
|
+
const text = await response.text();
|
|
170
|
+
// Second check for a server that sends no Content-Length (chunked transfer). This one
|
|
171
|
+
// cannot prevent the buffering, but it still stops an oversized feed from being parsed.
|
|
172
|
+
//
|
|
173
|
+
// Measured in BYTES rather than `text.length`, which counts UTF-16 code units — a feed of
|
|
174
|
+
// multi-byte characters was reported, and bounded, at well under its real size.
|
|
175
|
+
const bytes = Buffer.byteLength(text, 'utf-8');
|
|
176
|
+
if (bytes > ReadRSSFeedAction_1.MAX_FEED_BYTES) {
|
|
177
|
+
throw new Error(`feed body is ${bytes} bytes, above the ${ReadRSSFeedAction_1.MAX_FEED_BYTES}-byte limit`);
|
|
178
|
+
}
|
|
179
|
+
return text;
|
|
180
|
+
}
|
|
181
|
+
finally {
|
|
182
|
+
clearTimeout(timeout);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async fetchAndParse(feed) {
|
|
186
|
+
const xml = await this.FetchFeed(feed.url);
|
|
187
|
+
return parseFeedArticles(xml, feed.name);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Resolve `Feeds` or `FeedURLs` into a validated list.
|
|
191
|
+
*
|
|
192
|
+
* A URL that is not http(s) is rejected rather than attempted: `file://` and
|
|
193
|
+
* friends would turn a feed-reading action into a local-file reader, which is
|
|
194
|
+
* not what any caller of this means.
|
|
195
|
+
*/
|
|
196
|
+
resolveFeeds(params) {
|
|
197
|
+
const feeds = [];
|
|
198
|
+
const rawFeeds = this.getParamValue(params, 'feeds');
|
|
199
|
+
if (rawFeeds !== undefined && rawFeeds !== null && rawFeeds !== '') {
|
|
200
|
+
let parsed = rawFeeds;
|
|
201
|
+
if (typeof parsed === 'string') {
|
|
202
|
+
try {
|
|
203
|
+
parsed = JSON.parse(parsed);
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
return {
|
|
207
|
+
feeds: [],
|
|
208
|
+
error: this.createErrorResult(`Feeds could not be parsed as JSON: ${error instanceof Error ? error.message : String(error)}. ` +
|
|
209
|
+
`Supply an array of { name, url }, or use FeedURLs for a plain list of URLs.`, 'INVALID_FEEDS'),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (!Array.isArray(parsed)) {
|
|
214
|
+
return {
|
|
215
|
+
feeds: [],
|
|
216
|
+
error: this.createErrorResult('Feeds must be an array of { name, url } objects', 'INVALID_FEEDS'),
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
for (const entry of parsed) {
|
|
220
|
+
if (!entry || typeof entry !== 'object') {
|
|
221
|
+
return { feeds: [], error: this.createErrorResult('Each Feeds entry must be an object with a url', 'INVALID_FEEDS') };
|
|
222
|
+
}
|
|
223
|
+
const record = entry;
|
|
224
|
+
const url = typeof record.url === 'string' ? record.url.trim() : '';
|
|
225
|
+
if (!url) {
|
|
226
|
+
return { feeds: [], error: this.createErrorResult('Each Feeds entry requires a url', 'INVALID_FEEDS') };
|
|
227
|
+
}
|
|
228
|
+
const name = typeof record.name === 'string' && record.name.trim().length > 0 ? record.name.trim() : this.nameFromUrl(url);
|
|
229
|
+
feeds.push({ name, url });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
for (const url of this.getStringArrayParam(params, 'feedurls')) {
|
|
233
|
+
feeds.push({ name: this.nameFromUrl(url), url });
|
|
234
|
+
}
|
|
235
|
+
if (feeds.length === 0) {
|
|
236
|
+
return {
|
|
237
|
+
feeds: [],
|
|
238
|
+
error: this.createErrorResult('Supply at least one feed through Feeds ([{ name, url }]) or FeedURLs (a list of URLs)', 'MISSING_FEEDS'),
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
const invalid = feeds.filter(f => !this.isHttpUrl(f.url));
|
|
242
|
+
if (invalid.length > 0) {
|
|
243
|
+
return {
|
|
244
|
+
feeds: [],
|
|
245
|
+
error: this.createErrorResult(`Only http and https feed URLs are supported. Rejected: ${invalid.map(f => f.url).join(', ')}`, 'INVALID_FEED_URL'),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
// De-duplicate by URL. The same feed listed twice would double every
|
|
249
|
+
// article and distort the ranking, since scores are per article.
|
|
250
|
+
const seen = new Set();
|
|
251
|
+
return { feeds: feeds.filter(f => (seen.has(f.url) ? false : (seen.add(f.url), true))), error: null };
|
|
252
|
+
}
|
|
253
|
+
isHttpUrl(url) {
|
|
254
|
+
try {
|
|
255
|
+
const protocol = new URL(url).protocol;
|
|
256
|
+
return protocol === 'http:' || protocol === 'https:';
|
|
257
|
+
}
|
|
258
|
+
catch {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/** Fall back to the host as a feed's display name. */
|
|
263
|
+
nameFromUrl(url) {
|
|
264
|
+
try {
|
|
265
|
+
return new URL(url).hostname;
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return url;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/** Flatten a scored article for output — scores at the top level, not nested. */
|
|
272
|
+
toOutputArticle(scored) {
|
|
273
|
+
return {
|
|
274
|
+
title: scored.article.title,
|
|
275
|
+
link: scored.article.link,
|
|
276
|
+
description: scored.article.description,
|
|
277
|
+
publishedAt: scored.article.publishedAt,
|
|
278
|
+
categories: scored.article.categories,
|
|
279
|
+
feedName: scored.article.feedName,
|
|
280
|
+
relevanceScore: scored.relevanceScore,
|
|
281
|
+
recencyScore: Number(scored.recencyScore.toFixed(4)),
|
|
282
|
+
totalScore: Number(scored.totalScore.toFixed(4)),
|
|
283
|
+
matchedKeywords: scored.matchedKeywords,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
getParamValue(params, paramName) {
|
|
287
|
+
return params.Params.find(p => p.Name.trim().toLowerCase() === paramName.toLowerCase())?.Value;
|
|
288
|
+
}
|
|
289
|
+
getStringArrayParam(params, paramName) {
|
|
290
|
+
const value = this.getParamValue(params, paramName);
|
|
291
|
+
if (value === undefined || value === null)
|
|
292
|
+
return [];
|
|
293
|
+
const raw = Array.isArray(value) ? value.map(v => String(v)) : String(value).split(',');
|
|
294
|
+
return raw.map(v => v.trim()).filter(v => v.length > 0);
|
|
295
|
+
}
|
|
296
|
+
getNumericParam(params, paramName, defaultValue) {
|
|
297
|
+
const value = this.getParamValue(params, paramName);
|
|
298
|
+
if (value === undefined || value === null || value === '')
|
|
299
|
+
return defaultValue;
|
|
300
|
+
const num = Number(value);
|
|
301
|
+
return isNaN(num) ? defaultValue : num;
|
|
302
|
+
}
|
|
303
|
+
getBooleanParam(params, paramName, defaultValue) {
|
|
304
|
+
const value = this.getParamValue(params, paramName);
|
|
305
|
+
if (value === undefined || value === null || value === '')
|
|
306
|
+
return defaultValue;
|
|
307
|
+
if (typeof value === 'boolean')
|
|
308
|
+
return value;
|
|
309
|
+
return String(value).trim().toLowerCase() === 'true';
|
|
310
|
+
}
|
|
311
|
+
addOutputParam(params, name, value) {
|
|
312
|
+
params.Params.push({ Name: name, Type: 'Output', Value: value });
|
|
313
|
+
}
|
|
314
|
+
createErrorResult(message, code) {
|
|
315
|
+
return { Success: false, Message: message, ResultCode: code };
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
ReadRSSFeedAction = ReadRSSFeedAction_1 = __decorate([
|
|
319
|
+
RegisterClass(BaseAction, "Read RSS Feed")
|
|
320
|
+
], ReadRSSFeedAction);
|
|
321
|
+
export { ReadRSSFeedAction };
|
|
322
|
+
export function LoadReadRSSFeedAction() {
|
|
323
|
+
// Referenced by consumers to keep this registration from being tree-shaken.
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=rss-feed-read.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rss-feed-read.action.js","sourceRoot":"","sources":["../../../src/custom/web/rss-feed-read.action.ts"],"names":[],"mappings":";;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAGH,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,oBAAoB,GACvB,MAAM,oBAAoB,CAAC;AAiB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;;aACrB,yBAAoB,GAAG,CAAC,AAAJ,CAAK;aACzB,wBAAmB,GAAG,EAAE,AAAL,CAAM;aACzB,qBAAgB,GAAG,KAAK,AAAR,CAAS;IACjD,0DAA0D;aAClC,mBAAc,GAAG,EAAE,GAAG,IAAI,GAAG,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AC3C,CAAC;IAEO,eAAe,CAAC,MAAuB,EAAE,SAAiB,EAAE,YAAqB;QACrF,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACpD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE;YAAE,OAAO,YAAY,CAAC;QAC/E,IAAI,OAAO,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAC7C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;IACzD,CAAC;IAEO,cAAc,CAAC,MAAuB,EAAE,IAAY,EAAE,KAAc;QACxE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACrE,CAAC;IAEO,iBAAiB,CAAC,OAAe,EAAE,IAAY;QACnD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAClE,CAAC;;AA5SQ,iBAAiB;IAD7B,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC;GAC9B,iBAAiB,CA6S7B;;AAED,MAAM,UAAU,qBAAqB;IACjC,4EAA4E;AAChF,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
2
|
+
import { BaseAction } from "@memberjunction/actions";
|
|
3
|
+
/** One result from Tavily's /search endpoint. */
|
|
4
|
+
export interface TavilySearchResultItem {
|
|
5
|
+
title: string;
|
|
6
|
+
url: string;
|
|
7
|
+
/** Extracted page content, already trimmed by Tavily to what an LLM needs. */
|
|
8
|
+
content: string;
|
|
9
|
+
/**
|
|
10
|
+
* Tavily's relevance score for this result against the query, 0-1.
|
|
11
|
+
*
|
|
12
|
+
* It is a *relative* ranking signal within one response, not a calibrated
|
|
13
|
+
* probability — do not compare scores across queries, and do not hard-code
|
|
14
|
+
* thresholds against it.
|
|
15
|
+
*/
|
|
16
|
+
score: number;
|
|
17
|
+
/** Only populated when `Topic` is 'news'; absent otherwise. */
|
|
18
|
+
publishedDate?: string;
|
|
19
|
+
/** Only populated when `IncludeRawContent` is set. */
|
|
20
|
+
rawContent?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Action that searches the web through Tavily, a search API built for LLM
|
|
24
|
+
* consumption: results arrive as extracted page content rather than as snippets
|
|
25
|
+
* plus links to go fetch.
|
|
26
|
+
*
|
|
27
|
+
* Two things distinguish it from the other search actions in this package.
|
|
28
|
+
* `Topic: 'news'` gives a date-filtered news index with `PublishedDate` on every
|
|
29
|
+
* result, which is what makes recency-sensitive questions answerable. And
|
|
30
|
+
* `IncludeAnswer` returns a synthesized answer alongside the results, so a caller
|
|
31
|
+
* that only needs the conclusion does not have to run its own summarization pass.
|
|
32
|
+
*
|
|
33
|
+
* Authentication is `Authorization: Bearer <key>`. Tavily also still accepts an
|
|
34
|
+
* `api_key` field in the request body, but that form is legacy and puts the
|
|
35
|
+
* credential in the payload, so it is not used here.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* // Basic search
|
|
40
|
+
* await runAction({
|
|
41
|
+
* ActionName: 'Tavily Search',
|
|
42
|
+
* Params: [{ Name: 'Query', Value: 'association management software trends' }]
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* // Recent news, with a synthesized answer
|
|
46
|
+
* await runAction({
|
|
47
|
+
* ActionName: 'Tavily Search',
|
|
48
|
+
* Params: [
|
|
49
|
+
* { Name: 'Query', Value: 'nonprofit membership dues changes' },
|
|
50
|
+
* { Name: 'Topic', Value: 'news' },
|
|
51
|
+
* { Name: 'Days', Value: 7 },
|
|
52
|
+
* { Name: 'IncludeAnswer', Value: true }
|
|
53
|
+
* ]
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* // Advanced depth, restricted to two domains
|
|
57
|
+
* await runAction({
|
|
58
|
+
* ActionName: 'Tavily Search',
|
|
59
|
+
* Params: [
|
|
60
|
+
* { Name: 'Query', Value: 'IRS Form 990 filing requirements' },
|
|
61
|
+
* { Name: 'SearchDepth', Value: 'advanced' },
|
|
62
|
+
* { Name: 'IncludeDomains', Value: ['irs.gov', 'councilofnonprofits.org'] }
|
|
63
|
+
* ]
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare class TavilySearchAction extends BaseAction {
|
|
68
|
+
/** Tavily's cap on results per request. */
|
|
69
|
+
private static readonly MAX_RESULTS;
|
|
70
|
+
private static readonly DEFAULT_MAX_RESULTS;
|
|
71
|
+
private static readonly ENDPOINT;
|
|
72
|
+
/**
|
|
73
|
+
* Executes the Tavily search.
|
|
74
|
+
*
|
|
75
|
+
* @param params - The action parameters containing:
|
|
76
|
+
* - Query: Search query text (required)
|
|
77
|
+
* - SearchDepth: 'basic' (default) or 'advanced'. Advanced costs more Tavily
|
|
78
|
+
* credits per call and returns better-extracted content
|
|
79
|
+
* - Topic: 'general' (default) or 'news'. 'news' is the only topic that
|
|
80
|
+
* returns publication dates and the only one `Days` applies to
|
|
81
|
+
* - Days: For Topic 'news', how far back to search (default 3 at Tavily)
|
|
82
|
+
* - MaxResults: 1-20 (default 10)
|
|
83
|
+
* - IncludeAnswer: Return a synthesized answer alongside results (default false)
|
|
84
|
+
* - IncludeRawContent: Return full page text per result (default false) —
|
|
85
|
+
* this can be very large, so it is off unless asked for
|
|
86
|
+
* - IncludeDomains: Only return results from these domains
|
|
87
|
+
* - ExcludeDomains: Never return results from these domains
|
|
88
|
+
*
|
|
89
|
+
* @returns Search results, and the synthesized answer when requested
|
|
90
|
+
*/
|
|
91
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
92
|
+
/** Pull whatever explanation the error body carries, without assuming a shape. */
|
|
93
|
+
private describeErrorBody;
|
|
94
|
+
private getStringParam;
|
|
95
|
+
private getBooleanParam;
|
|
96
|
+
private getNumericParam;
|
|
97
|
+
private getOptionalNumericParam;
|
|
98
|
+
/**
|
|
99
|
+
* A list param, accepted as a real array or as a comma-separated string —
|
|
100
|
+
* both forms arrive in practice, from agent input mappings and from humans
|
|
101
|
+
* respectively.
|
|
102
|
+
*/
|
|
103
|
+
private getStringArrayParam;
|
|
104
|
+
private addOutputParam;
|
|
105
|
+
private createErrorResult;
|
|
106
|
+
}
|
|
107
|
+
export declare function LoadTavilySearchAction(): void;
|
|
108
|
+
//# sourceMappingURL=tavily-search.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tavily-search.action.d.ts","sourceRoot":"","sources":["../../../src/custom/web/tavily-search.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKrD,iDAAiD;AACjD,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IAC9C,2CAA2C;IAC3C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAM;IACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAM;IACjD,OAAO,CAAC,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