/** * @sh-mcp/tasks — public entry point. * * Exports the tool definitions built against a DynamoDBTasksClient. * The MCP server imports `tools` (the live array) and the tool factory * `buildTaskTools` for cases where an alternate client must be injected * (e.g. local dev, custom test harnesses). * * Wire transport (OpenAPI / Streamable-HTTP MCP) is generated from the tool * registry in packages/shared; this package only defines the tools. */ export { buildTaskTools } from './tools.js'; export type { TasksClient, Task, CreateTaskInput, ListTasksInput, CompleteTaskInput, DeleteTaskInput, } from './client.js'; export { DynamoDBTasksClient } from './client.js'; export { InMemoryTasksClient } from './dev-client.js'; // LAZY default-tools accessor. // // Phase 1 (build-plan §7) forbids I/O / AWS-client construction at import time. // The previous eager `export const tools = buildTaskTools(new DynamoDBTasksClient())` // constructed a live DynamoDB client the moment the barrel was imported, which // broke server startup. Construction is now deferred to first call so importing // `@sh-mcp/tasks` is side-effect-free. Servers wire tools via `buildTaskTools` // with their selected client (dev vs real); this accessor is a convenience only. import { buildTaskTools } from './tools.js'; import { DynamoDBTasksClient } from './client.js'; let _defaultTools: ReturnType | undefined; /** Build (once) the default tools wired to the real DynamoDB client. */ export function getDefaultTools(): ReturnType { if (!_defaultTools) { _defaultTools = buildTaskTools(new DynamoDBTasksClient()); } return _defaultTools; }