Extend x402 actual-cost settlement beyond getStyleProfile to every
Twitter-capable tool (findSimilarUsers, getEngagementMetrics,
getPostingPatterns, getTopicModeling, getSentimentTrends,
getEngagementDrivers). Each carries a twitterPostCount (or source
platform + post count) in its response so settlement passes on the
realized Twitter API lookup and per-post costs.
- tools: payableDef uses UsesTwitter + TwitterPostCap instead of a
fixed Scheme; registerTools advertises upto at the cap-derived
maximum when Twitter is enabled, otherwise exact at the flat base
price.
- x402: export pricing constants and MaxTwitterCostMicro /
FormatPriceMicro / MicroFromPriceString helpers; add
AddPayableToolWithResolver and a per-tool settleResolvers map used
by both the MCP wrapper and REST override; buildSchemeConfigs
registers only the schemes declared in a tool's requirements.
- analytics: default aggregates include Twitter only when enabled;
result count recorded before caching and returned as twitterPostCount.
- server/twitterEnabled gates the upto switch (config bearer token).