Skip to content

edycutjong/maestro

Repository files navigation

Maestro Logo

Maestro 🎼

Callable orchestrator β€” hires specialist agents on-chain, grades their work, delivers one vetted result

Maestro

Live on CROO Agent Store Live Pitch Page DoraHacks BUIDL


TypeScript Node.js Release CI


πŸ“Έ See it in Action

Maestro Demo

The Orchestrator Workflow. Request β†’ Maestro Hires Specialists β†’ Agents Work β†’ Maestro Grades & Consolidates β†’ Final Result Delivered.


πŸ’‘ The Problem & Solution

Single agents fail at complex tasks because they lack specialized context and self-reflection. Managing a multi-agent system manually is cumbersome and non-scalable. Maestro solves this by acting as an autonomous orchestrator. It intelligently provisions the right specialist agents from the Constellation network, oversees their work, and distills their outputs into a single, high-fidelity result.

Key Features:

  • ⚑ Autonomous Hiring: Automatically selects the best specialist agents for a specific prompt.
  • πŸ”’ Quality Assurance: Integrates with grading agents to evaluate outputs before delivery.
  • 🎨 Consolidated Outputs: Delivers a single, cohesive response instead of raw multi-agent logs.
  • πŸ”„ Active State Recovery: Recovers and resumes pending pipeline executions upon startup if container restarts.
  • ⚑ Fast Fallover Retry Bypass: Intercepts subcontractor rejections/expirations instantly, bypassing retry loops to cascade to backup providers.
  • πŸ’Ό Dynamic Payout Wallet: Uses MAESTRO_PAYOUT_ADDRESS to route fee revenues directly to custom cold storage.

🌌 The Constellation β€” On-Chain A2A Graph

Maestro is the hub of a multi-agent constellation. Every arrow below is a real CAP order settled in USDC on Base β€” escrow-backed, with automatic refunds on failure. This composition is impossible (or far worse) on a flat REST marketplace: there is no escrow, no on-chain provenance, and no way to refund a buyer when a sub-agent underperforms.

graph LR
    User([Any Agent / User]) -->|hires| M[Maestro 🎼]
    M -->|research| W[Worker πŸ› ]
    M -->|self-correct retry| FW[Fallback Worker πŸ› ]
    M -->|grade 0-100| L[Litmus πŸ§ͺ]
    M -->|human sign-off| S[Summon πŸ‘€]
    G[Gauntlet 🧀] -.->|certifies| M
    GL[Goldilocks 🧈] -.->|prices| M
    classDef hot fill:#F59E0B,stroke:#111,color:#111,font-weight:bold;
    class M hot;
Loading
  • Depth: Maestro runs a cognitive reflection loop β€” if Litmus scores a draft below threshold, it re-hires a fallback Worker with the grader's critique, re-grades, then escalates to a human via Summon.
  • Fiduciary refund: if quality stays critically low, Maestro autonomously refunds the buyer's escrow instead of delivering substandard work.
  • One request β†’ many CAP orders: a single pipeline run can generate 4–5 on-chain sub-orders across 3–4 distinct agents.

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

Real CAP orders settled in USDC during the hackathon. As the constellation hub, one Maestro request fans out into several sub-hires β€” so each run adds multiple rows.

Total real CAP orders: 6 Β· last updated: 2026-07-07 Β· one Navigator request β†’ 5 autonomous sub-hires, incl. human-in-the-loop.

Topic: "Well-sourced research brief on zero-knowledge proofs in DAOs." Grade climbed 69 β†’ 76 via a self-correction loop, then escalated to a human who approved. Each row is [pay tx] Β· [deliver tx] on Base Mainnet.

# Date Role Counterparty USDC Order ID Tx (BaseScan) Result
1 2026-07-07 Provider (paid) Navigator 1.00 98d0adae pay Β· deliver PDF brief delivered (human-approved)
2 2026-07-07 Requester (hired) Worker 0.10 82878d87 pay Β· deliver research draft
3 2026-07-07 Requester (hired) Litmus πŸ§ͺ 0.05 9da4458a pay Β· deliver score 69/100
4 2026-07-07 Requester (hired) Worker (fallback) 0.10 9087342c pay Β· deliver self-correction re-research
5 2026-07-07 Requester (hired) Litmus πŸ§ͺ 0.05 3f72221e pay Β· deliver score 76/100
6 2026-07-07 Requester (hired) Summon πŸ‘€ 0.05 9dc01628 pay Β· deliver βœ… human approved (Telegram)

πŸ—οΈ Architecture & Tech Stack

Layer Technology
Runtime Node.js (TypeScript)
Ecosystem Constellation A2A (croo-core)
Testing Vitest

🧩 CROO SDK Methods Used

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

Method Source Role in Maestro
makeClient(sdkKey) croo-core Instantiates the shared CROO AgentClient (Base Mainnet config) from the SDK key.
runProvider(...) croo-core Runs Maestro as an on-chain provider β€” subscribes to order/negotiation events and fulfils incoming hires.
hire(...) croo-core Acts as a consumer β€” Maestro orchestrates by placing orders against other Constellation agents (A2A).
isMockMode() croo-core Branches between offline mock mode and live on-chain execution.
client.uploadFile(...) @croo-network/sdk Uploads the composed deliverable artifact.
client.rejectOrder(...) @croo-network/sdk Declines an incoming order that fails policy checks.
client.getNegotiation(id) @croo-network/sdk Reads negotiation/order state while orchestrating.

πŸ“ž Hire Maestro (A2A)

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

import { makeClient, hire } from '@edycutjong/croo-core';

const client = makeClient(process.env.CROO_SDK_KEY!);

const { delivery } = await hire(client, {
  serviceId: '625f15c8-61ba-4b11-8201-0bb019ef5ef2', // Maestro on the CROO Agent Store
  requirement: {
    topic: 'Write a vetted brief on Base L2 fee mechanics',
    qualityThreshold: 90,   // optional β€” re-research until Litmus grade β‰₯ 90
  },
  maxPrice: 5.0, // Maestro sub-hires Worker/Litmus/Summon, so budget higher
});

delivery β†’ { results, audit, totalSpent } (audit trail of every sub-order it placed)

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20
  • npm

Installation

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

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

npm install
npm run demo            # full Research β†’ Grade β†’ Human β†’ Deliver pipeline, end-to-end
# …or boot the live provider loop in mock mode:
CROO_MOCK=true npm run dev

npm run demo exercises the real work() path against deterministic mock sub-agents β€” no funding required, perfect for reproducing the orchestration locally.

πŸ§ͺ Testing & CI

4-stage pipeline: Quality β†’ Security β†’ Build β†’ Deploy Gate

# ── Code Quality ────────────────────────────
make lint          # ESLint
make typecheck     # TypeScript check
make test          # Run tests
make test-coverage # Coverage report
make ci            # Full quality gate

# ── Security ────────────────────────────────
make security-scan # npm audit + license check
Layer Tool Status
Code Quality ESLint + TypeScript βœ…
Unit Testing Vitest (64 tests) βœ…
Security (SAST) CodeQL βœ…
Security (SCA) Dependabot + npm audit βœ…
Secret Scanning TruffleHog βœ…

πŸ“ Project Structure

maestro/
β”œβ”€β”€ docs/              # README assets (hero, screenshots)
β”œβ”€β”€ src/               # Application source code
β”œβ”€β”€ scripts/           # Build and run scripts
β”œβ”€β”€ __tests__/         # Vitest test suites
β”œβ”€β”€ .github/           # CI workflows
└── README.md          # You are here

🚒 Deploy

Containerized for any PaaS (Railway, Render, Fly.io, Cloud Run). Maestro is a background worker (connects out to the CROO WebSocket β€” no inbound port):

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

πŸ“„ License

MIT Β© 2026 Edy Cu

πŸ™ Acknowledgments

Built for the DoraHacks CROO Hackathon 2026.

About

🎼 Callable orchestrator β€” hires specialist agents on-chain, grades their work, and delivers one vetted result (CROO Constellation)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors