@thanh01.pmt/research-kit 1.2.3 → 1.3.0
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/academic/index.cjs +122 -0
- package/dist/academic/index.cjs.map +1 -1
- package/dist/academic/index.d.cts +27 -4
- package/dist/academic/index.d.ts +27 -4
- package/dist/academic/index.js +2 -1
- package/dist/agent/index.cjs +3441 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +10 -0
- package/dist/agent/index.d.ts +10 -0
- package/dist/agent/index.js +10 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/{catalogBuilder-B4eiLS_S.d.cts → catalogBuilder-BBCa9jqI.d.cts} +2 -2
- package/dist/{catalogBuilder-BNB_gaWP.d.ts → catalogBuilder-D-UiM37y.d.ts} +2 -2
- package/dist/chunk-2GBXVPOQ.js +3 -0
- package/dist/{chunk-J3VCGH7Z.js.map → chunk-2GBXVPOQ.js.map} +1 -1
- package/dist/chunk-2RMBLKP5.js +581 -0
- package/dist/chunk-2RMBLKP5.js.map +1 -0
- package/dist/{chunk-2XIEWCUE.js → chunk-32B5PVTQ.js} +2 -2
- package/dist/{chunk-2XIEWCUE.js.map → chunk-32B5PVTQ.js.map} +1 -1
- package/dist/chunk-LDCZ33AC.js +3 -0
- package/dist/chunk-LDCZ33AC.js.map +1 -0
- package/dist/chunk-NSY6KU4G.js +125 -0
- package/dist/chunk-NSY6KU4G.js.map +1 -0
- package/dist/{chunk-SAHBBO3U.js → chunk-RYLZYZRF.js} +4 -580
- package/dist/chunk-RYLZYZRF.js.map +1 -0
- package/dist/{chunk-P6RHBJY2.js → chunk-S3JUCDKD.js} +62 -40
- package/dist/chunk-S3JUCDKD.js.map +1 -0
- package/dist/chunk-TYQEC24G.js +3 -0
- package/dist/chunk-TYQEC24G.js.map +1 -0
- package/dist/chunk-WWQ45RQK.js +1114 -0
- package/dist/chunk-WWQ45RQK.js.map +1 -0
- package/dist/{chunk-YICMTZS5.js → chunk-ZNGU4ZYX.js} +171 -3
- package/dist/chunk-ZNGU4ZYX.js.map +1 -0
- package/dist/config/index.d.cts +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/evidence/index.d.cts +2 -2
- package/dist/evidence/index.d.ts +2 -2
- package/dist/evidence/index.js +2 -1
- package/dist/harvester/index.cjs +168 -1
- package/dist/harvester/index.cjs.map +1 -1
- package/dist/harvester/index.d.cts +5 -161
- package/dist/harvester/index.d.ts +5 -161
- package/dist/harvester/index.js +4 -2
- package/dist/index-CN8gei7k.d.ts +518 -0
- package/dist/{index-9rDiFuR4.d.ts → index-CxoD81QN.d.cts} +1 -1
- package/dist/{index-9rDiFuR4.d.cts → index-CxoD81QN.d.ts} +1 -1
- package/dist/index-onQDKDNo.d.cts +518 -0
- package/dist/index.cjs +1463 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -174
- package/dist/index.d.ts +11 -174
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/dist/{literatureReview-DOzgm9Q2.d.ts → literatureReview-Bn2iEGRO.d.ts} +1 -1
- package/dist/{literatureReview-BwidpYJo.d.cts → literatureReview-Bvlqk4DB.d.cts} +1 -1
- package/dist/pipeline/index.cjs +59 -38
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.d.cts +5 -4
- package/dist/pipeline/index.d.ts +5 -4
- package/dist/pipeline/index.js +3 -2
- package/dist/socialPulseHarvester-CN4MwrpY.d.cts +204 -0
- package/dist/socialPulseHarvester-IbdT3zD1.d.ts +204 -0
- package/dist/{webScraper-CAQjE46m.d.cts → webScraper-BVvNW4yj.d.cts} +1 -1
- package/dist/{webScraper-CXIpvyA6.d.ts → webScraper-C9pB5Rgd.d.ts} +1 -1
- package/package.json +6 -1
- package/dist/chunk-J3VCGH7Z.js +0 -3
- package/dist/chunk-P6RHBJY2.js.map +0 -1
- package/dist/chunk-SAHBBO3U.js.map +0 -1
- package/dist/chunk-YICMTZS5.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ScrapedDocument, T as TechnicalDomain } from '../webScraper-
|
|
2
|
-
import { L as LlmTextFn,
|
|
1
|
+
import { S as ScrapedDocument, T as TechnicalDomain } from '../webScraper-BVvNW4yj.cjs';
|
|
2
|
+
import { L as LlmTextFn, a as CourseResearchContext } from '../index-CxoD81QN.cjs';
|
|
3
3
|
export { P as ProvenanceRecord, a as ProvenanceSidecar, b as ProvenanceTracker } from '../provenanceTracker-ct4s5lJV.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
package/dist/evidence/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ScrapedDocument, T as TechnicalDomain } from '../webScraper-
|
|
2
|
-
import { L as LlmTextFn,
|
|
1
|
+
import { S as ScrapedDocument, T as TechnicalDomain } from '../webScraper-C9pB5Rgd.js';
|
|
2
|
+
import { L as LlmTextFn, a as CourseResearchContext } from '../index-CxoD81QN.js';
|
|
3
3
|
export { P as ProvenanceRecord, a as ProvenanceSidecar, b as ProvenanceTracker } from '../provenanceTracker-ct4s5lJV.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
package/dist/evidence/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import '../chunk-TYQEC24G.js';
|
|
2
|
+
export { ClaimVerifier } from '../chunk-32B5PVTQ.js';
|
|
2
3
|
export { EvidenceScorer, ProvenanceTracker, extractTopSentences } from '../chunk-KXJDQBSJ.js';
|
|
3
4
|
import '../chunk-QQZQNBJC.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
package/dist/harvester/index.cjs
CHANGED
|
@@ -384,7 +384,7 @@ var MultiSourceSearchEngine = class {
|
|
|
384
384
|
if (adapter && (!preferred || preferred === "custom")) {
|
|
385
385
|
try {
|
|
386
386
|
const customResults = await adapter.search(query, { limit, domainFilter: options.domainFilter });
|
|
387
|
-
if (Array.isArray(customResults)
|
|
387
|
+
if (Array.isArray(customResults)) {
|
|
388
388
|
return customResults.map((r) => ({
|
|
389
389
|
title: r.title,
|
|
390
390
|
url: r.url,
|
|
@@ -2317,6 +2317,172 @@ var StemResourceResearcher = class {
|
|
|
2317
2317
|
}
|
|
2318
2318
|
};
|
|
2319
2319
|
|
|
2320
|
+
// src/harvester/socialPulseHarvester.ts
|
|
2321
|
+
var SocialPulseHarvester = class {
|
|
2322
|
+
constructor(searchEngine = new MultiSourceSearchEngine()) {
|
|
2323
|
+
this.searchEngine = searchEngine;
|
|
2324
|
+
}
|
|
2325
|
+
async harvest(topic, options = {}) {
|
|
2326
|
+
const recencyDays = Math.max(1, options.recencyDays ?? 30);
|
|
2327
|
+
const limitPerPlatform = options.limitPerPlatform ?? 4;
|
|
2328
|
+
const cutoffMs = Date.now() - recencyDays * 24 * 60 * 60 * 1e3;
|
|
2329
|
+
const cutoffUnixSec = Math.floor(cutoffMs / 1e3);
|
|
2330
|
+
const cutoffIsoDate = new Date(cutoffMs).toISOString().slice(0, 10);
|
|
2331
|
+
const items = [];
|
|
2332
|
+
const seenUrls = /* @__PURE__ */ new Set();
|
|
2333
|
+
const pushUnique = (item) => {
|
|
2334
|
+
const normUrl = item.url.trim().replace(/\/$/, "");
|
|
2335
|
+
if (!normUrl || seenUrls.has(normUrl)) return;
|
|
2336
|
+
seenUrls.add(normUrl);
|
|
2337
|
+
items.push(item);
|
|
2338
|
+
};
|
|
2339
|
+
const tasks = [];
|
|
2340
|
+
if (options.includeHackerNews !== false) {
|
|
2341
|
+
tasks.push(
|
|
2342
|
+
(async () => {
|
|
2343
|
+
try {
|
|
2344
|
+
const params = new URLSearchParams({
|
|
2345
|
+
query: topic,
|
|
2346
|
+
tags: "story",
|
|
2347
|
+
numericFilters: `created_at_i>${cutoffUnixSec}`,
|
|
2348
|
+
hitsPerPage: String(limitPerPlatform)
|
|
2349
|
+
});
|
|
2350
|
+
const res = await fetch(`https://hn.algolia.com/api/v1/search?${params.toString()}`, {
|
|
2351
|
+
headers: { "User-Agent": "OrchableResearchKit/1.3" },
|
|
2352
|
+
signal: AbortSignal.timeout(6500)
|
|
2353
|
+
});
|
|
2354
|
+
if (res.ok) {
|
|
2355
|
+
const data = await res.json();
|
|
2356
|
+
if (Array.isArray(data?.hits)) {
|
|
2357
|
+
for (const hit of data.hits) {
|
|
2358
|
+
const points = Number(hit.points) || 0;
|
|
2359
|
+
const comments = Number(hit.num_comments) || 0;
|
|
2360
|
+
const hnUrl = `https://news.ycombinator.com/item?id=${hit.objectID}`;
|
|
2361
|
+
const targetUrl = hit.url || hnUrl;
|
|
2362
|
+
const score = Math.min(10, Math.max(4, Math.round(4 + Math.log10(points + comments + 1) * 2)));
|
|
2363
|
+
pushUnique({
|
|
2364
|
+
id: `hn-${hit.objectID}`,
|
|
2365
|
+
platform: "hackernews",
|
|
2366
|
+
title: String(hit.title || "HackerNews Discussion"),
|
|
2367
|
+
url: targetUrl,
|
|
2368
|
+
snippet: `${hit.title} (${points} pts, ${comments} comments on HN: ${hnUrl})`,
|
|
2369
|
+
author: hit.author,
|
|
2370
|
+
createdAt: hit.created_at,
|
|
2371
|
+
engagementScore: score,
|
|
2372
|
+
rawMetrics: { points, comments }
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
} catch (e) {
|
|
2378
|
+
console.warn("[SocialPulseHarvester] HackerNews query failed:", e?.message || e);
|
|
2379
|
+
}
|
|
2380
|
+
})()
|
|
2381
|
+
);
|
|
2382
|
+
}
|
|
2383
|
+
if (options.includeGitHub !== false) {
|
|
2384
|
+
tasks.push(
|
|
2385
|
+
(async () => {
|
|
2386
|
+
try {
|
|
2387
|
+
const q = `${topic} pushed:>=${cutoffIsoDate}`;
|
|
2388
|
+
const params = new URLSearchParams({
|
|
2389
|
+
q,
|
|
2390
|
+
sort: "stars",
|
|
2391
|
+
order: "desc",
|
|
2392
|
+
per_page: String(limitPerPlatform)
|
|
2393
|
+
});
|
|
2394
|
+
const res = await fetch(`https://api.github.com/search/repositories?${params.toString()}`, {
|
|
2395
|
+
headers: {
|
|
2396
|
+
Accept: "application/vnd.github+json",
|
|
2397
|
+
"User-Agent": "OrchableResearchKit/1.3"
|
|
2398
|
+
},
|
|
2399
|
+
signal: AbortSignal.timeout(6500)
|
|
2400
|
+
});
|
|
2401
|
+
if (res.ok) {
|
|
2402
|
+
const data = await res.json();
|
|
2403
|
+
if (Array.isArray(data?.items)) {
|
|
2404
|
+
for (const repo of data.items) {
|
|
2405
|
+
const stars = Number(repo.stargazers_count) || 0;
|
|
2406
|
+
const score = Math.min(10, Math.max(5, Math.round(4 + Math.log10(stars + 1) * 1.8)));
|
|
2407
|
+
pushUnique({
|
|
2408
|
+
id: `gh-${repo.id || repo.full_name}`,
|
|
2409
|
+
platform: "github",
|
|
2410
|
+
title: `${repo.full_name}: ${repo.description || "GitHub Repository"}`.slice(0, 180),
|
|
2411
|
+
url: repo.html_url,
|
|
2412
|
+
snippet: `${repo.description || ""} [Stars: ${stars}, Language: ${repo.language || "N/A"}, Updated: ${String(repo.pushed_at || "").slice(0, 10)}]`.trim(),
|
|
2413
|
+
author: repo.owner?.login,
|
|
2414
|
+
createdAt: repo.pushed_at || repo.created_at,
|
|
2415
|
+
engagementScore: score,
|
|
2416
|
+
rawMetrics: { stars }
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
} catch (e) {
|
|
2422
|
+
console.warn("[SocialPulseHarvester] GitHub search failed:", e?.message || e);
|
|
2423
|
+
}
|
|
2424
|
+
})()
|
|
2425
|
+
);
|
|
2426
|
+
}
|
|
2427
|
+
if (options.includeRedditWeb !== false) {
|
|
2428
|
+
tasks.push(
|
|
2429
|
+
(async () => {
|
|
2430
|
+
try {
|
|
2431
|
+
const timeRange = recencyDays <= 7 ? "week" : recencyDays <= 35 ? "month" : "year";
|
|
2432
|
+
const hits = await this.searchEngine.search(`${topic} reddit OR community discussion pitfalls`, {
|
|
2433
|
+
limit: limitPerPlatform,
|
|
2434
|
+
timeRange
|
|
2435
|
+
});
|
|
2436
|
+
for (const [idx, h] of hits.entries()) {
|
|
2437
|
+
const isReddit = /reddit\.com/i.test(h.url);
|
|
2438
|
+
pushUnique({
|
|
2439
|
+
id: `pulse-${idx + 1}`,
|
|
2440
|
+
platform: isReddit ? "reddit" : "web",
|
|
2441
|
+
title: h.title,
|
|
2442
|
+
url: h.url,
|
|
2443
|
+
snippet: h.content.slice(0, 350),
|
|
2444
|
+
engagementScore: isReddit ? 7 : 6
|
|
2445
|
+
});
|
|
2446
|
+
}
|
|
2447
|
+
} catch (e) {
|
|
2448
|
+
console.warn("[SocialPulseHarvester] Recency web search failed:", e?.message || e);
|
|
2449
|
+
}
|
|
2450
|
+
})()
|
|
2451
|
+
);
|
|
2452
|
+
}
|
|
2453
|
+
await Promise.allSettled(tasks);
|
|
2454
|
+
items.sort((a, b) => b.engagementScore - a.engagementScore);
|
|
2455
|
+
const trendingReposAndTools = items.filter((i) => i.platform === "github").map((i) => `${i.title} (${i.url})`);
|
|
2456
|
+
const communityHighlights = items.slice(0, 6).map((i) => `[${i.platform.toUpperCase()}] ${i.title}: ${i.snippet}`);
|
|
2457
|
+
const mdLines = [
|
|
2458
|
+
`# \u{1F4E1} Social & Developer Pulse Report (Last ${recencyDays} Days): ${topic}`,
|
|
2459
|
+
`> **Harvested At:** \`${(/* @__PURE__ */ new Date()).toISOString()}\` | **Window:** \`Last ${recencyDays} days\` | **Total Signals:** \`${items.length}\``,
|
|
2460
|
+
`
|
|
2461
|
+
## 1. Community Signals & Discussions`,
|
|
2462
|
+
...items.length > 0 ? items.map(
|
|
2463
|
+
(item, idx) => `${idx + 1}. **[${item.platform.toUpperCase()}] [${item.title}](${item.url})** (Score: \`${item.engagementScore}/10\`)
|
|
2464
|
+
- ${item.snippet}`
|
|
2465
|
+
) : ["- No recent social pulse items found within the specified window."]
|
|
2466
|
+
];
|
|
2467
|
+
if (trendingReposAndTools.length > 0) {
|
|
2468
|
+
mdLines.push(
|
|
2469
|
+
`
|
|
2470
|
+
## 2. Active Repositories & Tooling`,
|
|
2471
|
+
...trendingReposAndTools.map((r) => `- ${r}`)
|
|
2472
|
+
);
|
|
2473
|
+
}
|
|
2474
|
+
return {
|
|
2475
|
+
topic,
|
|
2476
|
+
recencyDays,
|
|
2477
|
+
harvestedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2478
|
+
items,
|
|
2479
|
+
trendingReposAndTools,
|
|
2480
|
+
communityHighlights,
|
|
2481
|
+
markdownReport: mdLines.join("\n")
|
|
2482
|
+
};
|
|
2483
|
+
}
|
|
2484
|
+
};
|
|
2485
|
+
|
|
2320
2486
|
exports.CatalogBuilder = CatalogBuilder;
|
|
2321
2487
|
exports.ECOMMERCE_AND_COMMERCIAL_PATTERNS = ECOMMERCE_AND_COMMERCIAL_PATTERNS;
|
|
2322
2488
|
exports.ECOMMERCE_DOMAINS = ECOMMERCE_DOMAINS;
|
|
@@ -2326,6 +2492,7 @@ exports.MultiSourceSearchEngine = MultiSourceSearchEngine;
|
|
|
2326
2492
|
exports.NasaMediaClient = NasaMediaClient;
|
|
2327
2493
|
exports.OpenverseClient = OpenverseClient;
|
|
2328
2494
|
exports.PedagogicalTermExtractor = PedagogicalTermExtractor;
|
|
2495
|
+
exports.SocialPulseHarvester = SocialPulseHarvester;
|
|
2329
2496
|
exports.StemResourceResearcher = StemResourceResearcher;
|
|
2330
2497
|
exports.WebScraper = WebScraper;
|
|
2331
2498
|
exports.YouTubeIngestionService = YouTubeIngestionService;
|