@thanh01.pmt/research-kit 1.0.0 → 1.1.1
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/LICENSE +21 -0
- package/README.md +213 -0
- package/dist/academic/index.cjs +332 -127
- package/dist/academic/index.cjs.map +1 -1
- package/dist/academic/index.d.cts +3 -3
- package/dist/academic/index.d.ts +3 -3
- package/dist/academic/index.js +2 -2
- package/dist/{catalogBuilder-8A-Dg_A-.d.ts → catalogBuilder-CmmQzUnf.d.ts} +11 -3
- package/dist/{catalogBuilder-feU79wQQ.d.cts → catalogBuilder-DgXYxL2F.d.cts} +11 -3
- package/dist/chunk-2JEVBCIF.js +3 -0
- package/dist/{chunk-KGCDYFFD.js.map → chunk-2JEVBCIF.js.map} +1 -1
- package/dist/chunk-2XIEWCUE.js +244 -0
- package/dist/chunk-2XIEWCUE.js.map +1 -0
- package/dist/chunk-AUGVVZTL.js +514 -0
- package/dist/chunk-AUGVVZTL.js.map +1 -0
- package/dist/chunk-DOXSPRSP.js +559 -0
- package/dist/chunk-DOXSPRSP.js.map +1 -0
- package/dist/chunk-GKF3NDEX.js +162 -0
- package/dist/chunk-GKF3NDEX.js.map +1 -0
- package/dist/chunk-J3VCGH7Z.js +3 -0
- package/dist/chunk-J3VCGH7Z.js.map +1 -0
- package/dist/{chunk-67V2GJGK.js → chunk-J7XKDMGL.js} +7 -5
- package/dist/chunk-J7XKDMGL.js.map +1 -0
- package/dist/chunk-KAFQVI2R.js +333 -0
- package/dist/chunk-KAFQVI2R.js.map +1 -0
- package/dist/chunk-XIF5YNI7.js +799 -0
- package/dist/chunk-XIF5YNI7.js.map +1 -0
- package/dist/config/index.cjs +5 -3
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.d.cts +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -1
- package/dist/evidence/index.cjs +337 -21
- package/dist/evidence/index.cjs.map +1 -1
- package/dist/evidence/index.d.cts +44 -7
- package/dist/evidence/index.d.ts +44 -7
- package/dist/evidence/index.js +3 -2
- package/dist/harvester/index.cjs +805 -64
- package/dist/harvester/index.cjs.map +1 -1
- package/dist/harvester/index.d.cts +79 -8
- package/dist/harvester/index.d.ts +79 -8
- package/dist/harvester/index.js +3 -2
- package/dist/{index-BU5n1ip_.d.ts → index-t8pahlJ4.d.cts} +104 -15
- package/dist/{index-BU5n1ip_.d.cts → index-t8pahlJ4.d.ts} +104 -15
- package/dist/index.cjs +2001 -252
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +156 -8
- package/dist/index.d.ts +156 -8
- package/dist/index.js +237 -8
- package/dist/index.js.map +1 -1
- package/dist/literatureReview-BTPFe7eb.d.cts +64 -0
- package/dist/literatureReview-hGbfrBmw.d.ts +64 -0
- package/dist/pipeline/index.cjs +1570 -241
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.d.cts +49 -9
- package/dist/pipeline/index.d.ts +49 -9
- package/dist/pipeline/index.js +5 -4
- package/dist/webScraper-BhiQ8s9x.d.ts +68 -0
- package/dist/webScraper-D9Ldus9p.d.cts +68 -0
- package/package.json +8 -9
- package/dist/chunk-47L7ZHMY.js +0 -316
- package/dist/chunk-47L7ZHMY.js.map +0 -1
- package/dist/chunk-63X2HPCI.js +0 -47
- package/dist/chunk-63X2HPCI.js.map +0 -1
- package/dist/chunk-67V2GJGK.js.map +0 -1
- package/dist/chunk-6Q2XCUG7.js +0 -40
- package/dist/chunk-6Q2XCUG7.js.map +0 -1
- package/dist/chunk-KGCDYFFD.js +0 -3
- package/dist/chunk-MHAYD555.js +0 -239
- package/dist/chunk-MHAYD555.js.map +0 -1
- package/dist/chunk-MPLDSHFM.js +0 -396
- package/dist/chunk-MPLDSHFM.js.map +0 -1
- package/dist/chunk-QZNLB5X4.js +0 -65
- package/dist/chunk-QZNLB5X4.js.map +0 -1
- package/dist/literatureReview-C4AgVljZ.d.ts +0 -43
- package/dist/literatureReview-Dlods4Aw.d.cts +0 -43
- package/dist/webScraper-pKzdXhfI.d.ts +0 -46
- package/dist/webScraper-yBcYOHoL.d.cts +0 -46
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TechnicalDomain, S as ScrapedDocument } from '../webScraper-
|
|
2
|
-
import {
|
|
3
|
-
import { C as CS2023KnowledgeArea, L as LiteratureReviewReport } from '../literatureReview-
|
|
4
|
-
import { R as ResourceCatalogBundle } from '../catalogBuilder-
|
|
1
|
+
import { T as TechnicalDomain, S as ScrapedDocument } from '../webScraper-D9Ldus9p.cjs';
|
|
2
|
+
import { C as CourseResearchContext, L as LlmTextFn, A as AcademicPaper, E as ExtractedConceptNode, f as SynthesizedResearchInsights, R as ResearchApiKeys, h as ResearchConfig, a as CustomSearchAdapter, b as CustomCrawlerAdapter, c as CustomAcademicSearchAdapter, d as CustomSynthesizerAdapter } from '../index-t8pahlJ4.cjs';
|
|
3
|
+
import { C as CS2023KnowledgeArea, a as CSTAK12Strand, L as LiteratureReviewReport } from '../literatureReview-BTPFe7eb.cjs';
|
|
4
|
+
import { R as ResourceCatalogBundle } from '../catalogBuilder-DgXYxL2F.cjs';
|
|
5
5
|
import { a as ProvenanceSidecar } from '../provenanceTracker-ct4s5lJV.cjs';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
@@ -15,19 +15,30 @@ interface ResearchPlan {
|
|
|
15
15
|
planMd: string;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Creates and formats MASTER_RESEARCH_PLAN.md with
|
|
18
|
+
* Creates and formats MASTER_RESEARCH_PLAN.md with Context-Aware Multi-Angle Queries
|
|
19
|
+
* (Technical Ground Truth + Pedagogical Exemplars + Learner Misconceptions/Pitfalls).
|
|
19
20
|
*/
|
|
20
21
|
declare class CampaignPlanner {
|
|
21
22
|
createPlan(topic: string, domain: TechnicalDomain, options?: {
|
|
22
23
|
maxRounds?: number;
|
|
23
24
|
isDeep?: boolean;
|
|
25
|
+
context?: CourseResearchContext;
|
|
24
26
|
}): ResearchPlan;
|
|
27
|
+
/**
|
|
28
|
+
* Optional LLM-augmented query planner when the host app provides an `llm` callback.
|
|
29
|
+
*/
|
|
30
|
+
createPlanWithLlm(topic: string, domain: TechnicalDomain, options?: {
|
|
31
|
+
maxRounds?: number;
|
|
32
|
+
isDeep?: boolean;
|
|
33
|
+
context?: CourseResearchContext;
|
|
34
|
+
llm?: LlmTextFn;
|
|
35
|
+
}): Promise<ResearchPlan>;
|
|
25
36
|
}
|
|
26
37
|
|
|
27
38
|
interface ReferenceRegistryItem {
|
|
28
39
|
id: string;
|
|
29
40
|
title: string;
|
|
30
|
-
sourceType: 'official_docs' | 'academic_paper' | 'community_repo' | 'industry_standard';
|
|
41
|
+
sourceType: 'official_docs' | 'academic_paper' | 'video_transcript' | 'community_repo' | 'industry_standard';
|
|
31
42
|
url: string;
|
|
32
43
|
relevanceScore: number;
|
|
33
44
|
extractedKeyTakeaways: string[];
|
|
@@ -37,17 +48,23 @@ interface ReferencePackOutput {
|
|
|
37
48
|
referencePackMd: string;
|
|
38
49
|
}
|
|
39
50
|
/**
|
|
40
|
-
* Compiles the canonical REFERENCE_PACK.md & REFERENCE_REGISTRY.json
|
|
51
|
+
* Compiles the canonical REFERENCE_PACK.md & REFERENCE_REGISTRY.json with real extracted takeaways,
|
|
52
|
+
* accurate code fence languages, synthesized misconceptions/exemplars, and bilingual concept anchors.
|
|
41
53
|
*/
|
|
42
54
|
declare class ReferencePackBuilder {
|
|
43
55
|
buildReferencePack(topic: string, domain: TechnicalDomain, options?: {
|
|
44
56
|
cs2023Area?: CS2023KnowledgeArea;
|
|
57
|
+
k12Strand?: CSTAK12Strand;
|
|
58
|
+
context?: CourseResearchContext;
|
|
45
59
|
scrapedDocs?: {
|
|
46
60
|
doc: ScrapedDocument;
|
|
47
61
|
score: number;
|
|
48
62
|
summary: string;
|
|
63
|
+
keyTakeaways?: string[];
|
|
49
64
|
}[];
|
|
50
65
|
academicPapers?: AcademicPaper[];
|
|
66
|
+
concepts?: ExtractedConceptNode[];
|
|
67
|
+
synthesizedInsights?: SynthesizedResearchInsights;
|
|
51
68
|
}): ReferencePackOutput;
|
|
52
69
|
}
|
|
53
70
|
|
|
@@ -55,13 +72,21 @@ interface HarvestPipelineOptions {
|
|
|
55
72
|
domain?: string;
|
|
56
73
|
maxRounds?: number;
|
|
57
74
|
isDeep?: boolean;
|
|
75
|
+
crawl4aiHost?: string;
|
|
58
76
|
tavilyKey?: string;
|
|
59
77
|
exaKey?: string;
|
|
78
|
+
jinaKey?: string;
|
|
79
|
+
serperKey?: string;
|
|
60
80
|
semanticScholarKey?: string;
|
|
81
|
+
apiKeys?: ResearchApiKeys;
|
|
82
|
+
allowEnvFallback?: boolean;
|
|
83
|
+
context?: CourseResearchContext;
|
|
84
|
+
llm?: LlmTextFn;
|
|
61
85
|
config?: Partial<ResearchConfig>;
|
|
62
86
|
customSearchAdapter?: CustomSearchAdapter;
|
|
63
87
|
customCrawlerAdapter?: CustomCrawlerAdapter;
|
|
64
88
|
customAcademicSearchAdapter?: CustomAcademicSearchAdapter;
|
|
89
|
+
customSynthesizerAdapter?: CustomSynthesizerAdapter;
|
|
65
90
|
onProgress?: (stage: string, message: string) => void;
|
|
66
91
|
}
|
|
67
92
|
interface HarvestPipelineResult {
|
|
@@ -72,10 +97,14 @@ interface HarvestPipelineResult {
|
|
|
72
97
|
literatureReview: LiteratureReviewReport;
|
|
73
98
|
referencePack: ReferencePackOutput;
|
|
74
99
|
provenance: ProvenanceSidecar;
|
|
100
|
+
concepts: ExtractedConceptNode[];
|
|
101
|
+
conceptDagTsv: string;
|
|
102
|
+
synthesizedInsights: SynthesizedResearchInsights;
|
|
75
103
|
totalDocumentsScraped: number;
|
|
76
104
|
}
|
|
105
|
+
declare function normalizeUrlForDedup(rawUrl: string): string;
|
|
77
106
|
/**
|
|
78
|
-
* Autonomous Multi-Round Deep Research & Academic Harvester Pipeline with
|
|
107
|
+
* Autonomous Multi-Round Deep Research & Academic Harvester Pipeline with Host API Key & LLM Injection
|
|
79
108
|
*/
|
|
80
109
|
declare class HarvestPipeline {
|
|
81
110
|
private searchEngine;
|
|
@@ -88,15 +117,26 @@ declare class HarvestPipeline {
|
|
|
88
117
|
private litReviewSynthesizer;
|
|
89
118
|
private planner;
|
|
90
119
|
private refPackBuilder;
|
|
120
|
+
private termExtractor;
|
|
121
|
+
private customSynthesizer?;
|
|
122
|
+
private defaultLlm?;
|
|
91
123
|
constructor(options?: {
|
|
92
124
|
tavilyKey?: string;
|
|
93
125
|
exaKey?: string;
|
|
126
|
+
jinaKey?: string;
|
|
127
|
+
serperKey?: string;
|
|
128
|
+
semanticScholarKey?: string;
|
|
129
|
+
apiKeys?: ResearchApiKeys;
|
|
130
|
+
allowEnvFallback?: boolean;
|
|
94
131
|
crawl4aiHost?: string;
|
|
132
|
+
llm?: LlmTextFn;
|
|
95
133
|
customSearchAdapter?: CustomSearchAdapter;
|
|
96
134
|
customCrawlerAdapter?: CustomCrawlerAdapter;
|
|
97
135
|
customAcademicSearchAdapter?: CustomAcademicSearchAdapter;
|
|
136
|
+
customSynthesizerAdapter?: CustomSynthesizerAdapter;
|
|
98
137
|
});
|
|
99
138
|
run(topic: string, options?: HarvestPipelineOptions): Promise<HarvestPipelineResult>;
|
|
139
|
+
private synthesizeInsights;
|
|
100
140
|
}
|
|
101
141
|
|
|
102
|
-
export { CampaignPlanner, HarvestPipeline, type HarvestPipelineOptions, type HarvestPipelineResult, ReferencePackBuilder, type ReferencePackOutput, type ReferenceRegistryItem, type ResearchPlan };
|
|
142
|
+
export { CampaignPlanner, HarvestPipeline, type HarvestPipelineOptions, type HarvestPipelineResult, ReferencePackBuilder, type ReferencePackOutput, type ReferenceRegistryItem, type ResearchPlan, normalizeUrlForDedup };
|
package/dist/pipeline/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TechnicalDomain, S as ScrapedDocument } from '../webScraper-
|
|
2
|
-
import {
|
|
3
|
-
import { C as CS2023KnowledgeArea, L as LiteratureReviewReport } from '../literatureReview-
|
|
4
|
-
import { R as ResourceCatalogBundle } from '../catalogBuilder-
|
|
1
|
+
import { T as TechnicalDomain, S as ScrapedDocument } from '../webScraper-BhiQ8s9x.js';
|
|
2
|
+
import { C as CourseResearchContext, L as LlmTextFn, A as AcademicPaper, E as ExtractedConceptNode, f as SynthesizedResearchInsights, R as ResearchApiKeys, h as ResearchConfig, a as CustomSearchAdapter, b as CustomCrawlerAdapter, c as CustomAcademicSearchAdapter, d as CustomSynthesizerAdapter } from '../index-t8pahlJ4.js';
|
|
3
|
+
import { C as CS2023KnowledgeArea, a as CSTAK12Strand, L as LiteratureReviewReport } from '../literatureReview-hGbfrBmw.js';
|
|
4
|
+
import { R as ResourceCatalogBundle } from '../catalogBuilder-CmmQzUnf.js';
|
|
5
5
|
import { a as ProvenanceSidecar } from '../provenanceTracker-ct4s5lJV.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
@@ -15,19 +15,30 @@ interface ResearchPlan {
|
|
|
15
15
|
planMd: string;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Creates and formats MASTER_RESEARCH_PLAN.md with
|
|
18
|
+
* Creates and formats MASTER_RESEARCH_PLAN.md with Context-Aware Multi-Angle Queries
|
|
19
|
+
* (Technical Ground Truth + Pedagogical Exemplars + Learner Misconceptions/Pitfalls).
|
|
19
20
|
*/
|
|
20
21
|
declare class CampaignPlanner {
|
|
21
22
|
createPlan(topic: string, domain: TechnicalDomain, options?: {
|
|
22
23
|
maxRounds?: number;
|
|
23
24
|
isDeep?: boolean;
|
|
25
|
+
context?: CourseResearchContext;
|
|
24
26
|
}): ResearchPlan;
|
|
27
|
+
/**
|
|
28
|
+
* Optional LLM-augmented query planner when the host app provides an `llm` callback.
|
|
29
|
+
*/
|
|
30
|
+
createPlanWithLlm(topic: string, domain: TechnicalDomain, options?: {
|
|
31
|
+
maxRounds?: number;
|
|
32
|
+
isDeep?: boolean;
|
|
33
|
+
context?: CourseResearchContext;
|
|
34
|
+
llm?: LlmTextFn;
|
|
35
|
+
}): Promise<ResearchPlan>;
|
|
25
36
|
}
|
|
26
37
|
|
|
27
38
|
interface ReferenceRegistryItem {
|
|
28
39
|
id: string;
|
|
29
40
|
title: string;
|
|
30
|
-
sourceType: 'official_docs' | 'academic_paper' | 'community_repo' | 'industry_standard';
|
|
41
|
+
sourceType: 'official_docs' | 'academic_paper' | 'video_transcript' | 'community_repo' | 'industry_standard';
|
|
31
42
|
url: string;
|
|
32
43
|
relevanceScore: number;
|
|
33
44
|
extractedKeyTakeaways: string[];
|
|
@@ -37,17 +48,23 @@ interface ReferencePackOutput {
|
|
|
37
48
|
referencePackMd: string;
|
|
38
49
|
}
|
|
39
50
|
/**
|
|
40
|
-
* Compiles the canonical REFERENCE_PACK.md & REFERENCE_REGISTRY.json
|
|
51
|
+
* Compiles the canonical REFERENCE_PACK.md & REFERENCE_REGISTRY.json with real extracted takeaways,
|
|
52
|
+
* accurate code fence languages, synthesized misconceptions/exemplars, and bilingual concept anchors.
|
|
41
53
|
*/
|
|
42
54
|
declare class ReferencePackBuilder {
|
|
43
55
|
buildReferencePack(topic: string, domain: TechnicalDomain, options?: {
|
|
44
56
|
cs2023Area?: CS2023KnowledgeArea;
|
|
57
|
+
k12Strand?: CSTAK12Strand;
|
|
58
|
+
context?: CourseResearchContext;
|
|
45
59
|
scrapedDocs?: {
|
|
46
60
|
doc: ScrapedDocument;
|
|
47
61
|
score: number;
|
|
48
62
|
summary: string;
|
|
63
|
+
keyTakeaways?: string[];
|
|
49
64
|
}[];
|
|
50
65
|
academicPapers?: AcademicPaper[];
|
|
66
|
+
concepts?: ExtractedConceptNode[];
|
|
67
|
+
synthesizedInsights?: SynthesizedResearchInsights;
|
|
51
68
|
}): ReferencePackOutput;
|
|
52
69
|
}
|
|
53
70
|
|
|
@@ -55,13 +72,21 @@ interface HarvestPipelineOptions {
|
|
|
55
72
|
domain?: string;
|
|
56
73
|
maxRounds?: number;
|
|
57
74
|
isDeep?: boolean;
|
|
75
|
+
crawl4aiHost?: string;
|
|
58
76
|
tavilyKey?: string;
|
|
59
77
|
exaKey?: string;
|
|
78
|
+
jinaKey?: string;
|
|
79
|
+
serperKey?: string;
|
|
60
80
|
semanticScholarKey?: string;
|
|
81
|
+
apiKeys?: ResearchApiKeys;
|
|
82
|
+
allowEnvFallback?: boolean;
|
|
83
|
+
context?: CourseResearchContext;
|
|
84
|
+
llm?: LlmTextFn;
|
|
61
85
|
config?: Partial<ResearchConfig>;
|
|
62
86
|
customSearchAdapter?: CustomSearchAdapter;
|
|
63
87
|
customCrawlerAdapter?: CustomCrawlerAdapter;
|
|
64
88
|
customAcademicSearchAdapter?: CustomAcademicSearchAdapter;
|
|
89
|
+
customSynthesizerAdapter?: CustomSynthesizerAdapter;
|
|
65
90
|
onProgress?: (stage: string, message: string) => void;
|
|
66
91
|
}
|
|
67
92
|
interface HarvestPipelineResult {
|
|
@@ -72,10 +97,14 @@ interface HarvestPipelineResult {
|
|
|
72
97
|
literatureReview: LiteratureReviewReport;
|
|
73
98
|
referencePack: ReferencePackOutput;
|
|
74
99
|
provenance: ProvenanceSidecar;
|
|
100
|
+
concepts: ExtractedConceptNode[];
|
|
101
|
+
conceptDagTsv: string;
|
|
102
|
+
synthesizedInsights: SynthesizedResearchInsights;
|
|
75
103
|
totalDocumentsScraped: number;
|
|
76
104
|
}
|
|
105
|
+
declare function normalizeUrlForDedup(rawUrl: string): string;
|
|
77
106
|
/**
|
|
78
|
-
* Autonomous Multi-Round Deep Research & Academic Harvester Pipeline with
|
|
107
|
+
* Autonomous Multi-Round Deep Research & Academic Harvester Pipeline with Host API Key & LLM Injection
|
|
79
108
|
*/
|
|
80
109
|
declare class HarvestPipeline {
|
|
81
110
|
private searchEngine;
|
|
@@ -88,15 +117,26 @@ declare class HarvestPipeline {
|
|
|
88
117
|
private litReviewSynthesizer;
|
|
89
118
|
private planner;
|
|
90
119
|
private refPackBuilder;
|
|
120
|
+
private termExtractor;
|
|
121
|
+
private customSynthesizer?;
|
|
122
|
+
private defaultLlm?;
|
|
91
123
|
constructor(options?: {
|
|
92
124
|
tavilyKey?: string;
|
|
93
125
|
exaKey?: string;
|
|
126
|
+
jinaKey?: string;
|
|
127
|
+
serperKey?: string;
|
|
128
|
+
semanticScholarKey?: string;
|
|
129
|
+
apiKeys?: ResearchApiKeys;
|
|
130
|
+
allowEnvFallback?: boolean;
|
|
94
131
|
crawl4aiHost?: string;
|
|
132
|
+
llm?: LlmTextFn;
|
|
95
133
|
customSearchAdapter?: CustomSearchAdapter;
|
|
96
134
|
customCrawlerAdapter?: CustomCrawlerAdapter;
|
|
97
135
|
customAcademicSearchAdapter?: CustomAcademicSearchAdapter;
|
|
136
|
+
customSynthesizerAdapter?: CustomSynthesizerAdapter;
|
|
98
137
|
});
|
|
99
138
|
run(topic: string, options?: HarvestPipelineOptions): Promise<HarvestPipelineResult>;
|
|
139
|
+
private synthesizeInsights;
|
|
100
140
|
}
|
|
101
141
|
|
|
102
|
-
export { CampaignPlanner, HarvestPipeline, type HarvestPipelineOptions, type HarvestPipelineResult, ReferencePackBuilder, type ReferencePackOutput, type ReferenceRegistryItem, type ResearchPlan };
|
|
142
|
+
export { CampaignPlanner, HarvestPipeline, type HarvestPipelineOptions, type HarvestPipelineResult, ReferencePackBuilder, type ReferencePackOutput, type ReferenceRegistryItem, type ResearchPlan, normalizeUrlForDedup };
|
package/dist/pipeline/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { CampaignPlanner, HarvestPipeline, ReferencePackBuilder } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { CampaignPlanner, HarvestPipeline, ReferencePackBuilder, normalizeUrlForDedup } from '../chunk-AUGVVZTL.js';
|
|
2
|
+
import '../chunk-DOXSPRSP.js';
|
|
3
|
+
import '../chunk-XIF5YNI7.js';
|
|
4
|
+
import '../chunk-GKF3NDEX.js';
|
|
5
|
+
import '../chunk-KAFQVI2R.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { C as CourseResearchContext, b as CustomCrawlerAdapter } from './index-t8pahlJ4.js';
|
|
2
|
+
|
|
3
|
+
type TechnicalDomain = 'hardware' | 'software' | 'platform' | 'academic';
|
|
4
|
+
interface DomainClassificationResult {
|
|
5
|
+
domain: TechnicalDomain;
|
|
6
|
+
confidence: number;
|
|
7
|
+
rationale: string;
|
|
8
|
+
recommendedExtractors: string[];
|
|
9
|
+
primaryCodeLanguage: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Infers the primary code fence language from topic and optional course context.
|
|
13
|
+
* Never silently defaults to 'swift' unless Swift is actually present.
|
|
14
|
+
*/
|
|
15
|
+
declare function inferPrimaryCodeLanguage(topic: string, context?: CourseResearchContext, domain?: TechnicalDomain): string;
|
|
16
|
+
/**
|
|
17
|
+
* Domain Classifier supporting English & Vietnamese CS/STEM/EdTech topics and CourseResearchContext
|
|
18
|
+
*/
|
|
19
|
+
declare function classifyTechnicalDomain(topic: string, explicitDomain?: string, context?: CourseResearchContext): DomainClassificationResult;
|
|
20
|
+
|
|
21
|
+
interface ExtractedCodeBlock {
|
|
22
|
+
language: string;
|
|
23
|
+
code: string;
|
|
24
|
+
}
|
|
25
|
+
interface ScrapedDocument {
|
|
26
|
+
url: string;
|
|
27
|
+
title: string;
|
|
28
|
+
markdownContent: string;
|
|
29
|
+
byteSize: number;
|
|
30
|
+
extractedCodeSnippets: string[];
|
|
31
|
+
extractedCodeBlocks?: ExtractedCodeBlock[];
|
|
32
|
+
extractedTables?: string[];
|
|
33
|
+
extractedHeadings?: string[];
|
|
34
|
+
keyExcerpts?: string[];
|
|
35
|
+
tablesCount: number;
|
|
36
|
+
fetchProvider: 'jina' | 'crawl4ai' | 'youtube' | 'direct' | 'custom';
|
|
37
|
+
}
|
|
38
|
+
interface WebScraperOptions {
|
|
39
|
+
crawl4aiHost?: string;
|
|
40
|
+
jinaKey?: string;
|
|
41
|
+
allowEnvFallback?: boolean;
|
|
42
|
+
customAdapter?: CustomCrawlerAdapter;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Extracts top substantive paragraphs from Markdown (stripping navigation, links-only lines, and cookie banners).
|
|
46
|
+
*/
|
|
47
|
+
declare function extractSubstantiveExcerpts(markdown: string, maxExcerpts?: number): string[];
|
|
48
|
+
/**
|
|
49
|
+
* High-fidelity web content & YouTube transcript extractor with Custom Crawler & Jina Auth support
|
|
50
|
+
*/
|
|
51
|
+
declare class WebScraper {
|
|
52
|
+
private crawl4aiHost?;
|
|
53
|
+
private jinaKey?;
|
|
54
|
+
private allowEnvFallback;
|
|
55
|
+
private customAdapter?;
|
|
56
|
+
private youtubeService;
|
|
57
|
+
constructor(options?: WebScraperOptions);
|
|
58
|
+
setCustomAdapter(adapter: CustomCrawlerAdapter): void;
|
|
59
|
+
setJinaKey(key?: string): void;
|
|
60
|
+
scrapeUrl(targetUrl: string, options?: {
|
|
61
|
+
customAdapter?: CustomCrawlerAdapter;
|
|
62
|
+
jinaKey?: string;
|
|
63
|
+
preferredLanguages?: string[];
|
|
64
|
+
}): Promise<ScrapedDocument>;
|
|
65
|
+
private packageDocument;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { type DomainClassificationResult as D, type ExtractedCodeBlock as E, type ScrapedDocument as S, type TechnicalDomain as T, type WebScraperOptions as W, WebScraper as a, classifyTechnicalDomain as c, extractSubstantiveExcerpts as e, inferPrimaryCodeLanguage as i };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { C as CourseResearchContext, b as CustomCrawlerAdapter } from './index-t8pahlJ4.cjs';
|
|
2
|
+
|
|
3
|
+
type TechnicalDomain = 'hardware' | 'software' | 'platform' | 'academic';
|
|
4
|
+
interface DomainClassificationResult {
|
|
5
|
+
domain: TechnicalDomain;
|
|
6
|
+
confidence: number;
|
|
7
|
+
rationale: string;
|
|
8
|
+
recommendedExtractors: string[];
|
|
9
|
+
primaryCodeLanguage: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Infers the primary code fence language from topic and optional course context.
|
|
13
|
+
* Never silently defaults to 'swift' unless Swift is actually present.
|
|
14
|
+
*/
|
|
15
|
+
declare function inferPrimaryCodeLanguage(topic: string, context?: CourseResearchContext, domain?: TechnicalDomain): string;
|
|
16
|
+
/**
|
|
17
|
+
* Domain Classifier supporting English & Vietnamese CS/STEM/EdTech topics and CourseResearchContext
|
|
18
|
+
*/
|
|
19
|
+
declare function classifyTechnicalDomain(topic: string, explicitDomain?: string, context?: CourseResearchContext): DomainClassificationResult;
|
|
20
|
+
|
|
21
|
+
interface ExtractedCodeBlock {
|
|
22
|
+
language: string;
|
|
23
|
+
code: string;
|
|
24
|
+
}
|
|
25
|
+
interface ScrapedDocument {
|
|
26
|
+
url: string;
|
|
27
|
+
title: string;
|
|
28
|
+
markdownContent: string;
|
|
29
|
+
byteSize: number;
|
|
30
|
+
extractedCodeSnippets: string[];
|
|
31
|
+
extractedCodeBlocks?: ExtractedCodeBlock[];
|
|
32
|
+
extractedTables?: string[];
|
|
33
|
+
extractedHeadings?: string[];
|
|
34
|
+
keyExcerpts?: string[];
|
|
35
|
+
tablesCount: number;
|
|
36
|
+
fetchProvider: 'jina' | 'crawl4ai' | 'youtube' | 'direct' | 'custom';
|
|
37
|
+
}
|
|
38
|
+
interface WebScraperOptions {
|
|
39
|
+
crawl4aiHost?: string;
|
|
40
|
+
jinaKey?: string;
|
|
41
|
+
allowEnvFallback?: boolean;
|
|
42
|
+
customAdapter?: CustomCrawlerAdapter;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Extracts top substantive paragraphs from Markdown (stripping navigation, links-only lines, and cookie banners).
|
|
46
|
+
*/
|
|
47
|
+
declare function extractSubstantiveExcerpts(markdown: string, maxExcerpts?: number): string[];
|
|
48
|
+
/**
|
|
49
|
+
* High-fidelity web content & YouTube transcript extractor with Custom Crawler & Jina Auth support
|
|
50
|
+
*/
|
|
51
|
+
declare class WebScraper {
|
|
52
|
+
private crawl4aiHost?;
|
|
53
|
+
private jinaKey?;
|
|
54
|
+
private allowEnvFallback;
|
|
55
|
+
private customAdapter?;
|
|
56
|
+
private youtubeService;
|
|
57
|
+
constructor(options?: WebScraperOptions);
|
|
58
|
+
setCustomAdapter(adapter: CustomCrawlerAdapter): void;
|
|
59
|
+
setJinaKey(key?: string): void;
|
|
60
|
+
scrapeUrl(targetUrl: string, options?: {
|
|
61
|
+
customAdapter?: CustomCrawlerAdapter;
|
|
62
|
+
jinaKey?: string;
|
|
63
|
+
preferredLanguages?: string[];
|
|
64
|
+
}): Promise<ScrapedDocument>;
|
|
65
|
+
private packageDocument;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { type DomainClassificationResult as D, type ExtractedCodeBlock as E, type ScrapedDocument as S, type TechnicalDomain as T, type WebScraperOptions as W, WebScraper as a, classifyTechnicalDomain as c, extractSubstantiveExcerpts as e, inferPrimaryCodeLanguage as i };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thanh01.pmt/research-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "An autonomous Deep Research, Academic Harvest & Evidence Verification Engine for Curriculum OS & AI Agents.",
|
|
5
5
|
"author": "Thanh Pham <https://github.com/thanh01pmt>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,13 +46,6 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"clean": "rm -rf dist",
|
|
51
|
-
"build": "npm run clean && tsup",
|
|
52
|
-
"test": "vitest run",
|
|
53
|
-
"typecheck": "tsc --noEmit",
|
|
54
|
-
"prepublishOnly": "npm run build && npm test"
|
|
55
|
-
},
|
|
56
49
|
"dependencies": {
|
|
57
50
|
"zod": "^3.23.8"
|
|
58
51
|
},
|
|
@@ -60,5 +53,11 @@
|
|
|
60
53
|
"tsup": "^8.3.5",
|
|
61
54
|
"typescript": "^5.6.3",
|
|
62
55
|
"vitest": "^2.1.8"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"clean": "rm -rf dist",
|
|
59
|
+
"build": "npm run clean && tsup",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"typecheck": "tsc --noEmit"
|
|
63
62
|
}
|
|
64
|
-
}
|
|
63
|
+
}
|