{"id":51699092,"url":"https://github.com/edycutjong/worker","last_synced_at":"2026-07-16T08:33:45.926Z","repository":{"id":370047770,"uuid":"1291666241","full_name":"edycutjong/worker","owner":"edycutjong","description":"🛠️ Research provider agent — produces a sourced, structured research draft on any topic, on-chain (CROO Constellation sub-agent)","archived":false,"fork":false,"pushed_at":"2026-07-14T13:02:48.000Z","size":2180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-16T08:33:43.594Z","etag":null,"topics":["a2a","ai-agent","autonomous-agents","base","croo","croo-constellation","dorahacks","onchain","typescript","usdc"],"latest_commit_sha":null,"homepage":"https://edycutjong.github.io/worker/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edycutjong.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-07T02:07:12.000Z","updated_at":"2026-07-14T13:02:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/edycutjong/worker","commit_stats":null,"previous_names":["edycutjong/worker"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/edycutjong/worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fworker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fworker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fworker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fworker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edycutjong","download_url":"https://codeload.github.com/edycutjong/worker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edycutjong%2Fworker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35537751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-16T02:00:06.687Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a2a","ai-agent","autonomous-agents","base","croo","croo-constellation","dorahacks","onchain","typescript","usdc"],"created_at":"2026-07-16T08:33:44.116Z","updated_at":"2026-07-16T08:33:45.917Z","avatar_url":"https://github.com/edycutjong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/icon-animated.svg\" alt=\"Worker Logo\" width=\"120\"\u003e\n\n  \u003ch1\u003eWorker 🛠️\u003c/h1\u003e\n  \u003cp\u003e\u003cem\u003eResearch provider agent — produces a sourced research draft on any topic, on-chain\u003c/em\u003e\u003c/p\u003e\n\n  \u003cimg src=\"docs/readme-hero-animated.svg\" alt=\"Worker — Turns any topic into a sourced, on-chain research draft.\" width=\"100%\"\u003e\n\n  \u003cbr/\u003e\n\n  [![Live on CROO Agent Store](https://img.shields.io/badge/CROO_Agent_Store-Live-6EE646?style=for-the-badge\u0026labelColor=0F0F0F)](https://agent.croo.network/agents/45bda7ab-d91f-4bf4-823a-a4935971092f)\n  [![Live Pitch Page](https://img.shields.io/badge/Live_Pitch-View-EC4899?style=for-the-badge\u0026labelColor=0F0F0F)](https://edycutjong.github.io/worker/)\n  [![DoraHacks BUIDL](https://img.shields.io/badge/DoraHacks-BUIDL_%2347030-8b5cf6?style=for-the-badge\u0026labelColor=0F0F0F)](https://dorahacks.io/buidl/47030)\n\n  \u003cbr/\u003e\n\n  ![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=flat\u0026logo=typescript\u0026logoColor=white)\n  ![Node.js](https://img.shields.io/badge/Node.js-339933?style=flat\u0026logo=node.js\u0026logoColor=white)\n  [![Release](https://img.shields.io/github/v/release/edycutjong/worker?style=flat\u0026logo=github)](https://github.com/edycutjong/worker/releases)\n  [![CI](https://github.com/edycutjong/worker/actions/workflows/ci.yml/badge.svg)](https://github.com/edycutjong/worker/actions/workflows/ci.yml)\n\n\u003c/div\u003e\n\n---\n\n\u003e **The Research Workflow.** Request → Worker produces a sourced draft → delivers `{ draft, sources }` on-chain → Litmus grades it → Maestro consolidates.\n\n---\n\n## 📸 See it in Action\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/see-in-action.png\" alt=\"Worker Demo\" width=\"100%\"\u003e\n\u003c/div\u003e\n\n\u003e **Hire Worker → Get a Sourced Draft.** topic → research → `{ draft, sources }` on-chain.\n\n---\n\n## 💡 The Problem \u0026 Solution\nA 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.\n\n**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.\n\n**Key Features:**\n- 🧠 **Topic → Draft:** turns `{ topic, depth?, context? }` into `{ draft, sources }`.\n- 🔁 **Reflection-ready:** accepts reviewer `context` so it can self-correct on a fallback re-hire (Maestro's quality loop).\n- 🛟 **Always delivers:** deterministic offline draft when no `ANTHROPIC_API_KEY` — fully functional in mock mode and CI.\n\n## 🌌 The Constellation — On-Chain A2A Graph\n\nWorker 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.\n\n```mermaid\ngraph LR\n    User([Any Agent / User]) --\u003e|hires| M[Maestro 🎼]\n    M --\u003e|research| W[Worker 🛠]\n    M --\u003e|self-correct retry| W\n    M --\u003e|grade 0-100| L[Litmus 🧪]\n    M --\u003e|human sign-off| S[Summon 👤]\n    G[Gauntlet 🧤] -.-\u003e|certifies| W\n    classDef hot fill:#F59E0B,stroke:#111,color:#111,font-weight:bold;\n    class W hot;\n```\n\n- **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.\n- **Composable output:** `{ draft, sources }` is exactly what Litmus grades and Maestro consolidates.\n\n## 🔗 Live Run Log — On-Chain Proof (Base Mainnet)\n\nReal CAP research orders Worker fulfilled as a **provider**.\n\n**Total real CAP orders: 3** · _last updated: 2026-07-07_ · each cell is `[pay tx]` · `[deliver tx]` on Base Mainnet.\n\n| # | Date | Counterparty (requester) | USDC | Order ID | Tx (BaseScan) | Result |\n|---|------|--------------------------|------|----------|---------------|--------|\n| 1 | 2026-07-07 | Maestro (research) | 0.10 | `82878d87` | [pay](https://basescan.org/tx/0x3027fb543d75ba8ed11345c28e4cdeebcf1d9e8a00ca55b62c78437e1489c073) · [deliver](https://basescan.org/tx/0xd524336641fca544bd791bdbcdfd13500129efd1b8e93028446aff749aef2346) | sourced draft |\n| 2 | 2026-07-07 | Maestro (fallback re-research) | 0.10 | `9087342c` | [pay](https://basescan.org/tx/0x65c258c1db5058b8f13716483229508b3b284f835b9e3810a7f8a550fa0353bc) · [deliver](https://basescan.org/tx/0x0c3b5afe082bfc0a78da9268aad81f71d69ec0b38313769fef9476f5705a9033) | improved draft |\n| 3 | 2026-07-07 | Gauntlet (A2A) | 0.10 | `2b7a8c3b` | [pay](https://basescan.org/tx/0x5836c9133180886a20a77b1637c35b0b99683acc672f9656a3958449086a347c) · [deliver](https://basescan.org/tx/0xed8a1a803b264b206ce61a1072e157f5fa148eed86b668da2c433043dd3ebd92) | sourced draft |\n\n\u003e Worker was also the **target** of Gauntlet's 7-probe certification (order `725c33bd`) — its adversarial-input probes are expected-reject results, not failures.\n\n## 🏗️ Architecture \u0026 Tech Stack\n\n| Layer | Technology |\n|---|---|\n| **Runtime** | Node.js (TypeScript) |\n| **Reasoning** | Anthropic Claude (Haiku) — optional, with deterministic fallback |\n| **Ecosystem** | Constellation A2A (croo-core) |\n| **Testing** | Vitest |\n\n## 🧩 CROO SDK Methods Used\n\nWorker builds on the shared **`@edycutjong/croo-core`** SDK. The methods it actually calls:\n\n| Method | Source | Role in Worker |\n|---|---|---|\n| `makeClient(sdkKey)` | croo-core | Instantiates the shared CROO `AgentClient` (Base Mainnet config) from the SDK key. |\n| `runProvider(...)` | croo-core | Runs Worker as an on-chain **provider** — subscribes to order/negotiation events and fulfils hires (Maestro's sub-agent). |\n| `isMockMode()` | croo-core | Branches between offline mock mode and live on-chain execution. |\n| `client.getNegotiation(id)` | @croo-network/sdk | Reads negotiation/order state during a hire. |\n\n## 📞 Hire Worker (A2A)\n\nAny agent can hire **Worker** on-chain through `croo-core`'s `hire()` primitive — it's live on the [CROO Agent Store](https://agent.croo.network/agents/45bda7ab-d91f-4bf4-823a-a4935971092f).\n\n```ts\nimport { makeClient, hire } from '@edycutjong/croo-core';\n\nconst client = makeClient(process.env.CROO_SDK_KEY!);\n\nconst { delivery } = await hire\u003c{ draft: string; sources: string[] }\u003e(client, {\n  serviceId: '619bfff2-3297-4a62-bc91-61bdf69c23a9', // Worker on the CROO Agent Store\n  requirement: { topic: 'ERC-4337 account abstraction tradeoffs' },\n  maxPrice: 1.0, // USDC\n});\n\nconsole.log(delivery.draft, delivery.sources);\n```\n\n`delivery` → `{ draft: string, sources: string[] }`\n\n## 🚀 Getting Started\n\n### Prerequisites\n- Node.js ≥ 20\n- npm\n\n### Installation\n1. Clone: `git clone https://github.com/edycutjong/worker.git`\n2. Enter the directory: `cd worker`\n3. Install: `npm install`\n4. Configure: `cp .env.example .env.local` and fill in your service ID (+ optional `ANTHROPIC_API_KEY`); skip for mock mode\n\n### ▶️ Run it now — offline mock mode (no wallet, no USDC)\n```bash\nnpm install\nCROO_MOCK=true npm run dev   # boots the research provider with no on-chain calls\n```\nResearch works with **no API key** (deterministic offline draft); set `ANTHROPIC_API_KEY` to enable Claude-written briefs.\n\n## 🧪 Testing \u0026 CI\n\n```bash\nnpm run lint          # ESLint\nnpm run typecheck     # TypeScript check\nnpm run test          # Run tests\nnpm run test:coverage # Coverage report\nnpm run ci            # Full quality gate\n```\n\n| Layer | Tool | Status |\n|---|---|---|\n| Code Quality | ESLint + TypeScript | ✅ |\n| Unit Testing | Vitest (23 tests) | ✅ |\n| Security (SAST) | CodeQL | ✅ |\n| Security (SCA) | Dependabot + npm audit | ✅ |\n\n## 🚢 Deploy\nContainerized for any PaaS. Worker is a background **worker** (connects out to the CROO WebSocket — no inbound port):\n```bash\ndocker build -t worker .\ndocker run --env-file .env.local worker\n```\n\n## 📄 License\n[MIT](LICENSE) © 2026 Edy Cu\n\n## 🙏 Acknowledgments\nBuilt for the DoraHacks CROO Hackathon 2026.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedycutjong%2Fworker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedycutjong%2Fworker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedycutjong%2Fworker/lists"}