fix(types): make README examples type-check #287
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 258 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.332
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #287"
general
weight: 0.35
rozzilla
Four README examples didn't compile against the package's types. This fixes all four:
1. Redis options.
MCPPluginOptions['redis']was{ host, port, password?, db?, tls? }, but the object goes straight tonew Redis(opts.redis)and the docs say any ioredis option works. It's now typed as ioredis'RedisOptions. The example usedretryDelayOnFailover, which is a Cluster-only option that ioredis ignores on a plain client, so it now usesretryStrategy. The options reference listsRedisOptions.2. URL elicitation.
mcpElicitUrl()returnsstring | null, so the example now checks for null before callingmcpNotifyElicitationComplete().3. Custom request id elicitation.
skillswas an array of free-form strings, which isn't a valid elicitation schema. It's now a multi-select enum.4. Rate limiting.
@platformatic/mcp/securitydoesn't exist because there's noexportsmap.RateLimiteris now exported from the main entry point and both examples import it from there. I didn't add anexportsmap because it would block every deep import intodist/that works today.Verification
test-d/index.test-d.tsnow covers the widerredistype (extra ioredis options, sentinels, aRedisOptionsvariable, a host-only or port-only config, and rejection of wrong value types) and theRateLimiterexport.tsc --noEmit --stricton them against the builtdist/. They pass. The original versions fail with the four errors from the issue.Breaking change
None for callers: the
redistype only gets wider.hostandportare now optional because ioredis defaults them tolocalhost:6379, so the two tsd assertions that required them were flipped. Code that readsopts.redis.hostasstringfromMCPPluginOptionsnow seesstring | undefined.Fixes #265
🤖 Generated with Claude Code
https://claude.ai/code/session_01UF4S3w7iA83V9DVsasLJzM