CORE DIRECTORY // SYSTEM.USER.DIANA_ISMAIL
Labs by Diana — Experiments that ship.
Side projects that got out of hand. AI tools built for problems I kept tripping over — now live, now yours.
Diabolical Labs Toolkit
MODULE_009
TECHNICAL_OVERVIEW
Eight packages: @diabolicallabs/llm-client (a unified LLM client covering Anthropic, OpenAI, Gemini, DeepSeek, and Perplexity - streaming, structured outputs via Zod 4, per-call timeouts, retry/failover, web-grounded citations, and the LlmToolSchema discriminated union for declaring tool input schemas across providers); @diabolicallabs/llm-pricing (cost computation and remote pricing table management - ends the phantom cascade pattern that previously caused major version bumps on minor pricing updates); @diabolicallabs/agent-sdk (cost-tracking middleware that wraps the LLM client and ships spend data to the Agent Spend Dashboard); @diabolicallabs/notion (Notion REST API helpers - page creation, property serialisation, conflict retry, rate-limit backoff); @diabolicallabs/rate-limiter (a Redis sliding-window rate limiter that fails closed on outage); @diabolicallabs/telegram (send-only Telegram notifier - named error taxonomy, retry_after handling, no SDK dependency); @diabolicallabs/slack (send-only Slack notifier via chat.postMessage and incoming webhooks, with named error taxonomy and retry); and @diabolicallabs/notifier-core (shared Notifier interface, PlatformError taxonomy, and retryWithJitter helper for the notifier family - zero runtime deps). The core three (llm-client, llm-pricing, agent-sdk) are consumed across GEO Audit, FitChecker, Labs, and the Agent Spend Dashboard; the notifier and utility packages are available for fleet adoption.
PROJECT_LEARNINGS_LOG
KEY_LEARNING_01
Per-call timeoutMs has to propagate all the way to the underlying SDK socket budget - not just cancel the Promise - or a long-running LLM call will ignore it. The distinction only became visible when GEO Audit Advanced audits hit the SDK's 60-second default on 23 KB system-prompt calls, despite a 300-second budget being set at the application layer.
KEY_LEARNING_02
Structured outputs across five LLM providers require five different mechanisms: OpenAI uses response_format: json_schema strict:true, Anthropic uses forced tool-use, Gemini uses responseSchema + responseMimeType, and DeepSeek and Perplexity fall back to a prompt-only path with a balanced-brace JSON extractor. A naive fence-strip approach breaks silently when providers append citation notes after the closing code fence.
KEY_LEARNING_03
Independent semver per package via Changesets means a consumer can pin llm-client at a stable version while agent-sdk follows its own release cycle. The cost is explicit inter-package dependency declarations in every changeset - auto-bumping catches most of them, but a missed dependency declaration causes a silent version skew that only surfaces at the consumer's install step.