/** * @sh-mcp/reminders * * Exports the reminders tool array pre-wired with the production AwsSchedulerClient. * Server bundles import this directly. Tests import buildReminderTools and inject * a mock client instead. * * NOTE: The production AwsSchedulerClient constructor reads REMINDER_TARGET_ARN and * SCHEDULER_ROLE_ARN from environment variables, which are injected by CDK at deploy * time. Importing this module without those env vars set (e.g. in unit tests) is safe * because the real client is never called — tests inject their own mock via * buildReminderTools(). */ export { buildReminderTools } from './tools.js'; export type { CreateReminderInput, CreateReminderOutput } from './tools.js'; export type { SchedulerClient, CreateScheduleInput, CreateScheduleOutput } from './client.js'; export { AwsSchedulerClient } from './client.js'; export { InMemorySchedulerClient } from './dev-client.js'; import { buildReminderTools } from './tools.js'; import { AwsSchedulerClient } from './client.js'; let _defaultTools: ReturnType | undefined; /** * Build (once) the default tools wired to the production AwsSchedulerClient. * * LAZY by design (build-plan §7): construction is deferred to first call so * importing `@sh-mcp/reminders` performs no work and reads no env at import * time. Reads the scheduler env only when first invoked, by which point CDK * env vars are present. Servers normally wire via `buildReminderTools` directly. */ export function getDefaultTools(): ReturnType { if (!_defaultTools) { _defaultTools = buildReminderTools({ client: new AwsSchedulerClient({ targetArn: process.env['REMINDER_TARGET_ARN'] ?? '', roleArn: process.env['SCHEDULER_ROLE_ARN'] ?? '', }), }); } return _defaultTools; }