Skip to content

Commit 3ec2e5c

Browse files
committed
docs: add JSDoc comments to date.ts and llm-reasoning.ts
1 parent 31c6a87 commit 3ec2e5c

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

src/infra/date.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* Return a `YYYY-MM-DD` date stamp for the given date using local time.
3+
*
4+
* @param date - The date to format (defaults to now).
5+
* @returns A `YYYY-MM-DD` formatted string in local time.
6+
*/
17
export function getLocalDateStamp(date: Date = new Date()): string {
28
const year = date.getFullYear();
39
const month = String(date.getMonth() + 1).padStart(2, '0');
@@ -6,6 +12,12 @@ export function getLocalDateStamp(date: Date = new Date()): string {
612
return `${year}-${month}-${day}`;
713
}
814

15+
/**
16+
* Build the daily note markdown filename for the given date.
17+
*
18+
* @param date - The date to use (defaults to now).
19+
* @returns A filename like `openmeta-daily-2026-06-18.md`.
20+
*/
921
export function getDailyNoteFileName(date: Date = new Date()): string {
1022
return `openmeta-daily-${getLocalDateStamp(date)}.md`;
1123
}

src/infra/llm-reasoning.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { LLMReasoningEffort } from '../types/index.js';
22

3+
/** All supported reasoning effort levels, ordered from least to most intensive. */
34
export const LLM_REASONING_EFFORTS = [
45
'none',
56
'minimal',
@@ -8,8 +9,16 @@ export const LLM_REASONING_EFFORTS = [
89
'high',
910
'xhigh',
1011
] as const satisfies readonly LLMReasoningEffort[];
12+
/** Default reasoning effort applied when no override is configured. */
1113
export const DEFAULT_LLM_REASONING_EFFORT: LLMReasoningEffort = 'none';
1214

15+
/**
16+
* Parse a user-supplied string into a valid {@link LLMReasoningEffort}.
17+
*
18+
* @param value - Raw string input (case-insensitive, whitespace-trimmed).
19+
* @returns The matching effort level.
20+
* @throws {Error} If the value does not match any known effort level.
21+
*/
1322
export function parseLLMReasoningEffort(value: string): LLMReasoningEffort {
1423
const normalized = value.trim().toLowerCase();
1524
if (LLM_REASONING_EFFORTS.includes(normalized as LLMReasoningEffort)) {

0 commit comments

Comments
 (0)