@heripo/research-radar 6.4.1 → 6.4.2
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 -4
- package/dist/index.d.ts +668 -698
- package/dist/index.js +4915 -6013
- package/dist/index.js.map +1 -1
- package/package.json +26 -31
package/dist/index.d.ts
CHANGED
|
@@ -1,83 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LanguageModel, LanguageModelUsage } from
|
|
3
|
-
import { OpenAIProvider } from
|
|
4
|
-
|
|
1
|
+
import { AnalysisProvider as AnalysisProvider$1, AppLogger, ArticleDeadline, ArticleForGenerateContent, ArticleForUpdateByAnalysis, ContentGenerateProvider as ContentGenerateProvider$1, CrawlingProvider as CrawlingProvider$1, CrawlingTarget, CrawlingTargetGroup, DateService as DateService$1, EmailMessage, EmailService, ExtractArticleDeadlinesConfig, ExtractArticleDeadlinesResult, GenerateNewsletterConfig, HtmlTemplate, IsoDateString, Newsletter, ParsedTarget, PromptProvider, TaskService as TaskService$1, UnscoredArticle, UrlString } from "@llm-newsletter-kit/core";
|
|
2
|
+
import { LanguageModel, LanguageModelUsage } from "ai";
|
|
3
|
+
import { OpenAIProvider } from "@ai-sdk/openai";
|
|
5
4
|
/** Host-selected, published action matched against a freshly verified source. */
|
|
6
5
|
interface VerifiedDeadlineReminder {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
deadline: ArticleDeadline;
|
|
7
|
+
url: UrlString;
|
|
8
|
+
verificationStatus: 'verified';
|
|
9
|
+
/**
|
|
10
|
+
* Published issues in the past week that already listed this action.
|
|
11
|
+
* Host-supplied history; it only informs the reminder selection prompt.
|
|
12
|
+
*/
|
|
13
|
+
recentReminderCount?: number;
|
|
15
14
|
}
|
|
16
15
|
/** Days before the date an action first becomes eligible (D-3 through D-day). */
|
|
17
|
-
declare const DEADLINE_REMINDER_LEAD_DAYS = 3;
|
|
16
|
+
export declare const DEADLINE_REMINDER_LEAD_DAYS = 3;
|
|
18
17
|
/** Rows the unified deadline section displays. */
|
|
19
|
-
declare const DEADLINE_REMINDER_LIMIT = 10;
|
|
18
|
+
export declare const DEADLINE_REMINDER_LIMIT = 10;
|
|
20
19
|
/** A reminder that passed every display guard, with its normalized link. */
|
|
21
20
|
interface EligibleDeadlineReminder {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
reminder: VerifiedDeadlineReminder;
|
|
22
|
+
/** Calendar days from publication to the start date; negative while ongoing. */
|
|
23
|
+
days: number;
|
|
24
|
+
url: string;
|
|
26
25
|
}
|
|
27
26
|
/** Deterministic deadlines/events, no LLM context: the first rows by date. */
|
|
28
|
-
declare function renderVerifiedDeadlineReminders(reminders: VerifiedDeadlineReminder[], publicationDate: IsoDateString, now?: Date): string;
|
|
29
|
-
|
|
27
|
+
export declare function renderVerifiedDeadlineReminders(reminders: VerifiedDeadlineReminder[], publicationDate: IsoDateString, now?: Date): string;
|
|
30
28
|
/**
|
|
31
29
|
* Repository interface for task management
|
|
32
30
|
*/
|
|
33
31
|
interface TaskRepository {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Create and save a new task
|
|
34
|
+
* @returns Created task ID
|
|
35
|
+
*/
|
|
36
|
+
createTask(): Promise<number>;
|
|
37
|
+
/**
|
|
38
|
+
* Complete a task
|
|
39
|
+
* @param taskId Task ID to complete
|
|
40
|
+
*/
|
|
41
|
+
completeTask(taskId: number): Promise<void>;
|
|
44
42
|
}
|
|
45
43
|
/**
|
|
46
44
|
* Repository interface for article management
|
|
47
45
|
*/
|
|
48
46
|
interface ArticleRepository {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Find existing articles by URLs
|
|
49
|
+
* @param urls URLs to query
|
|
50
|
+
* @returns Previously saved articles
|
|
51
|
+
*/
|
|
52
|
+
findByUrls(urls: UrlString[]): Promise<ParsedTarget[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Save crawled articles
|
|
55
|
+
* @param articles Articles to save
|
|
56
|
+
* @param context Task context information
|
|
57
|
+
* @returns Number of saved articles
|
|
58
|
+
*/
|
|
59
|
+
saveCrawledArticles<TaskId>(articles: ParsedTarget[], context: {
|
|
60
|
+
taskId: TaskId;
|
|
61
|
+
targetGroup: Omit<CrawlingTargetGroup, 'targets'>;
|
|
62
|
+
target: CrawlingTarget;
|
|
63
|
+
}): Promise<number>;
|
|
64
|
+
/**
|
|
65
|
+
* Find unscored articles (targets for analysis)
|
|
66
|
+
* @returns Articles without scores
|
|
67
|
+
*/
|
|
68
|
+
findUnscoredArticles(): Promise<UnscoredArticle[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Update article with analysis results
|
|
71
|
+
* @param article Article information to update
|
|
72
|
+
*/
|
|
73
|
+
updateAnalysis(article: ArticleForUpdateByAnalysis): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Find candidate articles for newsletter generation
|
|
76
|
+
* @returns Candidate articles
|
|
77
|
+
*/
|
|
78
|
+
findCandidatesForNewsletter(): Promise<ArticleForGenerateContent[]>;
|
|
81
79
|
}
|
|
82
80
|
/**
|
|
83
81
|
* A single excavation report supplied by the application instead of crawled.
|
|
@@ -86,35 +84,35 @@ interface ArticleRepository {
|
|
|
86
84
|
* that already stores these rows can hand them over without reshaping them.
|
|
87
85
|
*/
|
|
88
86
|
interface ExcavationReport {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
87
|
+
/**
|
|
88
|
+
* The board's own identifier (`ecexmRcno`). Used both as the article's unique
|
|
89
|
+
* id and to build its public detail URL, so it must match the value the board
|
|
90
|
+
* uses — otherwise previously crawled reports are re-saved as duplicates.
|
|
91
|
+
* @example "202609157717"
|
|
92
|
+
*/
|
|
93
|
+
externalId: string;
|
|
94
|
+
/**
|
|
95
|
+
* Report title (보고서명).
|
|
96
|
+
* @example "태안 태안읍성 -남문지 및 연지-"
|
|
97
|
+
*/
|
|
98
|
+
title: string;
|
|
99
|
+
/**
|
|
100
|
+
* Submission date (제출일) in ISO format (YYYY-MM-DD).
|
|
101
|
+
* @example "2026-09-15"
|
|
102
|
+
*/
|
|
103
|
+
submittedDate: IsoDateString;
|
|
104
|
+
/**
|
|
105
|
+
* Report detail fields as label/value pairs, rendered into the article body in
|
|
106
|
+
* insertion order. Supply whatever the source holds — 허가번호, 유적명,
|
|
107
|
+
* 발간기관, 조사시도시군구, 조사기간, 유적성격/시대구분 and so on.
|
|
108
|
+
* Empty values are skipped.
|
|
109
|
+
*/
|
|
110
|
+
fields: Record<string, string | null | undefined>;
|
|
111
|
+
/**
|
|
112
|
+
* Whether the report has a downloadable file. Defaults to true, matching the
|
|
113
|
+
* crawled parser.
|
|
114
|
+
*/
|
|
115
|
+
hasAttachedFile?: boolean;
|
|
118
116
|
}
|
|
119
117
|
/**
|
|
120
118
|
* Supplies excavation reports from the application instead of crawling them.
|
|
@@ -130,19 +128,19 @@ type ExcavationReportSource = () => Promise<ExcavationReport[]>;
|
|
|
130
128
|
* One paper in an injected journal issue.
|
|
131
129
|
*/
|
|
132
130
|
interface JournalIssuePaper {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
131
|
+
/** Paper title. */
|
|
132
|
+
title: string;
|
|
133
|
+
/** Author names in publication order. */
|
|
134
|
+
authors: string[];
|
|
135
|
+
/** Author keywords. Blank and repeated keywords are ignored. */
|
|
136
|
+
keywords: string[];
|
|
137
|
+
/**
|
|
138
|
+
* Abstract shown to the scoring and generation models, in the original
|
|
139
|
+
* language when the source has one. Truncated before it reaches them.
|
|
140
|
+
*/
|
|
141
|
+
abstract?: string | null;
|
|
142
|
+
/** Public page for the paper, such as its KCI article page. */
|
|
143
|
+
url: string;
|
|
146
144
|
}
|
|
147
145
|
/**
|
|
148
146
|
* A newly published journal issue (권호) supplied by the application.
|
|
@@ -151,42 +149,42 @@ interface JournalIssuePaper {
|
|
|
151
149
|
* twenty-paper issue is scored and introduced once rather than twenty times.
|
|
152
150
|
*/
|
|
153
151
|
interface JournalIssue {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Stable identifier for the issue, such as
|
|
154
|
+
* `{journalId}|{year}|{month}|{volume}|{issue}`. It becomes the article's
|
|
155
|
+
* `uniqId` and reaches `saveCrawledArticles`, so the application can store
|
|
156
|
+
* it with the article. `usedArticles` carry only the article's own id and
|
|
157
|
+
* URL, so that stored value (or the issue `url`) is how the application maps
|
|
158
|
+
* a saved newsletter back to the issues it introduced. Keep it independent
|
|
159
|
+
* of the paper list, or a later snapshot of the same issue looks like a new
|
|
160
|
+
* one.
|
|
161
|
+
*/
|
|
162
|
+
externalId: string;
|
|
163
|
+
/**
|
|
164
|
+
* Public page readers follow from the newsletter. It is also the article's
|
|
165
|
+
* URL, so it must be stable for the issue: previously saved issues are
|
|
166
|
+
* recognized by it and not saved again.
|
|
167
|
+
*/
|
|
168
|
+
url: string;
|
|
169
|
+
/** Journal name, e.g. "헤리티지:역사와 과학". */
|
|
170
|
+
journalName: string;
|
|
171
|
+
/** Publication year. */
|
|
172
|
+
publishedYear: number;
|
|
173
|
+
/** Publication month, 1-12. */
|
|
174
|
+
publishedMonth: number;
|
|
175
|
+
/** Volume (권). Empty when the journal numbers issues only. */
|
|
176
|
+
volume: string;
|
|
177
|
+
/** Issue number (호). Empty when the journal numbers volumes only. */
|
|
178
|
+
issue: string;
|
|
179
|
+
/**
|
|
180
|
+
* Date the issue became available to the application, in ISO format
|
|
181
|
+
* (YYYY-MM-DD, Korean time) — for example when its papers were first
|
|
182
|
+
* collected. Used as the article's registered date.
|
|
183
|
+
* @example "2026-10-28"
|
|
184
|
+
*/
|
|
185
|
+
registeredDate: IsoDateString;
|
|
186
|
+
/** Every paper in the issue, in the order to list them. */
|
|
187
|
+
papers: JournalIssuePaper[];
|
|
190
188
|
}
|
|
191
189
|
/**
|
|
192
190
|
* Supplies newly published journal issues from the application, such as those
|
|
@@ -208,27 +206,27 @@ type JournalIssueSource = () => Promise<JournalIssue[]>;
|
|
|
208
206
|
* introduced. A run that saves no newsletter consumes none of them.
|
|
209
207
|
*/
|
|
210
208
|
interface SubmittedPaper {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Stable identifier from the application. It comes back unchanged in
|
|
211
|
+
* `saveNewsletter`'s `submittedPapers`, which is how the application records
|
|
212
|
+
* that the paper was introduced.
|
|
213
|
+
*/
|
|
214
|
+
id: string;
|
|
215
|
+
/** Paper title. */
|
|
216
|
+
title: string;
|
|
217
|
+
/** Author names in publication order. */
|
|
218
|
+
authors: string[];
|
|
219
|
+
/**
|
|
220
|
+
* Where the paper appeared: the journal for a journal paper, the university
|
|
221
|
+
* for a thesis.
|
|
222
|
+
* @example "고려대학교"
|
|
223
|
+
*/
|
|
224
|
+
venue: string;
|
|
225
|
+
/**
|
|
226
|
+
* Page where readers can see the paper or its record. Only http(s) URLs are
|
|
227
|
+
* linked; anything else renders the title without a link.
|
|
228
|
+
*/
|
|
229
|
+
url: string;
|
|
232
230
|
}
|
|
233
231
|
/**
|
|
234
232
|
* Supplies the submitted papers to introduce in this run. Called at most once,
|
|
@@ -240,54 +238,54 @@ type SubmittedPaperSource = () => Promise<SubmittedPaper[]>;
|
|
|
240
238
|
* Repository interface for tag management
|
|
241
239
|
*/
|
|
242
240
|
interface TagRepository {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Find all existing tags
|
|
243
|
+
* @returns Tag name list
|
|
244
|
+
*/
|
|
245
|
+
findAllTags(): Promise<string[]>;
|
|
248
246
|
}
|
|
249
247
|
/**
|
|
250
248
|
* Base template options shared by all newsletter variants.
|
|
251
249
|
*/
|
|
252
250
|
interface BaseNewsletterTemplateOptions {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Deterministic reminder section from renderVerifiedDeadlineReminders().
|
|
253
|
+
* Appended to saved Markdown and HTML after generation; never fed to the LLM.
|
|
254
|
+
*/
|
|
255
|
+
deadlineRemindersMarkdown?: string;
|
|
256
|
+
/** Freshly verified historical deadlines/events, merged with included articles. */
|
|
257
|
+
verifiedDeadlineReminders?: VerifiedDeadlineReminder[];
|
|
258
|
+
/**
|
|
259
|
+
* Custom colleague-sharing Markdown, placed after the unified deadline section
|
|
260
|
+
* in both saved Markdown and HTML. Omit for the default; use '' to suppress it.
|
|
261
|
+
*/
|
|
262
|
+
shareNoticeMarkdown?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Markdown content for KRAS news section.
|
|
265
|
+
* Converted to HTML and injected into the newsletter template.
|
|
266
|
+
*/
|
|
267
|
+
krasNewsMarkdown?: string;
|
|
268
|
+
/**
|
|
269
|
+
* Markdown content for KRAS notice section.
|
|
270
|
+
* Converted to HTML and injected into the newsletter template.
|
|
271
|
+
*/
|
|
272
|
+
krasNoticeMarkdown?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Markdown content for heripo lab news section.
|
|
275
|
+
* Converted to HTML and injected into the newsletter template.
|
|
276
|
+
*/
|
|
277
|
+
heripolabNewsMarkdown?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Display date string for the newsletter header (e.g. "2026년 2월 12일").
|
|
280
|
+
* Injected from DateService.getPublicationDisplayDateString() at generation time.
|
|
281
|
+
*/
|
|
282
|
+
displayDate?: string;
|
|
285
283
|
}
|
|
286
284
|
/**
|
|
287
285
|
* Template options for the default (heripo) newsletter variant.
|
|
288
286
|
*/
|
|
289
287
|
interface DefaultNewsletterTemplateOptions extends BaseNewsletterTemplateOptions {
|
|
290
|
-
|
|
288
|
+
isKrasNewsletter?: false;
|
|
291
289
|
}
|
|
292
290
|
/**
|
|
293
291
|
* Template options for the KRAS (Korean Archaeological Society) newsletter variant.
|
|
@@ -296,14 +294,14 @@ interface DefaultNewsletterTemplateOptions extends BaseNewsletterTemplateOptions
|
|
|
296
294
|
* - titleContext: Context string to prioritize in newsletter title generation
|
|
297
295
|
*/
|
|
298
296
|
interface KrasNewsletterTemplateOptions extends BaseNewsletterTemplateOptions {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
297
|
+
isKrasNewsletter: true;
|
|
298
|
+
/**
|
|
299
|
+
* Context string to prioritize when generating the newsletter title.
|
|
300
|
+
* Only available in KRAS mode. When provided, the LLM will consider this value
|
|
301
|
+
* as the top priority along with the generated newsletter content for title creation.
|
|
302
|
+
* An empty string is treated as undefined (no context).
|
|
303
|
+
*/
|
|
304
|
+
titleContext?: string;
|
|
307
305
|
}
|
|
308
306
|
/**
|
|
309
307
|
* Template customization options for newsletter HTML generation.
|
|
@@ -320,45 +318,45 @@ type NewsletterTemplateOptions = DefaultNewsletterTemplateOptions | KrasNewslett
|
|
|
320
318
|
* When `isKrasNewsletter` is `false` or omitted, standard heripo branding is used.
|
|
321
319
|
*/
|
|
322
320
|
interface WelcomeTemplateOptions {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
321
|
+
/** When true, apply KRAS (Korean Archaeological Society) branding */
|
|
322
|
+
isKrasNewsletter?: boolean;
|
|
323
|
+
/** Site base URL for constructing links (default: 'https://heripo.app') */
|
|
324
|
+
siteUrl?: string;
|
|
327
325
|
}
|
|
328
326
|
/**
|
|
329
327
|
* Repository interface for newsletter management
|
|
330
328
|
*/
|
|
331
329
|
interface NewsletterRepository {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
330
|
+
/**
|
|
331
|
+
* Titles of actually published issues in [fromInclusive, toExclusive).
|
|
332
|
+
* Scope the query to this newsletter/audience; exclude drafts and failed sends.
|
|
333
|
+
* Providing this method enables the preceding seven calendar days title guard.
|
|
334
|
+
*/
|
|
335
|
+
findRecentPublishedTitles?(range: {
|
|
336
|
+
fromInclusive: IsoDateString;
|
|
337
|
+
toExclusive: IsoDateString;
|
|
338
|
+
}): Promise<string[]>;
|
|
339
|
+
/**
|
|
340
|
+
* Get the next issue order number
|
|
341
|
+
* @returns Next issue order
|
|
342
|
+
*/
|
|
343
|
+
getNextIssueOrder(): Promise<number>;
|
|
344
|
+
/**
|
|
345
|
+
* Save newsletter
|
|
346
|
+
* @param input - Input parameters
|
|
347
|
+
* @param input.newsletter - Newsletter data
|
|
348
|
+
* @param input.usedArticles - List of used articles
|
|
349
|
+
* @param input.submittedPapers - Submitted papers rendered in this
|
|
350
|
+
* newsletter; empty when none were supplied or the source failed
|
|
351
|
+
* @returns Saved newsletter ID
|
|
352
|
+
*/
|
|
353
|
+
saveNewsletter(input: {
|
|
354
|
+
newsletter: Newsletter;
|
|
355
|
+
usedArticles: ArticleForGenerateContent[];
|
|
356
|
+
submittedPapers: SubmittedPaper[];
|
|
357
|
+
}): Promise<{
|
|
358
|
+
id: string | number;
|
|
359
|
+
}>;
|
|
362
360
|
}
|
|
363
361
|
/**
|
|
364
362
|
* Storage for 나라장터 triage verdicts, so a judgement outlives its run.
|
|
@@ -387,35 +385,26 @@ interface NewsletterRepository {
|
|
|
387
385
|
* not have to defend its own synchronous paths.
|
|
388
386
|
*/
|
|
389
387
|
interface HeritageBidVerdictStore {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
388
|
+
/**
|
|
389
|
+
* Verdicts for the keys that are known. Unknown keys are simply absent.
|
|
390
|
+
*/
|
|
391
|
+
load(keys: readonly string[]): Promise<ReadonlyMap<string, boolean>>;
|
|
392
|
+
/**
|
|
393
|
+
* Persists verdicts the model made. Verdicts that came from the
|
|
394
|
+
* deterministic fallback are never passed here.
|
|
395
|
+
*/
|
|
396
|
+
save(verdicts: ReadonlyMap<string, boolean>): Promise<void>;
|
|
399
397
|
}
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Uses the required OpenAI key for every default model. Each task accepts an
|
|
403
|
-
* OpenAI model ID or an AI SDK LanguageModel directly. The compatibility
|
|
404
|
-
* content-generation option can still select Anthropic or Google.
|
|
405
|
-
*
|
|
406
|
-
* `models.generateNewsletter` takes precedence over `contentGeneration`.
|
|
407
|
-
*/
|
|
408
|
-
|
|
409
398
|
/**
|
|
410
399
|
* Preview newsletter configuration options
|
|
411
400
|
*/
|
|
412
401
|
interface PreviewNewsletterOptions {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
402
|
+
/** Function to fetch newsletter for preview */
|
|
403
|
+
fetchNewsletterForPreview: () => Promise<Newsletter>;
|
|
404
|
+
/** Email sending service */
|
|
405
|
+
emailService: EmailService;
|
|
406
|
+
/** Email message configuration (subject, html, text are auto-generated) */
|
|
407
|
+
emailMessage: Omit<EmailMessage, 'subject' | 'html' | 'text'>;
|
|
419
408
|
}
|
|
420
409
|
/**
|
|
421
410
|
* Content generation LLM provider configuration.
|
|
@@ -428,17 +417,17 @@ interface PreviewNewsletterOptions {
|
|
|
428
417
|
* - google: `gemini-3.1-pro-preview`
|
|
429
418
|
*/
|
|
430
419
|
type ContentGenerationConfig = {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
420
|
+
provider: 'openai';
|
|
421
|
+
apiKey: string;
|
|
422
|
+
model?: string;
|
|
434
423
|
} | {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
424
|
+
provider: 'anthropic';
|
|
425
|
+
apiKey: string;
|
|
426
|
+
model?: string;
|
|
438
427
|
} | {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
428
|
+
provider: 'google';
|
|
429
|
+
apiKey: string;
|
|
430
|
+
model?: string;
|
|
442
431
|
};
|
|
443
432
|
/**
|
|
444
433
|
* OpenAI model IDs or AI SDK LanguageModel instances used by each LLM task.
|
|
@@ -448,119 +437,119 @@ type ContentGenerationConfig = {
|
|
|
448
437
|
* option; `models.generateNewsletter` takes precedence when both are supplied.
|
|
449
438
|
*/
|
|
450
439
|
interface NewsletterModelConfig {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
440
|
+
heritageBidTriage?: string | LanguageModel;
|
|
441
|
+
classifyTags?: string | LanguageModel;
|
|
442
|
+
analyzeImages?: string | LanguageModel;
|
|
443
|
+
determineImportance?: string | LanguageModel;
|
|
444
|
+
generateNewsletter?: string | LanguageModel;
|
|
456
445
|
}
|
|
457
446
|
/**
|
|
458
447
|
* Newsletter generator dependencies interface
|
|
459
448
|
*/
|
|
460
449
|
interface NewsletterGeneratorDependencies {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
450
|
+
/** OpenAI API key used by every default model. */
|
|
451
|
+
openAIApiKey: string;
|
|
452
|
+
/** OpenAI model IDs or AI SDK model instances for every LLM task (optional). */
|
|
453
|
+
models?: NewsletterModelConfig;
|
|
454
|
+
/**
|
|
455
|
+
* Opt in to original-article deadline extraction. An omitted model reuses the
|
|
456
|
+
* importance model; a string is resolved through the supplied OpenAI key.
|
|
457
|
+
* Repositories must persist deadlines, including an empty array. Omit to keep
|
|
458
|
+
* the existing analysis calls. This does not activate reminders on candidates.
|
|
459
|
+
*/
|
|
460
|
+
extractDeadlineOptions?: {
|
|
461
|
+
model?: string | LanguageModel;
|
|
462
|
+
/** Include conferences, public site visits and other dated attendance opportunities. */
|
|
463
|
+
includeEvents?: boolean;
|
|
464
|
+
};
|
|
465
|
+
/**
|
|
466
|
+
* Non-OpenAI content generation configuration (optional).
|
|
467
|
+
*
|
|
468
|
+
* Prefer `models.generateNewsletter`. String IDs use `openAIApiKey`; model
|
|
469
|
+
* instances use their own provider configuration.
|
|
470
|
+
* This remains available for Anthropic/Google compatibility.
|
|
471
|
+
*/
|
|
472
|
+
contentGeneration?: ContentGenerationConfig;
|
|
473
|
+
/** Task management repository */
|
|
474
|
+
taskRepository: TaskRepository;
|
|
475
|
+
/** Article management repository */
|
|
476
|
+
articleRepository: ArticleRepository;
|
|
477
|
+
/** Tag management repository */
|
|
478
|
+
tagRepository: TagRepository;
|
|
479
|
+
/** Newsletter management repository */
|
|
480
|
+
newsletterRepository: NewsletterRepository;
|
|
481
|
+
/** Logger (optional) */
|
|
482
|
+
logger?: AppLogger;
|
|
483
|
+
/** Preview email configuration (optional) */
|
|
484
|
+
previewNewsletter?: PreviewNewsletterOptions;
|
|
485
|
+
/**
|
|
486
|
+
* Publication date override in ISO format (optional).
|
|
487
|
+
* When provided, this date is used as the newsletter's publication date instead of the current date.
|
|
488
|
+
* Useful for generating a newsletter today but publishing it on a future date.
|
|
489
|
+
* @example "2025-02-12"
|
|
490
|
+
*/
|
|
491
|
+
publishDate?: string;
|
|
492
|
+
/** Newsletter template customization options (optional) */
|
|
493
|
+
templateOptions?: NewsletterTemplateOptions;
|
|
494
|
+
/** Custom fetch function for crawling (e.g., proxy-based fetch). Optional. */
|
|
495
|
+
customFetch?: typeof fetch;
|
|
496
|
+
/**
|
|
497
|
+
* Supplies 국가유산청 발굴조사 보고서 entries from the application (optional).
|
|
498
|
+
*
|
|
499
|
+
* When provided, that board is read from this function and never crawled,
|
|
500
|
+
* which lets an application that already stores the reports reuse them. Omit
|
|
501
|
+
* it to keep crawling the board as before. No other target is affected.
|
|
502
|
+
*/
|
|
503
|
+
excavationReportSource?: ExcavationReportSource;
|
|
504
|
+
/**
|
|
505
|
+
* Supplies newly published journal issues from the application (optional),
|
|
506
|
+
* such as those collected from KCI.
|
|
507
|
+
*
|
|
508
|
+
* Each issue becomes one article listing its papers. The target has no live
|
|
509
|
+
* board, so omitting this leaves it empty without making a request. The
|
|
510
|
+
* article's `uniqId` is the issue's `externalId` and its URL the issue's
|
|
511
|
+
* `url`; store either when articles are saved to record which issues a
|
|
512
|
+
* saved newsletter introduced.
|
|
513
|
+
*/
|
|
514
|
+
journalIssueSource?: JournalIssueSource;
|
|
515
|
+
/**
|
|
516
|
+
* Supplies submitted papers to introduce in this run (optional): theses and
|
|
517
|
+
* journal papers outside KCI that authors applied for and an administrator
|
|
518
|
+
* entered after review.
|
|
519
|
+
*
|
|
520
|
+
* They are rendered in the journal section after the KCI issues when the
|
|
521
|
+
* newsletter is saved, without being crawled, scored or shown to a model,
|
|
522
|
+
* and do not count toward the publication criteria. The ones rendered come
|
|
523
|
+
* back in `saveNewsletter`'s `submittedPapers`; a run that saves no
|
|
524
|
+
* newsletter consumes none.
|
|
525
|
+
*/
|
|
526
|
+
submittedPaperSource?: SubmittedPaperSource;
|
|
527
|
+
/**
|
|
528
|
+
* data.go.kr service key for the 나라일터 and 알리오 job boards (optional).
|
|
529
|
+
*
|
|
530
|
+
* Pass the encoded key exactly as the portal supplies it. Both boards are read
|
|
531
|
+
* through open APIs rather than scraped; omit the key and they collect
|
|
532
|
+
* nothing while every other target is unaffected.
|
|
533
|
+
*/
|
|
534
|
+
publicDataApiKey?: string;
|
|
535
|
+
/**
|
|
536
|
+
* Storage for 나라장터 triage verdicts (optional).
|
|
537
|
+
*
|
|
538
|
+
* The window is 48 hours and the run is daily, so half of every window was
|
|
539
|
+
* already judged by the previous run — almost all of it rejections, which
|
|
540
|
+
* never reach `saveCrawledArticles` and so cannot be recognised from the
|
|
541
|
+
* article table. Supply a store and that half is read back instead of being
|
|
542
|
+
* sent to the model again; omit it and each run judges the whole window.
|
|
543
|
+
*/
|
|
544
|
+
heritageBidVerdictStore?: HeritageBidVerdictStore;
|
|
545
|
+
/**
|
|
546
|
+
* LLM prompt overrides (optional).
|
|
547
|
+
*
|
|
548
|
+
* When provided, this replaces Research Radar's own prompt provider entirely
|
|
549
|
+
* rather than merging with it. Omit it to use the package's tuned prompts,
|
|
550
|
+
* which in turn fall back to core's defaults for any stage they do not define.
|
|
551
|
+
*/
|
|
552
|
+
promptProvider?: PromptProvider;
|
|
564
553
|
}
|
|
565
554
|
/**
|
|
566
555
|
* Newsletter generation execution function
|
|
@@ -583,8 +572,7 @@ interface NewsletterGeneratorDependencies {
|
|
|
583
572
|
* });
|
|
584
573
|
* ```
|
|
585
574
|
*/
|
|
586
|
-
declare function generateNewsletter(dependencies: NewsletterGeneratorDependencies): Promise<string | number | null>;
|
|
587
|
-
|
|
575
|
+
export declare function generateNewsletter(dependencies: NewsletterGeneratorDependencies): Promise<string | number | null>;
|
|
588
576
|
/**
|
|
589
577
|
* Board URL of the journal issue target.
|
|
590
578
|
*
|
|
@@ -592,8 +580,7 @@ declare function generateNewsletter(dependencies: NewsletterGeneratorDependencie
|
|
|
592
580
|
* application's injected issues and never sends it. It points at KCI because
|
|
593
581
|
* that is where the issues come from, and it is what the source list shows.
|
|
594
582
|
*/
|
|
595
|
-
declare const JOURNAL_ISSUE_LIST_URL = "https://www.kci.go.kr/kciportal/main.kci";
|
|
596
|
-
|
|
583
|
+
export declare const JOURNAL_ISSUE_LIST_URL = "https://www.kci.go.kr/kciportal/main.kci";
|
|
597
584
|
/**
|
|
598
585
|
* Generates a welcome email HTML string with CSS inlined via juice.
|
|
599
586
|
*
|
|
@@ -616,115 +603,111 @@ declare const JOURNAL_ISSUE_LIST_URL = "https://www.kci.go.kr/kciportal/main.kci
|
|
|
616
603
|
* });
|
|
617
604
|
* ```
|
|
618
605
|
*/
|
|
619
|
-
declare function generateWelcomeHTML(id: string, name: string, options?: WelcomeTemplateOptions): Promise<string>;
|
|
620
|
-
|
|
606
|
+
export declare function generateWelcomeHTML(id: string, name: string, options?: WelcomeTemplateOptions): Promise<string>;
|
|
621
607
|
/**
|
|
622
608
|
* Date service implementation
|
|
623
609
|
* - Provides newsletter publication date strings (ISO and localized display form)
|
|
624
610
|
* - Always returns Korea Standard Time (KST, Asia/Seoul) regardless of server timezone
|
|
625
611
|
* - Accepts optional publishDate to override "today" (e.g., generating today's run for tomorrow's publication)
|
|
626
612
|
*/
|
|
627
|
-
declare class DateService implements DateService$1 {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
613
|
+
export declare class DateService implements DateService$1 {
|
|
614
|
+
private readonly targetDate;
|
|
615
|
+
/**
|
|
616
|
+
* @param publishDate - Optional ISO date string (YYYY-MM-DD) representing the newsletter
|
|
617
|
+
* publication date. If omitted, the current wall-clock time (KST)
|
|
618
|
+
* is used. Pass tomorrow's date when building the issue the night before.
|
|
619
|
+
* @throws {Error} If publishDate is not in YYYY-MM-DD format or is not a real calendar date.
|
|
620
|
+
*/
|
|
621
|
+
constructor(publishDate?: string);
|
|
622
|
+
/**
|
|
623
|
+
* Get the newsletter publication date in ISO format (YYYY-MM-DD).
|
|
624
|
+
* - Always returns date in Korea Standard Time (UTC+9)
|
|
625
|
+
* @returns ISO date string (e.g., "2024-10-15")
|
|
626
|
+
*/
|
|
627
|
+
getPublicationISODateString(): IsoDateString;
|
|
628
|
+
getCurrentISODateString(): IsoDateString;
|
|
629
|
+
/**
|
|
630
|
+
* Get the newsletter publication date as a localized display string.
|
|
631
|
+
* - Always returns date in Korea Standard Time (UTC+9)
|
|
632
|
+
* @returns Korean formatted date (e.g., "2024년 10월 15일")
|
|
633
|
+
*/
|
|
634
|
+
getPublicationDisplayDateString(): string;
|
|
635
|
+
getDisplayDateString(): string;
|
|
650
636
|
}
|
|
651
|
-
|
|
652
637
|
/**
|
|
653
638
|
* Task service implementation
|
|
654
639
|
* - Manages newsletter generation task lifecycle (start/end)
|
|
655
640
|
* - Prevents duplicate execution
|
|
656
641
|
*/
|
|
657
|
-
declare class TaskService implements TaskService$1<number> {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
642
|
+
export declare class TaskService implements TaskService$1<number> {
|
|
643
|
+
private readonly taskRepository;
|
|
644
|
+
private currentTaskId;
|
|
645
|
+
constructor(taskRepository: TaskRepository);
|
|
646
|
+
/**
|
|
647
|
+
* Start a new task
|
|
648
|
+
* @throws Error if a task is already running
|
|
649
|
+
* @returns Task ID
|
|
650
|
+
*/
|
|
651
|
+
start(): Promise<number>;
|
|
652
|
+
/**
|
|
653
|
+
* End the current task
|
|
654
|
+
* @throws Error if no task is running
|
|
655
|
+
*/
|
|
656
|
+
end(): Promise<void>;
|
|
672
657
|
}
|
|
673
|
-
|
|
674
658
|
interface AnalysisModels {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
659
|
+
classifyTags: LanguageModel;
|
|
660
|
+
analyzeImages: LanguageModel;
|
|
661
|
+
determineImportance: LanguageModel;
|
|
662
|
+
extractDeadlines?: LanguageModel;
|
|
663
|
+
/** Event extraction is enabled only together with extractDeadlines. */
|
|
664
|
+
includeEvents?: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* Fetch used to download article images for image analysis. Core sends the
|
|
667
|
+
* image bytes rather than their URLs, so this should apply the same proxy
|
|
668
|
+
* and robots.txt policy as crawling. Omitted, core's own download is used,
|
|
669
|
+
* which checks each address as it connects.
|
|
670
|
+
*/
|
|
671
|
+
imageFetch?: typeof fetch;
|
|
688
672
|
}
|
|
689
673
|
/**
|
|
690
674
|
* Analysis provider implementation
|
|
691
675
|
* - LLM-based article analysis
|
|
692
676
|
* - Tag classification, image analysis, importance scoring
|
|
693
677
|
*/
|
|
694
|
-
declare class AnalysisProvider implements AnalysisProvider$1 {
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
678
|
+
export declare class AnalysisProvider implements AnalysisProvider$1 {
|
|
679
|
+
private readonly articleRepository;
|
|
680
|
+
private readonly tagRepository;
|
|
681
|
+
classifyTagOptions: {
|
|
682
|
+
model: LanguageModel;
|
|
683
|
+
};
|
|
684
|
+
analyzeImagesOptions: AnalysisProvider$1['analyzeImagesOptions'];
|
|
685
|
+
extractDeadlineOptions?: AnalysisProvider$1['extractDeadlineOptions'];
|
|
686
|
+
determineScoreOptions: {
|
|
687
|
+
model: LanguageModel;
|
|
688
|
+
minimumImportanceScoreRules: Array<{
|
|
689
|
+
targetUrl: string;
|
|
690
|
+
minScore: number;
|
|
691
|
+
}>;
|
|
692
|
+
};
|
|
693
|
+
constructor(openai: OpenAIProvider, articleRepository: ArticleRepository, tagRepository: TagRepository);
|
|
694
|
+
constructor(models: AnalysisModels, articleRepository: ArticleRepository, tagRepository: TagRepository);
|
|
695
|
+
/**
|
|
696
|
+
* Fetch articles that haven't been scored yet
|
|
697
|
+
* @returns Unscored articles awaiting analysis
|
|
698
|
+
*/
|
|
699
|
+
fetchUnscoredArticles(): Promise<UnscoredArticle[]>;
|
|
700
|
+
/**
|
|
701
|
+
* Fetch all existing tags for classification
|
|
702
|
+
* @returns List of tag names
|
|
703
|
+
*/
|
|
704
|
+
fetchTags(): Promise<string[]>;
|
|
705
|
+
/**
|
|
706
|
+
* Update article with analysis results (tags, image analysis, importance score)
|
|
707
|
+
* @param article - Article with analysis data
|
|
708
|
+
*/
|
|
709
|
+
update(article: ArticleForUpdateByAnalysis): Promise<void>;
|
|
726
710
|
}
|
|
727
|
-
|
|
728
711
|
/**
|
|
729
712
|
* Chooses which eligible reminders the unified section displays.
|
|
730
713
|
*
|
|
@@ -732,24 +715,24 @@ declare class AnalysisProvider implements AnalysisProvider$1 {
|
|
|
732
715
|
*/
|
|
733
716
|
type DeadlineReminderSelector = (rows: EligibleDeadlineReminder[], publicationDate: IsoDateString) => Promise<EligibleDeadlineReminder[]>;
|
|
734
717
|
type DeadlineReminderSelectorOptions = {
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
718
|
+
/** Same model that scores article importance. */
|
|
719
|
+
model: LanguageModel;
|
|
720
|
+
/**
|
|
721
|
+
* Milliseconds before the selection gives up and falls back. It runs while
|
|
722
|
+
* saving a fully generated issue, so a stalled provider must not hold it.
|
|
723
|
+
* @default 60000
|
|
724
|
+
*/
|
|
725
|
+
timeoutMs?: number;
|
|
726
|
+
/** Reports a selection that fell back to the first rows by date. */
|
|
727
|
+
onFallback?: (reason: string, candidateCount: number) => void;
|
|
728
|
+
/** Reports a model selection and its token usage. */
|
|
729
|
+
onSelected?: (info: {
|
|
730
|
+
candidateCount: number;
|
|
731
|
+
selectedCount: number;
|
|
732
|
+
/** Rows added by date order because the model chose too few. */
|
|
733
|
+
filledCount: number;
|
|
734
|
+
usage: unknown;
|
|
735
|
+
}) => void;
|
|
753
736
|
};
|
|
754
737
|
/**
|
|
755
738
|
* Builds the model selection that replaces "first rows by date".
|
|
@@ -763,50 +746,47 @@ type DeadlineReminderSelectorOptions = {
|
|
|
763
746
|
* unusable indices fall back to the first rows by date. A selection shorter
|
|
764
747
|
* than the rows available is filled in date order, skipping named duplicates.
|
|
765
748
|
*/
|
|
766
|
-
declare const createDeadlineReminderSelector: (options: DeadlineReminderSelectorOptions) => DeadlineReminderSelector;
|
|
767
|
-
|
|
749
|
+
export declare const createDeadlineReminderSelector: (options: DeadlineReminderSelectorOptions) => DeadlineReminderSelector;
|
|
768
750
|
/** Memoized access to one run's injected items. */
|
|
769
751
|
type SourceLoader<T> = () => Promise<T[]>;
|
|
770
752
|
/** Memoized access to one run's injected journal issues. */
|
|
771
753
|
type JournalIssueLoader = SourceLoader<JournalIssue>;
|
|
772
|
-
|
|
773
754
|
/** Which papers of an issue the table shows, and which it summarizes. */
|
|
774
755
|
type JournalPaperSelection = {
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
756
|
+
/** Paper indices shown in the table, most interesting first. */
|
|
757
|
+
featured: number[];
|
|
758
|
+
/** Papers collapsed into a count and topic summary, in paper order. */
|
|
759
|
+
others: {
|
|
760
|
+
index: number;
|
|
761
|
+
topic: string | null;
|
|
762
|
+
}[];
|
|
782
763
|
};
|
|
783
764
|
/**
|
|
784
765
|
* Picks the papers the newsletter's readers would want to see, or returns null
|
|
785
766
|
* when no selection could be made — the section then lists every paper.
|
|
786
767
|
*/
|
|
787
768
|
type JournalPaperSelector = (issue: JournalIssue) => Promise<JournalPaperSelection | null>;
|
|
788
|
-
|
|
789
769
|
/**
|
|
790
770
|
* Injected journal issues are rendered by the provider rather than written by
|
|
791
771
|
* the model: each is a table of up to twenty titles and author lists, which
|
|
792
772
|
* the model would have to copy exactly.
|
|
793
773
|
*/
|
|
794
774
|
type JournalIssueRendering = {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
775
|
+
/** The run's injected issues, matched to candidates by URL. */
|
|
776
|
+
load: JournalIssueLoader;
|
|
777
|
+
/** Picks the papers readers would care about; omitted, every paper is listed. */
|
|
778
|
+
select?: JournalPaperSelector;
|
|
779
|
+
/** Reports that the issues could not be loaded, so the model got them. */
|
|
780
|
+
onUnavailable?: (reason: string) => void;
|
|
781
|
+
/** Reports body lines about the issues removed despite the prompt. */
|
|
782
|
+
onBodyMentionsRemoved?: (removed: number) => void;
|
|
783
|
+
/**
|
|
784
|
+
* The run's submitted papers, rendered after the issues when the newsletter
|
|
785
|
+
* is saved. They are not candidates and never reach the model.
|
|
786
|
+
*/
|
|
787
|
+
loadSubmittedPapers?: SourceLoader<SubmittedPaper>;
|
|
788
|
+
/** Reports that the submitted papers could not be loaded and were left out. */
|
|
789
|
+
onSubmittedPapersUnavailable?: (reason: string) => void;
|
|
810
790
|
};
|
|
811
791
|
/**
|
|
812
792
|
* Content generation provider implementation
|
|
@@ -814,161 +794,156 @@ type JournalIssueRendering = {
|
|
|
814
794
|
* - HTML template provisioning
|
|
815
795
|
* - Newsletter persistence
|
|
816
796
|
*/
|
|
817
|
-
declare class ContentGenerateProvider implements ContentGenerateProvider$1 {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
797
|
+
export declare class ContentGenerateProvider implements ContentGenerateProvider$1 {
|
|
798
|
+
private readonly articleRepository;
|
|
799
|
+
private readonly newsletterRepository;
|
|
800
|
+
private readonly templateOptions?;
|
|
801
|
+
/** Chooses displayed reminders; omitted, the first rows by date display. */
|
|
802
|
+
private readonly selectDeadlineReminders?;
|
|
803
|
+
private readonly journalIssues?;
|
|
804
|
+
private _issueOrder;
|
|
805
|
+
private readonly deadlineRemindersMarkdown;
|
|
806
|
+
private heldJournalIssues;
|
|
807
|
+
readonly model: LanguageModel;
|
|
808
|
+
readonly fetchRecentTitles?: ContentGenerateProvider$1['fetchRecentTitles'];
|
|
809
|
+
/** HTML template with markers for title and content injection */
|
|
810
|
+
htmlTemplate: HtmlTemplate;
|
|
811
|
+
/** Newsletter brand name (defaults to config, can be overridden via constructor) */
|
|
812
|
+
newsletterBrandName: string;
|
|
813
|
+
constructor(model: LanguageModel, articleRepository: ArticleRepository, newsletterRepository: NewsletterRepository, templateOptions?: NewsletterTemplateOptions | undefined, brandName?: string,
|
|
814
|
+
/** Chooses displayed reminders; omitted, the first rows by date display. */
|
|
815
|
+
selectDeadlineReminders?: DeadlineReminderSelector | undefined, journalIssues?: JournalIssueRendering | undefined);
|
|
816
|
+
/** LLM temperature setting for content generation */
|
|
817
|
+
temperature: number;
|
|
818
|
+
/** Subscribe page URL */
|
|
819
|
+
subscribePageUrl: UrlString;
|
|
820
|
+
/** Publication criteria (minimum article count, priority score threshold) */
|
|
821
|
+
publicationCriteria: {
|
|
822
|
+
minimumArticleCountForIssue: number;
|
|
823
|
+
priorityArticleScoreThreshold: number;
|
|
824
|
+
};
|
|
825
|
+
/**
|
|
826
|
+
* Get current issue order
|
|
827
|
+
* @throws Error if issue order not initialized
|
|
828
|
+
*/
|
|
829
|
+
get issueOrder(): number;
|
|
830
|
+
/**
|
|
831
|
+
* Initialize issue order before newsletter generation
|
|
832
|
+
*/
|
|
833
|
+
initializeIssueOrder(): Promise<void>;
|
|
834
|
+
/**
|
|
835
|
+
* Fetch candidate articles for newsletter generation
|
|
836
|
+
* @returns Articles eligible for inclusion in the newsletter
|
|
837
|
+
*/
|
|
838
|
+
fetchArticleCandidates(): Promise<ArticleForGenerateContent[]>;
|
|
839
|
+
/**
|
|
840
|
+
* Save generated newsletter to the repository
|
|
841
|
+
* @param input - Newsletter data and used articles
|
|
842
|
+
* @returns Saved newsletter ID
|
|
843
|
+
*/
|
|
844
|
+
saveNewsletter(input: {
|
|
845
|
+
newsletter: Newsletter;
|
|
846
|
+
usedArticles: ArticleForGenerateContent[];
|
|
847
|
+
}): Promise<{
|
|
848
|
+
id: string | number;
|
|
849
|
+
}>;
|
|
850
|
+
/**
|
|
851
|
+
* Drops what the model wrote about the held issues outside the briefing.
|
|
852
|
+
* The prompt already keeps them out of the body; this makes it certain, so
|
|
853
|
+
* an issue never appears both as a model-written row and in the table.
|
|
854
|
+
*/
|
|
855
|
+
private removeJournalIssueMentions;
|
|
856
|
+
/**
|
|
857
|
+
* Renders the held issues and the submitted papers. `submittedPapers` are the
|
|
858
|
+
* ones actually rendered, so the repository marks exactly those introduced.
|
|
859
|
+
*/
|
|
860
|
+
private renderJournalIssues;
|
|
861
|
+
/** A failed source leaves the papers out of this newsletter, never fails it. */
|
|
862
|
+
private loadSubmittedPapers;
|
|
863
|
+
private renderDeadlineReminders;
|
|
884
864
|
}
|
|
885
|
-
|
|
886
865
|
type HeritageBidCandidate = {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
866
|
+
/** Issuing and requesting institutions, joined. */
|
|
867
|
+
institution: string;
|
|
868
|
+
/** Notice title. */
|
|
869
|
+
title: string;
|
|
870
|
+
/** `pubPrcrmntMidClsfcNm`, when the notice carries one. */
|
|
871
|
+
classification?: string | null;
|
|
893
872
|
};
|
|
894
|
-
|
|
895
873
|
/**
|
|
896
874
|
* Decides which 나라장터 notices are worth scoring, one batch at a time.
|
|
897
875
|
*
|
|
898
876
|
* Returns one verdict per candidate, in the order they were given.
|
|
899
877
|
*/
|
|
900
878
|
type HeritageBidTriage = (candidates: HeritageBidCandidate[], signal?: AbortSignal) => Promise<boolean[]>;
|
|
901
|
-
|
|
902
879
|
/**
|
|
903
880
|
* Crawling provider implementation
|
|
904
881
|
* - Defines crawling targets
|
|
905
882
|
* - Saves crawling results
|
|
906
883
|
* - Fetches existing articles
|
|
907
884
|
*/
|
|
908
|
-
declare class CrawlingProvider implements CrawlingProvider$1 {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
885
|
+
export declare class CrawlingProvider implements CrawlingProvider$1 {
|
|
886
|
+
private readonly articleRepository;
|
|
887
|
+
/** Maximum number of concurrent crawling operations */
|
|
888
|
+
maxConcurrency: number;
|
|
889
|
+
/** Optional custom fetch function (e.g., proxy-based fetch) */
|
|
890
|
+
customFetch?: typeof fetch;
|
|
891
|
+
/** Crawling target groups configuration */
|
|
892
|
+
crawlingTargetGroups: CrawlingTargetGroup[];
|
|
893
|
+
constructor(articleRepository: ArticleRepository, customFetch?: typeof fetch, excavationReportSource?: ExcavationReportSource, logger?: AppLogger, publicDataApiKey?: string, bidTriage?: HeritageBidTriage, journalIssueSource?: JournalIssueSource);
|
|
894
|
+
/**
|
|
895
|
+
* Fetch existing articles by URLs to avoid duplicate crawling
|
|
896
|
+
* @param articleUrls - URLs to check
|
|
897
|
+
* @returns Existing articles
|
|
898
|
+
*/
|
|
899
|
+
fetchExistingArticlesByUrls(articleUrls: UrlString[]): Promise<ParsedTarget[]>;
|
|
900
|
+
/**
|
|
901
|
+
* Save crawled articles to the repository
|
|
902
|
+
* @param articles - Articles to save
|
|
903
|
+
* @param context - Task context (task ID, target group, target)
|
|
904
|
+
* @returns Number of saved articles
|
|
905
|
+
*/
|
|
906
|
+
saveCrawledArticles<TaskId>(articles: ParsedTarget[], context: {
|
|
907
|
+
taskId: TaskId;
|
|
908
|
+
targetGroup: Omit<CrawlingTargetGroup, 'targets'>;
|
|
909
|
+
target: CrawlingTarget;
|
|
910
|
+
}): Promise<number>;
|
|
934
911
|
}
|
|
935
|
-
|
|
936
|
-
declare function createCrawlingTargetGroups(customFetch?: typeof fetch): CrawlingTargetGroup[];
|
|
912
|
+
export declare function createCrawlingTargetGroups(customFetch?: typeof fetch): CrawlingTargetGroup[];
|
|
937
913
|
interface SourceItem {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
914
|
+
id: string;
|
|
915
|
+
name: string;
|
|
916
|
+
url: string;
|
|
941
917
|
}
|
|
942
918
|
interface SourceGroup {
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
919
|
+
id: string;
|
|
920
|
+
name: string;
|
|
921
|
+
sources: SourceItem[];
|
|
946
922
|
}
|
|
947
|
-
declare function getSourceList(): SourceGroup[];
|
|
948
|
-
|
|
923
|
+
export declare function getSourceList(): SourceGroup[];
|
|
949
924
|
/**
|
|
950
925
|
* Content options type extracted from core GenerateNewsletterConfig
|
|
951
926
|
*/
|
|
952
|
-
type ContentOptions = GenerateNewsletterConfig<any>['contentOptions'];
|
|
927
|
+
export type ContentOptions = GenerateNewsletterConfig<any>['contentOptions'];
|
|
953
928
|
/**
|
|
954
929
|
* Newsletter brand configuration type
|
|
955
930
|
*/
|
|
956
|
-
interface NewsletterConfig {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
931
|
+
export interface NewsletterConfig {
|
|
932
|
+
brandName: string;
|
|
933
|
+
subscribePageUrl: string;
|
|
934
|
+
publicationCriteria: {
|
|
935
|
+
minimumArticleCountForIssue: number;
|
|
936
|
+
priorityArticleScoreThreshold: number;
|
|
937
|
+
};
|
|
963
938
|
}
|
|
964
939
|
/**
|
|
965
940
|
* Newsletter content configuration
|
|
966
941
|
*/
|
|
967
|
-
declare const contentOptions: ContentOptions;
|
|
942
|
+
export declare const contentOptions: ContentOptions;
|
|
968
943
|
/**
|
|
969
944
|
* Newsletter brand configuration
|
|
970
945
|
*/
|
|
971
|
-
declare const newsletterConfig: NewsletterConfig;
|
|
946
|
+
export declare const newsletterConfig: NewsletterConfig;
|
|
972
947
|
/**
|
|
973
948
|
* Maximum importance score per heritage domain (`tag1`).
|
|
974
949
|
*
|
|
@@ -987,7 +962,7 @@ declare const newsletterConfig: NewsletterConfig;
|
|
|
987
962
|
*
|
|
988
963
|
* Domains absent from this map are not capped.
|
|
989
964
|
*/
|
|
990
|
-
declare const maximumImportanceScoreByDomain: Record<string, number>;
|
|
965
|
+
export declare const maximumImportanceScoreByDomain: Record<string, number>;
|
|
991
966
|
/**
|
|
992
967
|
* Origins exempted from the robots.txt check.
|
|
993
968
|
*
|
|
@@ -1000,25 +975,24 @@ declare const maximumImportanceScoreByDomain: Record<string, number>;
|
|
|
1000
975
|
* than the public board it happens to serve, and there is no other route to
|
|
1001
976
|
* the listing, so the society's boards are collected under this exemption.
|
|
1002
977
|
*/
|
|
1003
|
-
declare const robotsExemptOrigins: readonly string[];
|
|
978
|
+
export declare const robotsExemptOrigins: readonly string[];
|
|
1004
979
|
/**
|
|
1005
980
|
* LLM configuration
|
|
1006
981
|
*/
|
|
1007
|
-
declare const llmConfig: {
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
982
|
+
export declare const llmConfig: {
|
|
983
|
+
models: {
|
|
984
|
+
heritageBidTriage: string;
|
|
985
|
+
classifyTags: string;
|
|
986
|
+
analyzeImages: string;
|
|
987
|
+
determineImportance: string;
|
|
988
|
+
generateNewsletter: string;
|
|
989
|
+
};
|
|
990
|
+
maxRetries: number;
|
|
991
|
+
chainStopAfterAttempt: number;
|
|
992
|
+
generation: {
|
|
993
|
+
temperature: number;
|
|
994
|
+
};
|
|
1020
995
|
};
|
|
1021
|
-
|
|
1022
996
|
/**
|
|
1023
997
|
* Research Radar's LLM prompt overrides.
|
|
1024
998
|
*
|
|
@@ -1047,67 +1021,63 @@ declare const llmConfig: {
|
|
|
1047
1021
|
* after every edit — its source cannot be imported directly across repos
|
|
1048
1022
|
* because of the `~/*` path alias.
|
|
1049
1023
|
*/
|
|
1050
|
-
declare const researchRadarPromptProvider: PromptProvider;
|
|
1051
|
-
|
|
1024
|
+
export declare const researchRadarPromptProvider: PromptProvider;
|
|
1052
1025
|
type ResearchRadarDeadlineExtractionConfig = Omit<ExtractArticleDeadlinesConfig, 'outputLanguage'> & {
|
|
1053
|
-
|
|
1026
|
+
outputLanguage?: string;
|
|
1054
1027
|
};
|
|
1055
1028
|
/** Shared by host-managed backfill and targeted source verification. No DB writes. */
|
|
1056
|
-
declare function extractResearchRadarDeadlines(config: ResearchRadarDeadlineExtractionConfig): Promise<ExtractArticleDeadlinesResult>;
|
|
1057
|
-
|
|
1029
|
+
export declare function extractResearchRadarDeadlines(config: ResearchRadarDeadlineExtractionConfig): Promise<ExtractArticleDeadlinesResult>;
|
|
1058
1030
|
interface ResearchRadarDeadlineSource {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1031
|
+
title: string;
|
|
1032
|
+
url: UrlString;
|
|
1033
|
+
/** Original board URL retained when the article was collected. */
|
|
1034
|
+
targetUrl: UrlString;
|
|
1063
1035
|
}
|
|
1064
1036
|
type DeadlineVerificationFailure = 'unsupported-source' | 'invalid-source-url' | 'source-unavailable' | 'empty-source' | 'no-supported-deadlines' | 'extraction-failed';
|
|
1065
1037
|
type FetchedSource = {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1038
|
+
status: 'fetched';
|
|
1039
|
+
article: {
|
|
1040
|
+
title: string;
|
|
1041
|
+
detailContent: string;
|
|
1042
|
+
url: UrlString;
|
|
1043
|
+
};
|
|
1044
|
+
sourceHash: string;
|
|
1045
|
+
checkedAt: string;
|
|
1074
1046
|
};
|
|
1075
1047
|
type UnverifiedSource = {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1048
|
+
status: 'unverified';
|
|
1049
|
+
reason: DeadlineVerificationFailure;
|
|
1050
|
+
checkedAt: string;
|
|
1079
1051
|
};
|
|
1080
1052
|
type ResearchRadarDeadlineSourceResult = FetchedSource | UnverifiedSource;
|
|
1081
1053
|
type ResearchRadarDeadlineRefreshResult = (Omit<FetchedSource, 'status'> & {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1054
|
+
status: 'verified';
|
|
1055
|
+
deadlines: ArticleDeadline[];
|
|
1056
|
+
/** Preserve this extraction scope when passing the result as previous. */
|
|
1057
|
+
includeEvents?: boolean;
|
|
1058
|
+
usage: LanguageModelUsage | undefined;
|
|
1087
1059
|
}) | UnverifiedSource;
|
|
1088
1060
|
interface ResearchRadarDeadlineSourceOptions {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1061
|
+
source: ResearchRadarDeadlineSource;
|
|
1062
|
+
customFetch?: typeof fetch;
|
|
1063
|
+
publicDataApiKey?: string;
|
|
1064
|
+
/** Total budget for the original page and parser API requests, not LLM calls. */
|
|
1065
|
+
timeoutMs?: number;
|
|
1094
1066
|
}
|
|
1095
1067
|
type ResearchRadarDeadlineRefreshConfig = ResearchRadarDeadlineSourceOptions & Omit<ResearchRadarDeadlineExtractionConfig, 'article'> & {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1068
|
+
/** Cache only a successful extraction from this source. A fresh fetch is mandatory. */
|
|
1069
|
+
previous?: {
|
|
1070
|
+
sourceHash: string;
|
|
1071
|
+
deadlines: ArticleDeadline[];
|
|
1072
|
+
/** Missing metadata denotes a legacy deadline-only extraction. */
|
|
1073
|
+
includeEvents?: boolean;
|
|
1074
|
+
};
|
|
1103
1075
|
};
|
|
1104
1076
|
/**
|
|
1105
1077
|
* Fetches only the registered detail source and any API requests its parser
|
|
1106
1078
|
* requires. Does not enumerate lists, look up existing URLs, score, or save.
|
|
1107
1079
|
*/
|
|
1108
|
-
declare function fetchResearchRadarDeadlineSource({ source, customFetch, publicDataApiKey, timeoutMs
|
|
1080
|
+
export declare function fetchResearchRadarDeadlineSource({ source, customFetch, publicDataApiKey, timeoutMs }: ResearchRadarDeadlineSourceOptions): Promise<ResearchRadarDeadlineSourceResult>;
|
|
1109
1081
|
/** Only explicit, grounded results are verified. Missing dates are never cancellation. */
|
|
1110
|
-
declare function refreshResearchRadarDeadlines(config: ResearchRadarDeadlineRefreshConfig): Promise<ResearchRadarDeadlineRefreshResult>;
|
|
1111
|
-
|
|
1112
|
-
export { AnalysisProvider, ContentGenerateProvider, CrawlingProvider, DEADLINE_REMINDER_LEAD_DAYS, DEADLINE_REMINDER_LIMIT, DateService, JOURNAL_ISSUE_LIST_URL, TaskService, contentOptions, createCrawlingTargetGroups, createDeadlineReminderSelector, extractResearchRadarDeadlines, fetchResearchRadarDeadlineSource, generateNewsletter, generateWelcomeHTML, getSourceList, llmConfig, maximumImportanceScoreByDomain, newsletterConfig, refreshResearchRadarDeadlines, renderVerifiedDeadlineReminders, researchRadarPromptProvider, robotsExemptOrigins };
|
|
1113
|
-
export type { ArticleRepository, ContentGenerationConfig, ContentOptions, DeadlineReminderSelector, DeadlineReminderSelectorOptions, DeadlineVerificationFailure, EligibleDeadlineReminder, ExcavationReport, ExcavationReportSource, HeritageBidVerdictStore, JournalIssue, JournalIssuePaper, JournalIssueSource, NewsletterConfig, NewsletterGeneratorDependencies, NewsletterModelConfig, NewsletterRepository, NewsletterTemplateOptions, PreviewNewsletterOptions, ResearchRadarDeadlineExtractionConfig, ResearchRadarDeadlineRefreshConfig, ResearchRadarDeadlineRefreshResult, ResearchRadarDeadlineSource, ResearchRadarDeadlineSourceOptions, ResearchRadarDeadlineSourceResult, SourceGroup, SourceItem, SubmittedPaper, SubmittedPaperSource, TagRepository, TaskRepository, VerifiedDeadlineReminder, WelcomeTemplateOptions };
|
|
1082
|
+
export declare function refreshResearchRadarDeadlines(config: ResearchRadarDeadlineRefreshConfig): Promise<ResearchRadarDeadlineRefreshResult>;
|
|
1083
|
+
export type { ArticleRepository, ContentGenerationConfig, DeadlineReminderSelector, DeadlineReminderSelectorOptions, DeadlineVerificationFailure, EligibleDeadlineReminder, ExcavationReport, ExcavationReportSource, HeritageBidVerdictStore, JournalIssue, JournalIssuePaper, JournalIssueSource, NewsletterGeneratorDependencies, NewsletterModelConfig, NewsletterRepository, NewsletterTemplateOptions, PreviewNewsletterOptions, ResearchRadarDeadlineExtractionConfig, ResearchRadarDeadlineRefreshConfig, ResearchRadarDeadlineRefreshResult, ResearchRadarDeadlineSource, ResearchRadarDeadlineSourceOptions, ResearchRadarDeadlineSourceResult, SourceGroup, SourceItem, SubmittedPaper, SubmittedPaperSource, TagRepository, TaskRepository, VerifiedDeadlineReminder, WelcomeTemplateOptions };
|