Skip to content

edycutjong/summon

Repository files navigation

Summon Logo

Summon πŸ‘€

Human-in-the-loop sign-off agent β€” any agent hires Summon to get a human Approve/Reject via Telegram

Summon

Built for CROO Hackathon


TypeScript Node.js CI


πŸ“Έ See it in Action

Summon Demo

The Human-in-the-Loop Workflow. Agent triggers Summon β†’ Summon sends Telegram message β†’ Human taps Approve/Reject β†’ Summon returns decision to agent.


πŸ’‘ The Problem & Solution

Fully autonomous agents can make costly mistakes. Before executing a high-stakes transaction, agents need a reliable way to halt and ask for human permission. Summon solves this by providing a universal Human-in-the-loop agent that bridges on-chain AI with real-time human communication via Telegram.

Key Features:

  • ⚑ Instant Notification: Pushes agent requests directly to your Telegram.
  • πŸ”’ Secure Sign-off: Only authorized Telegram users can approve or reject.
  • 🎨 Seamless Integration: Any agent in the Constellation A2A ecosystem can hire Summon to act as its human arbiter.
  • πŸ”„ Active State Recovery: Retains and re-evaluates active Telegram sign-off requests on startup to prevent lost approvals.
  • πŸ’Ό Dynamic Payout Wallet: Dynamically routes earned USDC fees directly to custom wallet destinations (via SUMMON_PAYOUT_ADDRESS).

🌌 The Constellation β€” On-Chain A2A Graph

Summon is the constellation's human arbiter: any agent can hire it on-chain to put a real person in the loop, escrow-backed with an SLA auto-refund if no one responds in time. "An agent pays a human for a yes/no decision, with on-chain escrow" simply doesn't exist on a normal API marketplace.

graph LR
    User([Any Agent / User]) -->|hires for sign-off| S[Summon πŸ‘€]
    S -->|Approve / Reject| H((Human via Telegram))
    M[Maestro 🎼] -->|escalates low-confidence work| S
    G[Gauntlet 🧀] -.->|certifies| S
    classDef hot fill:#F59E0B,stroke:#111,color:#111,font-weight:bold;
    class S hot;
Loading
  • SLA safety: if the human doesn't tap in time, Summon cancels the request and the buyer's escrow is cleanly refunded β€” no stuck funds.
  • Adoption wedge: the Demo Insurance snippet lets any hackathon bot add a human fallback in a few lines.

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

Real CAP orders Summon fulfilled as a provider β€” an agent paid for a human decision.

Total real CAP orders: 0 Β· last updated: 2026-06-_

# Date Counterparty (requester) Amount (USDC) Order ID Tx (BaseScan) Decision
1 2026-06-_ Maestro / external bot 0.00 _ord_…_ 0x… βœ… Approved / ❌ Rejected

Order IDs + the buyer's pay tx are in the provider logs and the CROO dashboard. Delete this note once populated.

πŸ—οΈ Architecture & Tech Stack

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

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 20
  • npm
  • A Telegram Bot Token (from @BotFather)

Installation

  1. Clone: git clone https://github.com/edycutjong/summon.git
  2. Install: npm install
  3. Configure: cp .env.example .env.local and fill in CROO_SDK_KEY, SUMMON_SERVICE_ID, TELEGRAM_BOT_TOKEN, and TELEGRAM_CHAT_ID (or set CROO_MOCK=true for offline mode)
  4. Run: npm run dev

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

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

For the full human round-trip, set TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID and run npm run dev β€” taps on the Telegram inline buttons resolve the order.

For Judges: Skip account creation! You can test the bot interaction by messaging our live test bot at @SummonTestBot.

πŸ§ͺ Testing & CI

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

# ── Code Quality ────────────────────────────
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

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

πŸ“ Project Structure

dorahacks-croo-summon/
β”œβ”€β”€ docs/              # README assets (screenshots)
β”œβ”€β”€ src/               # Application source code
β”œβ”€β”€ scripts/           # Build and run scripts
β”œβ”€β”€ __tests__/         # Vitest test suites
β”œβ”€β”€ .env.example       # Environment template
β”œβ”€β”€ .github/           # CI workflows
└── README.md          # You are here

🚒 Deploy

Containerized for any PaaS. Summon is a background worker (Telegram polling + CROO WebSocket β€” no inbound port):

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

πŸ“„ License

MIT Β© 2026 Edy Cu

πŸ™ Acknowledgments

Built for the DoraHacks CROO Hackathon 2026.

πŸ›‘οΈ Hackathon "Demo Insurance" (Copy-Paste Integration)

Terrified your autonomous DeFi or Research bot might hallucinate or crash during the live judge demo?

Add this 5-line Summon snippet to your error-catching block. If your bot hits a wall, it autonomously hires my agent for $0.01 USDC. I will get pinged on Telegram, manually review the data, and tap 'Approve/Override'.

Your agent recovers gracefully, you get a bulletproof demo showing A2A resilience, and we both satisfy the Hackathon's Anti-Sybil counterparty rule.

import { hire } from "@edycutjong/croo-core";

// Drop this in your catch block or low-confidence branch.
// hire() runs the full requester flow: negotiate β†’ pay β†’ wait for delivery.
const { delivery } = await hire<{ approved: boolean }>(client, {
  serviceId: process.env.SUMMON_SERVICE_ID!, // DM me in Discord for my ID!
  requirement: {
    prompt: "Demo emergency: Bot confidence low. Proceed with execution?",
    context: JSON.stringify(failedPayload),
  },
  maxPrice: 1.0, // max USDC you're willing to spend
});

if (delivery.approved) {
  // Proceed safely based on the human verdict!
}

About

πŸ‘€ Human-in-the-loop sign-off agent β€” any agent hires Summon to get a human Approve/Reject via Telegram

Topics

Resources

License

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors