sh-mcp/packages/reminders/src/index.ts

34 lines
1.4 KiB
TypeScript
Raw Normal View History

/**
* @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';
import { buildReminderTools } from './tools.js';
import { AwsSchedulerClient } from './client.js';
/**
* Default tool array — uses the production AwsSchedulerClient.
* The client's constructor does NOT call AWS; the call only happens in the handler.
* Import at server startup only after CDK env vars are available.
*/
export const tools = buildReminderTools({
client: new AwsSchedulerClient({
targetArn: process.env['REMINDER_TARGET_ARN'] ?? '',
roleArn: process.env['SCHEDULER_ROLE_ARN'] ?? '',
}),
});