harulog 0.1.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.
@@ -0,0 +1,7 @@
1
+ export function logInfo(message: string): void {
2
+ console.log(`[info] ${message}`);
3
+ }
4
+
5
+ export function logWarn(message: string): void {
6
+ console.warn(`[warn] ${message}`);
7
+ }
@@ -0,0 +1,53 @@
1
+ import type { ActivityItem, TopicSuggestion } from "../types";
2
+
3
+ export function renderTopicsMarkdown(input: {
4
+ generatedAt: string;
5
+ llmProvider: string;
6
+ model: string;
7
+ activities: ActivityItem[];
8
+ suggestions: TopicSuggestion[];
9
+ }): string {
10
+ const lines: string[] = [];
11
+
12
+ lines.push("# Daily Topic Suggestions");
13
+ lines.push("");
14
+ lines.push(`- generatedAt: ${input.generatedAt}`);
15
+ lines.push(`- llmProvider: ${input.llmProvider}`);
16
+ lines.push(`- model: ${input.model}`);
17
+ lines.push(`- activitiesConsidered: ${input.activities.length}`);
18
+ lines.push(`- suggestions: ${input.suggestions.length}`);
19
+ lines.push("");
20
+
21
+ if (input.llmProvider === "placeholder") {
22
+ lines.push("> warning: 이 결과는 실제 Gemini 모델이 아니라 placeholder fallback으로 생성된 임시 결과다.");
23
+ lines.push("> warning: 초안 품질을 평가하려면 GEMINI_API_KEY를 설정한 뒤 다시 실행해야 한다.");
24
+ lines.push("");
25
+ }
26
+
27
+ if (input.suggestions.length === 0) {
28
+ lines.push("추천할 글감이 없습니다.");
29
+ lines.push("");
30
+ return lines.join("\n");
31
+ }
32
+
33
+ input.suggestions.forEach((suggestion, index) => {
34
+ lines.push(`## ${index + 1}. ${suggestion.title}`);
35
+ lines.push("");
36
+ lines.push(`- 추천 이유: ${suggestion.reason}`);
37
+ lines.push(`- 예상 독자: ${suggestion.audience}`);
38
+ lines.push(`- 키워드: ${suggestion.keywords.join(", ")}`);
39
+ lines.push(`- 근거 활동 ID: ${suggestion.evidenceIds.join(", ")}`);
40
+ lines.push(`- 점수: ${suggestion.score.toFixed(2)}`);
41
+ lines.push("- 개요:");
42
+ suggestion.outline.forEach((item) => {
43
+ lines.push(` - ${item}`);
44
+ });
45
+ lines.push("");
46
+ lines.push(input.llmProvider === "placeholder" ? "### 임시 초안" : "### 초안");
47
+ lines.push("");
48
+ lines.push(suggestion.draft);
49
+ lines.push("");
50
+ });
51
+
52
+ return lines.join("\n");
53
+ }