Skip to content

ToDealMarket/tdm-cloudflare-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TDM Cloudflare Agents

TDM Cloudflare Agents

Cloudflare Agents example for TDM paid execution

Example Repo GitHub stars Cloudflare TypeScript

Turn one Cloudflare Agent action into a paid surface while keeping the Worker and Agent model intact.

DocumentationSDK RepoGitHubX/Twitter

████████╗ ██████╗  ███╗   ███╗
╚══██╔══╝ ██╔══██╗ ████╗ ████║
   ██║    ██║  ██║ ██╔████╔██║
   ██║    ██║  ██║ ██║╚██╔╝██║
   ██║    ██████╔╝ ██║ ╚═╝ ██║
   ╚═╝    ╚═════╝  ╚═╝     ╚═╝

TDM CLOUDFLARE AGENTS [EXAMPLE REPO]
Payable Agent Action + Worker Routing
Mode: example repo | Docs: todealmarket.com/docs

What Is This Repo?

tdm-cloudflare-agents is an example-first repo showing how one Cloudflare Agent method becomes payable through TDM without replacing the normal Agents programming model.

TDM turns one agent action into a paid surface, then lets the runtime continue through authorization and recovery-aware flow control.

What It Demonstrates

  • Agent class with one @callable() method
  • TDM authorization before the premium action runs
  • routeAgentRequest(...) wired into the Worker fetch handler
  • Durable Object binding and SQLite migration in Wrangler

Runtime Note

Cloudflare Agents currently recommend target: "ES2021" in tsconfig.json when using @callable(). Do not enable experimentalDecorators.

Route Shape

By default, the agent is reachable under:

/agents/tdm-agent/{instance-name}

Example Client Call

const result = await agent.stub.runPaidAction({
  tokenOrUuid: "demo-user",
  operation: "demo:paid-agent",
  priceUsd: "0.05",
  prompt: "summarize this",
});

Environment

  • TDM_GATEWAY_URL
  • TDM_API_KEY optional

Repo Boundary

This repo is best treated as a public example, not as a separate package.

Releases

No releases published

Packages

 
 
 

Contributors