Bird
Bird is the single X/Twitter router. Use SocialData as the default, cheap read plane. Use the official xurl CLI only when the task requires authenticated account context, an X-native object, or an explicitly approved account mutation. Do not make both providers answer the same routine read.
Triggers and compatibility
Use for X/Twitter URLs, tweet/thread/article extraction, search, profiles, replies/quotes/context, media retrieval, and X account actions.
Preserve these entrypoints:
/bird <request>— canonical router.- Legacy
bird.py <URL-or-ID>— still reads through SocialData. /xurl ...— compatibility entrypoint for users who explicitly request xurl; it must follow Bird's routing and write gates.
Deterministic routing
| Intent | Primary | Fallback | Boundary |
|---|---|---|---|
| Read tweet by URL/ID | SocialData | web/browser only for public visible evidence | Never escalate to xurl merely because it exists |
| Read thread/conversation/replies | SocialData | xurl read only when X-native context is uniquely required and supported | Determine thread from fetched data, not URL shape |
| Search posts | SocialData bounded search | existing SocialData/web research route | Current xurl recent-search access is not assumed |
| Read public profile | SocialData | xurl user lookup if account-specific/current X view is needed | No bulk graph collection |
| X Article | SocialData tweet payload first; parse nested article | xurl raw tweet endpoint with article field | Follow linked first-party page when article text is absent |
| Download attached media | SocialData metadata + bounded HTTPS download | browser only for visible public media | No cookies in URLs/logs; validate host/size/type |
| Who am I / authenticated identity | xurl | none | Read-only account context |
| Exact X-native object needed for later engagement | xurl | SocialData for discovery/context | Use xurl only for the exact object/endpoint |
| Post, reply, quote, delete, like, repost, bookmark, follow, block, mute, DM, upload | xurl | none | Explicit approval of exact target, content, and effect required |
Load provider routing for endpoint recipes, errors, and fallback rules. Load xurl operations only for an xurl-specific task.
Provider and cost contract
- SocialData is the default for every ordinary read. Use the configured direct
SOCIALDATA_API_KEYfirst in the current runtime. Use the approved Human20 Keys SocialData proxy when a direct key is absent and the H20 customer key hassocialdatacapability. A generic H20 model key may exist but returnprovider not allowed: socialdata; that does not justify switching to xurl. - The live Human20 Keys default price class for
social-requestwas verified at0 credits/request; treat that as mutable runtime state and recheck before claiming cost. - One user request should normally consume one lookup/search plus only the bounded dependent reads needed for a thread or requested context. Do not fan out, scrape followers/following, export, stream, poll, or bulk-fetch.
- Never silently fall back from SocialData to paid X API calls.
xurlis selected by capability need, not by provider failure.
Secrets and execution safety
- Never read, print, parse, summarize, or expose secret stores,
~/.xurl, cookies, authorization headers, API keys, bearer tokens, request signatures, or environment values. - Verify credentials only through safe status/probe commands. Do not use xurl
--verbose/-vor inline credential flags. - SocialData calls are read-only and bounded. Treat
401/403as credential/policy,402as credits/billing,404as absent/private/deleted,429as rate limit, and5xxas provider failure. Do not mislabel one class as another. - Browser/relay is last resort and never a cookie-extraction mechanism.
- Writes are protected effects. Before any xurl mutation, reread the exact target and payload, require explicit user approval for that exact effect, execute once, and verify from raw xurl/X response. Approval to research is not approval to engage or publish.
- DMs, deletion, blocks, account changes, media upload, and public posting never happen implicitly.
Workflow
- Classify the request:
read,search,profile,thread,article,media,account-read, orwrite. - Normalize X URL/ID without changing the identifier. Fetch before deciding tweet vs thread.
- Route from the table. For routine reads, call SocialData exactly once first.
- Parse defensively. Article payloads may live under
article.title,article.preview_text, andarticle.content_state.blocks[]; media may be nested in quoted or retweeted objects. - If the user asks whether the item matters, open linked first-party repositories/docs/articles and inspect attached media. Keep the X post as a claim/source, not automatic proof.
- If the selected provider fails, report the exact failure. Use only the stated fallback when it can still answer the same request without expanding cost, privacy, or effect.
- Return source-faithful output and a compact provider receipt.
Output Contract
Return:
Result: <full requested content or concise faithful answer>
Type: tweet | thread | article | profile | search | account-action
Author/source: <safe public identity + canonical URL>
Provider: SocialData | xurl | web/browser fallback
Evidence: <IDs, timestamp, metrics/context when available>
Action receipt: <only for approved xurl mutations; exact status/object ID>
Limitation: <missing/private/deleted/rate/plan/provider gap, or none>
Do not expose internal keys, auth modes, secret locations, or private runtime details in user-facing receipts.
Quick Test Checklist
-
/bird <tweet URL>selects SocialData, not xurl. -
/bird search from:handleselects bounded SocialData search. -
/bird whoamiselects read-only xurl identity. -
/bird reply <URL> <text>stops for exact approval before xurl. - SocialData
402is not reported as missing credentials; xurl recent-search failure does not disable identity/profile reads. - Thread and article parsing use fetched structure, not URL guesses.
- Removing the SocialData-default or write-approval contract makes validation fail.
Done Criteria
- The requested X content/action is complete or one exact blocker is reported.
- Routine reads used SocialData first and avoided duplicate provider spend.
- xurl was used only for a capability-specific reason.
- Any write had exact approval and raw API readback.
- No secret/cookie/private credential material entered output, artifacts, or logs.