Skip to content

Repository files navigation

Worker Logo

Worker πŸ› οΈ

Research provider agent β€” produces a sourced research draft on any topic, on-chain

Worker β€” Turns any topic into a sourced, on-chain research draft.

Live on CROO Agent StoreLive Pitch PageDoraHacks BUIDL


TypeScriptNode.jsReleaseCI


The Research Workflow. Request β†’ Worker produces a sourced draft β†’ delivers { draft, sources } on-chain β†’ Litmus grades it β†’ Maestro consolidates.


πŸ“Έ See it in Action

Worker Demo

Hire Worker β†’ Get a Sourced Draft. topic β†’ research β†’ { draft, sources } on-chain.


πŸ’‘ The Problem & Solution

A multi-agent pipeline needs a producer at the top of the funnel β€” something that turns a topic into a draft other agents can grade, vet, and ship. Without it, orchestration has nothing to orchestrate.

Worker is the constellation's research provider. Any agent can hire it on-chain with a topic; it returns a structured, sourced research brief. It writes with an LLM when a key is present, and degrades to a deterministic offline draft otherwise β€” so it always delivers something gradeable.

Key Features:

  • 🧠 Topic β†’ Draft: turns { topic, depth?, context? } into { draft, sources }.
  • πŸ” Reflection-ready: accepts reviewer context so it can self-correct on a fallback re-hire (Maestro's quality loop).
  • πŸ›Ÿ Always delivers: deterministic offline draft when no ANTHROPIC_API_KEY β€” fully functional in mock mode and CI.

🌌 The Constellation β€” On-Chain A2A Graph

Worker sits at the top of the funnel: it's the producer Maestro hires first (and re-hires as the fallback researcher during its self-correction loop). Every arrow is a real CAP order settled in USDC on Base.

graph LR
User([Any Agent / User]) -->|hires| M[Maestro 🎼]
M -->|research| W[Worker πŸ› ]
M -->|self-correct retry| W
M -->|grade 0-100| L[Litmus πŸ§ͺ]
M -->|human sign-off| S[Summon πŸ‘€]
G[Gauntlet 🧀] -.->|certifies| W
classDef hot fill:#F59E0B,stroke:#111,color:#111,font-weight:bold;
class W hot;
Loading
  • High-traffic node: Maestro hires Worker first, then potentially again (fallback) with the grader's critique β€” so each orchestration can drive 1–2 Worker orders.
  • Composable output:{ draft, sources } is exactly what Litmus grades and Maestro consolidates.

πŸ”— Live Run Log β€” On-Chain Proof (Base Mainnet)

Real CAP research orders Worker fulfilled as a provider.

Total real CAP orders: 3 Β· last updated: 2026-07-07 Β· each cell is [pay tx] Β· [deliver tx] on Base Mainnet.

#DateCounterparty (requester)USDCOrder IDTx (BaseScan)Result
12026-07-07Maestro (research)0.1082878d87pay Β· deliversourced draft
22026-07-07Maestro (fallback re-research)0.109087342cpay Β· deliverimproved draft
32026-07-07Gauntlet (A2A)0.102b7a8c3bpay Β· deliversourced draft

Worker was also the target of Gauntlet's 9-probe certification (order 725c33bd) β€” its adversarial-input probes are expected-reject results, not failures.

πŸ—οΈ Architecture & Tech Stack

LayerTechnology
RuntimeNode.js (TypeScript)
ReasoningAnthropic Claude (Haiku) β€” optional, with deterministic fallback
EcosystemConstellation A2A (croo-core)
TestingVitest

🧩 CROO SDK Methods Used

Worker builds on the shared @edycutjong/croo-core SDK. The methods it actually calls:

MethodSourceRole in Worker
makeClient(sdkKey)croo-coreInstantiates the shared CROO AgentClient (Base Mainnet config) from the SDK key.
runProvider(...)croo-coreRuns Worker as an on-chain provider β€” subscribes to order/negotiation events and fulfils hires (Maestro's sub-agent).
isMockMode()croo-coreBranches between offline mock mode and live on-chain execution.
client.getNegotiation(id)@croo-network/sdkReads negotiation/order state during a hire.

πŸ“ž Hire Worker (A2A)

Any agent can hire Worker on-chain through croo-core's hire() primitive β€” it's live on the CROO Agent Store.

import{makeClient,hire}from'@edycutjong/croo-core';constclient=makeClient(process.env.CROO_SDK_KEY!);const{ delivery }=awaithire<{draft: string;sources: string[]}>(client,{serviceId: '619bfff2-3297-4a62-bc91-61bdf69c23a9',// Worker on the CROO Agent Storerequirement: {topic: 'ERC-4337 account abstraction tradeoffs'},maxPrice: 1.0,// USDC});console.log(delivery.draft,delivery.sources);

delivery β†’ { draft: string, sources: string[] }

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20
  • npm

Installation

  1. Clone: git clone https://github.com/edycutjong/worker.git
  2. Enter the directory: cd worker
  3. Install: npm install
  4. Configure: cp .env.example .env.local and fill in your service ID (+ optional ANTHROPIC_API_KEY); skip for mock mode

▢️ Run it now β€” offline mock mode (no wallet, no USDC)

npm install
CROO_MOCK=true npm run dev # boots the research provider with no on-chain calls

Research works with no API key (deterministic offline draft); set ANTHROPIC_API_KEY to enable Claude-written briefs.

πŸ§ͺ Testing & CI

npm run lint # ESLint
npm run typecheck # TypeScript check
npm run test# Run tests
npm run test:coverage # Coverage report
npm run ci # Full quality gate
LayerToolStatus
Code QualityESLint + TypeScriptβœ…
Unit TestingVitest (23 tests)βœ…
Security (SAST)CodeQLβœ…
Security (SCA)Dependabot + npm auditβœ…

🚒 Deploy

Containerized for any PaaS. Worker is a background worker (connects out to the CROO WebSocket β€” no inbound port):

docker build -t worker .
docker run --env-file .env.local worker

πŸ“„ License

MIT Β© 2026 Edy Cu

πŸ™ Acknowledgments

Built for the DoraHacks CROO Hackathon 2026.

About

πŸ› οΈ Research provider agent β€” produces a sourced, structured research draft on any topic, on-chain (CROO Constellation sub-agent)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages