Replace all console.log/error with structured JSON logging via pino.
Every log entry automatically carries toolName, requestId, and workspaceId
from the current AsyncLocalStorage scope — no need to thread context.
Changes:
- package.json: add pino@^9.6.0, pino-pretty@^13.0.0
- src/utils/context.ts: new — AsyncLocalStorage context + getContext/withContext/runWithContext
- src/utils/logger.ts: new — info/warn/error/debug helpers, JSON output in prod, pretty in dev
- src/api.ts: both console.error → logError(...)
- src/index.ts: all console.error → logInfo/logWarn/logError(...)
- known-issues.md: mark KI-001 resolved
Co-authored-by: Molecule AI SDK-Dev <sdk-dev@agents.moleculesai.app>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>