Files
wehub-resource-sync 426e9eeabd
Voice Workbench / headless workbench (mocked backends) (push) Has been cancelled
Voice Workbench / real acoustic lane (nightly, provisioned only) (push) Has been cancelled
ci / test (push) Has been cancelled
ci / lint-and-format (push) Has been cancelled
ci / build (push) Has been cancelled
ci / dev-startup (push) Has been cancelled
gitleaks / gitleaks (push) Has been cancelled
Markdown Links / Relative Markdown Links (push) Has been cancelled
Quality (Extended) / Homepage Build (PR smoke) (push) Has been cancelled
Quality (Extended) / Comment-only diff guard (push) Has been cancelled
Quality (Extended) / Format + Type Safety Ratchet (push) Has been cancelled
Quality (Extended) / Develop Gate (secret scan + UI determinism) (push) Has been cancelled
Quality (Extended) / Develop Gate (lint) (push) Has been cancelled
Chat shell gestures / Chat shell gesture + parity e2e (push) Has been cancelled
Cloud Gateway Discord / Test (push) Has been cancelled
Benchmark Bridge Tests / benchmark (bunx @biomejs/biome check packages/lifeops-bench/src, benchmark-lint) (push) Has been cancelled
Benchmark Bridge Tests / benchmark (bunx vitest run --config packages/lifeops-bench/vitest.config.ts --root packages/lifeops-bench --passWithNoTests, benchmark-tests) (push) Has been cancelled
Build Agent Image / build-and-push (push) Has been cancelled
Dev Smoke / bun run dev onboarding chat (push) Has been cancelled
Dev Smoke / Vite HMR dependency-level smoke (push) Has been cancelled
Electrobun Submodule Guard / electrobun gitlink is fetchable (push) Has been cancelled
Publish @elizaos/example-code / check_npm (push) Has been cancelled
Publish @elizaos/example-code / publish_npm (push) Has been cancelled
Publish @elizaos/plugin-elizacloud / verify_version (push) Has been cancelled
Publish @elizaos/plugin-elizacloud / publish_npm (push) Has been cancelled
Sandbox Live Smoke / Sandbox live smoke (push) Has been cancelled
Snap Build & Test / Build Snap (amd64) (push) Has been cancelled
Snap Build & Test / Build Snap (arm64) (push) Has been cancelled
Test Packaging / elizaos CLI global-install smoke (node + bun) (push) Has been cancelled
Cloud Gateway Webhook / Test (push) Has been cancelled
Cloud Tests / lint-and-types (push) Has been cancelled
Cloud Tests / unit-tests (push) Has been cancelled
Cloud Tests / integration-tests (push) Has been cancelled
Cloud Tests / e2e-tests (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Apps Worker (Product 2) / Determine environment (push) Has been cancelled
Deploy Apps Worker (Product 2) / Deploy apps worker to apps-control host (${{ needs.determine-env.outputs.environment }}) (push) Has been cancelled
Deploy Eliza Provisioning Worker / Determine environment (push) Has been cancelled
Deploy Eliza Provisioning Worker / Deploy worker to Hetzner host (${{ needs.determine-env.outputs.environment }} @ ${{ needs.determine-env.outputs.deployment_sha }}) (push) Has been cancelled
Dev Smoke / Classify changed paths (push) Has been cancelled
supply-chain / sbom (push) Has been cancelled
supply-chain / vulnerability-scan (push) Has been cancelled
Build, Push & Deploy to Phala Cloud / build-and-push (push) Has been cancelled
Test Packaging / Validate Packaging Configs (push) Has been cancelled
Test Packaging / Build & Test PyPI Package (push) Has been cancelled
Test Packaging / PyPI on Python ${{ matrix.python }} (push) Has been cancelled
Test Packaging / Pack & Test JS Tarballs (push) Has been cancelled
UI Fixture E2E / ui-fixture-e2e (push) Has been cancelled
UI Fixture E2E / fixture-e2e (push) Has been cancelled
UI Story Gate / story-gate (push) Has been cancelled
vault-ci / test (macos-latest) (push) Has been cancelled
vault-ci / test (ubuntu-latest) (push) Has been cancelled
vault-ci / test (windows-latest) (push) Has been cancelled
vault-ci / app-core wiring tests (push) Has been cancelled
verify-patches / verify patches/CHECKSUMS.sha256 (push) Has been cancelled
Voice Benchmark Smoke / voice-emotion fixture smoke (push) Has been cancelled
Voice Benchmark Smoke / voiceagentbench fixture smoke (push) Has been cancelled
Voice Benchmark Smoke / voicebench-quality unit smoke (push) Has been cancelled
Voice Benchmark Smoke / voicebench TypeScript unit (no audio) (push) Has been cancelled
Voice Benchmark Smoke / voice bench smoke summary (push) Has been cancelled
Windows CI / windows ([bun run --cwd packages/app-core test bun run --cwd packages/elizaos test bun run --cwd packages/cloud/shared test], app-and-cli) (push) Has been cancelled
Windows CI / windows ([bun run --cwd packages/scenario-runner test bun run --cwd packages/vault test bun run --cwd packages/security test bun run --cwd plugins/plugin-coding-tools test], framework-packages) (push) Has been cancelled
Windows CI / windows ([bun run --cwd plugins/plugin-elizacloud test bun run --cwd plugins/plugin-discord test bun run --cwd plugins/plugin-anthropic test bun run --cwd plugins/plugin-openai test bun run --cwd plugins/plugin-app-control test bun run --cwd plugins/pl… (push) Has been cancelled
Windows CI / windows ([node packages/scripts/run-turbo.mjs run build --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/agent --concurrency=4 node packages/scripts/run-bash-linux-only.mjs scripts/verify-riscv64-buildpaths.sh node packages/scripts/run… (push) Has been cancelled
Windows CI / windows ([node packages/scripts/run-turbo.mjs run typecheck --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/cloud-shared --concurrency=4 bun run --cwd packages/core test bun run --cwd packages/shared test], core-runtime, 75) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:43:05 +08:00

6.8 KiB

@elizaos/plugin-birdclaw

Birdclaw (https://birdclaw.sh) local-first Twitter/X memory for elizaOS: the agent and the app get a typed window onto the owner's private Twitter archive — archived timeline, mentions, DMs, likes, and bookmarks in a local SQLite database — plus live-sync triggers and AI digests.

Purpose / role

birdclaw is steipete's local-first Twitter workspace: birdclaw init + archive import + optional xurl/bird transports populate a single SQLite DB (default ~/.birdclaw/). Its stable integration surface is the CLI — "stable --json envelopes go to stdout, progress and warnings to stderr". This plugin wraps that CLI with a service, gives the agent an owner-gated BIRDCLAW action, serves /api/birdclaw/* routes, and registers the Birdclaw launcher view.

Everything degrades explicitly when birdclaw is missing: the view renders a setup screen with install guidance, data routes return 503 { installed: false }, and the action stops validating (the planner never offers a dead capability).

Enablement

Auto-on when the host actually has birdclaw (see birdclawRequested in packages/agent/src/runtime/plugin-collector.ts): the birdclaw binary on PATH, BIRDCLAW_BIN/BIRDCLAW_HOME set, or an existing ~/.birdclaw root. Never loads on mobile (the CLI cannot exist in a store-build sandbox, so the tile never appears where it cannot work). Force with config agents.defaults.birdclaw: true|false or ELIZA_BIRDCLAW=1/0. Also listed in OPTIONAL_CORE_PLUGINS for admin-panel enablement.

Plugin surface

Service

  • BirdclawService (serviceType = "BIRDCLAW_SERVICE", src/birdclaw/service.ts) — binary resolution (BIRDCLAW_BINbirdclaw on PATH), a 30s-cached availability probe (--version), and typed methods: status() (db stats + transport), searchTweets(), inbox(), sync(collection), digest(period). Spawns via execFile argv arrays (no shell), with an env allowlist (PATH, HOME, BIRDCLAW_HOME, plus OPENAI_API_KEY only from the dedicated BIRDCLAW_OPENAI_API_KEY knob) — the agent's own provider keys are never inherited by the CLI.

Action

  • BIRDCLAW (src/actions/birdclaw.ts) — owner-only umbrella action with op dispatch: search (full-text over home/mentions/authored, --liked, --bookmarked), inbox (ranked mention/DM triage), sync (timeline|mentions|authored|likes|bookmarks), digest (today|24h|yesterday|week; needs birdclaw's OpenAI key), status. validate requires the service to be registered AND the CLI installed (cached probe — no per-message process storm).

Routes (src/routes/birdclaw-routes.ts, private, rawPath)

  • GET /api/birdclaw/status — always 200; { installed: false, message } drives the view's setup screen.
  • GET /api/birdclaw/tweets?resource=&q=&liked=&bookmarked=&limit=
  • GET /api/birdclaw/inbox?kind=&limit=
  • POST /api/birdclaw/sync { collection }
  • POST /api/birdclaw/digest { period }
  • Errors: 400 invalid params, 502 CLI failure (stderr tail in error), 503 service/binary missing.

View

  • birdclawBirdclawView, path /birdclaw, bundle dist/views/bundle.js, modalities ["gui"]. Tabs: Timeline / Mentions / Posted / Likes / Bookmarks / Inbox; per-tab Sync button (shown only when a live transport is installed); needs-reply nudge; chat handoff on "Ask" (per the chat-first design law, free-form search lives in the floating chat via the BIRDCLAW action, not an input in the view).

Layout

src/
  index.ts                     Public API barrel
  plugin.ts                    birdclawPlugin (service + action + routes + view)
  types.ts                     Display DTOs + enum guards (resources, kinds, collections, periods)
  birdclaw/
    cli.ts                     execFile seam: BirdclawExec, runBirdclawJson/Text, typed BirdclawCliError
    service.ts                 BirdclawService + pure arg builders + wire parsers
    birdclaw.real.test.ts      REAL-CLI suite (gated; bun run test:real)
  actions/birdclaw.ts          BIRDCLAW umbrella action + formatters
  routes/birdclaw-routes.ts    status/tweets/inbox/sync/digest handlers
  components/birdclaw/
    BirdclawSpatialView.tsx    Presentational (snapshot + onAction, spatial primitives)
    BirdclawView.tsx           Data wrapper (fetcher seam, tab state machine, sync flow)
    birdclaw-view-bundle.ts    Vite bundle entry — re-exports BirdclawView

Commands

bun run --cwd plugins/plugin-birdclaw typecheck
bun run --cwd plugins/plugin-birdclaw lint
bun run --cwd plugins/plugin-birdclaw test         # offline unit suite (fake exec seam)
bun run --cwd plugins/plugin-birdclaw test:real    # REAL birdclaw CLI against a temp BIRDCLAW_HOME
bun run --cwd plugins/plugin-birdclaw build        # build:js (tsup) + build:views (vite) + build:types (tsc)

Config / env vars

Variable Default Purpose
BIRDCLAW_BIN birdclaw on PATH Absolute path to the birdclaw CLI.
BIRDCLAW_HOME CLI's own ~/.birdclaw Data root passed to every spawn.
BIRDCLAW_OPENAI_API_KEY Forwarded to the CLI as OPENAI_API_KEY for its AI features (digest, inbox scoring). Never falls back to the agent's own key.
ELIZA_BIRDCLAW auto-detect 1/0 force-enables/disables plugin loading (collector gate).

Conventions / gotchas

  • Exit code is the only success signal. birdclaw writes warnings (e.g. Node 22's node:sqlite ExperimentalWarning) to stderr on successful runs — never treat stderr output as failure.
  • search tweets returns a top-level JSON array; inbox returns { items }. The parsers narrow both to flat display DTOs and skip malformed rows (schema churn upstream is expected — "WIP. Real and usable").
  • The digest envelope is still settling upstreamdigest() accepts a JSON envelope (digest/text/report field) or raw markdown.
  • Timeouts: reads 30s, sync/digest 120s. Sync runs synchronously in the route; the view disables the button while in flight.
  • No background poll in the view. The archive only changes via sync/import, so the view reloads after its own syncs instead of polling.
  • The view-bundle vite config must keep codeSplitting: false (shared config does this) — see the #11040 blank-view regression.
  • See the root AGENTS.md for repo-wide conventions.

NON-NEGOTIABLE — evidence & real end-to-end tests

The binding standard is AGENTS.md. The unit suite proves the arg-building/parsing/route/action/view logic against an injected exec seam; birdclaw.real.test.ts (bun run test:real) drives the REAL CLI — real spawn, real SQLite, real --json envelopes — against a throwaway BIRDCLAW_HOME seeded by birdclaw init. UI changes additionally require the rendered proof set (screenshots, walkthrough, client+server logs) from AGENTS.md.