withX402() wraps the Web handler so unpaid calls get a standard HTTP 402
challenge (x402Version + accepts[]) and paid calls fall through to the agent.
Payment verification is injectable (host wires CoinPay/x402); CORS preflight
passes through untouched; custom challenge responses supported. README documents
the optional c0mpute.com GPU backend.
4 new tests; 38/38 pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@logicsrc/agentswarm: a self-hosted, framework-agnostic multi-agent runtime
that each app mounts on its own route (e.g. tronbrowser.dev/swarm).
M1 — core:
- createSwarmHandler(): Web (Request)=>Response handler, CORS + validation
- SwarmRunner: injectable engine interface
- createDeepAgentRunner(): deepagents (createDeepAgent) adapter; deepagents +
@langchain/langgraph are optional peers loaded via dynamic import so the core
builds/tests with zero heavy deps
- SwarmError + onRequest gate: seam for x402 metering / auth (402/403)
M3 — rubric self-check (deepagents RubricMiddleware is Python-only, so ported
at the runner layer):
- createRubricRunner(): grades output via an injectable judge and revises until
it passes or maxIterations; passes through untouched when no rubric
- createLLMJudge(): cheap-model grader (lazy langchain initChatModel)
13/13 vitest pass; tsc clean; examples/server.mjs demo verified.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>