Skip to content

HERALD X Agent — LLM brain for mentions and DMs#145

Merged
rz1989s merged 5 commits intomainfrom
feat/herald-x-agent
Apr 10, 2026
Merged

HERALD X Agent — LLM brain for mentions and DMs#145
rz1989s merged 5 commits intomainfrom
feat/herald-x-agent

Conversation

@rz1989s
Copy link
Copy Markdown
Member

@rz1989s rz1989s commented Apr 10, 2026

Summary

Gives HERALD an LLM brain. When the poller detects mentions or DMs on X, the X adapter routes them through AgentCore with HERALD-specific tools and system prompt, generating autonomous responses.

  • Configurable chat/chatStream — accepts optional systemPrompt, tools, toolExecutor overrides (backward compatible)
  • AgentConfig — AgentCore constructor accepts identity config (different tools/prompt per agent)
  • X adapter — subscribes to herald:mention and herald:dm events on guardian bus, skips spam, respects budget gates, routes through AgentCore, auto-replies via replyTweet/sendDM tools
  • Startup wiring — X adapter starts before poller (subscribes to events before they're emitted)
Poller → emit herald:mention/dm → X Adapter → AgentCore (HERALD config) → LLM → replyTweet/sendDM

New/Modified files

  • packages/agent/src/agent.ts — AgentOptions extended
  • packages/agent/src/core/types.ts — AgentConfig interface
  • packages/agent/src/core/agent-core.ts — constructor accepts config
  • packages/agent/src/adapters/x.ts — X adapter (event bus → AgentCore → X API)
  • packages/agent/src/index.ts — wires X adapter + poller startup
  • packages/agent/tests/adapters/x.test.ts — 7 tests

Test plan

  • 497 root tests passing
  • 23 new tests (4 core + 12 web + 7 X adapter)
  • tsc --noEmit clean
  • Set X API credentials on VPS and verify live mention response

rz1989s added 5 commits April 10, 2026 09:36
Extends AgentOptions with systemPrompt, tools, and toolExecutor fields so
different agent identities (SIPHER vs HERALD) can share the same chat loop
with their own prompts and tool sets. Falls back to SIPHER defaults when no
overrides are passed, preserving all existing behavior unchanged.
…odel)

Add AgentConfig interface to packages/agent/src/core/types.ts and
export it from the core barrel. AgentCore now accepts an optional config
object in its constructor; config fields are threaded through to chat()
and chatStream() so different agent identities (SIPHER, HERALD, etc.)
can supply their own system prompt, tool registry, and model without
subclassing. Empty constructor default preserved — all 497 tests pass.
@rz1989s rz1989s merged commit e6cf29d into main Apr 10, 2026
1 check passed
@rz1989s rz1989s deleted the feat/herald-x-agent branch April 10, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant