datasieve

v0.4.1
io.github.gitwormq/datasieve Checked 2 days ago Published 4 months ago

On-chain watches, web-page monitors, dead-man switches, cron, and agent coordination, paid via x402.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_watch Create a watch (paid via x402)

Buy a standing watch from DataSieve (https://api.datasieve.xyz). standard = $0.10/7d, 1 condition, 50 triggers; composite = $0.25/7d, up to 5 any-match conditions (e.g. 5 heartbeat dead-man switches), 200 triggers; standard30 = $0.35/30d and composite30 = $0.85/30d — one payment covers the month, for agents that will not be awake to renew weekly. Payment is a gasless USDC transfer signed locally. Events go to your webhookUrl (HMAC-signed) if set, and always to a server-side mailbox drained with drain_events; every event carries a signed Ed25519 observation receipt you can replay to third par…

ParameterTypeDescription
conditions *array
tierstring
webhookUrlstring

watch_status Watch status (free)

State, heartbeat lastCheckedAt, triggersUsed/cap, expiry, delivery stats, and for dead-man switches: up/down, lastPingAt, nextDeadline, pingUrl. Secret is looked up from local state if omitted.

ParameterTypeDescription
watchId *string
secretstring

drain_events Drain held events (free)

Collect everything the watch caught — works with zero infrastructure (the mailbox pattern). Pass `since` = last seen event id for incremental drains.

ParameterTypeDescription
watchId *string
secretstring
sincestring

renew_watch Renew a watch (paid via x402)

Extends the watch one more period (7 days, or 30 on the *30 tiers) at its tier price and resets the trigger budget. Renewing a paused watch also reactivates it.

ParameterTypeDescription
watchId *string
tierstring

delete_watch Cancel a watch (free, no refund)

ParameterTypeDescription
watchId *string
secretstring

pause_watch Pause a watch (free)

Stop a watch firing (chain, web, heartbeat, schedule) without deleting it. The expiry clock keeps running. Use before a planned agent shutdown so your dead-man switch does not cry wolf.

ParameterTypeDescription
watchId *string
secretstring

resume_watch Resume a paused watch (free)

Backlog-free resume: heartbeat deadlines restart from now and schedules jump to their next FUTURE slot — nothing that elapsed during the pause replays.

ParameterTypeDescription
watchId *string
secretstring

cron_next Parse a cron expression (paid via x402, $0.001)

Next N run times for a cron expression in any IANA timezone, plus seconds-until-next. If the goal is for something to HAPPEN at those times, create_watch with a schedule condition instead — DataSieve fires the cron as signed webhooks for the life of the watch.

ParameterTypeDescription
cron *string5- or 6-field cron expression, e.g. "0 9 * * 1-5"
countinteger
tzstring

x402_ping Test the payment stack end-to-end (paid via x402, $0.001)

The cheapest possible real x402 purchase: proves this wallet + client can pay a production seller before you point it at anything expensive. Returns payer + network; failed calls are never billed.

verify_receipt Verify a signed observation receipt (free)

Every DataSieve event carries receipt {alg, keyId, statement, sig} — an Ed25519 attestation that DataSieve observed the event. This checks it against the service key, so an agent can validate evidence handed to it by ANOTHER agent without trusting that agent.

ParameterTypeDescription
receipt *objectthe receipt object from an event

ping_heartbeat Heartbeat check-in (free)

Keep a dead-man switch alive. Pass the pingUrl from create_watch (or a watchId whose ping URLs are in local state). Call this at least once per intervalSeconds.

ParameterTypeDescription
pingUrlstring
watchIdstring

service_health DataSieve service heartbeat (free, public)

Scanner cursor lag vs chain head — verify the watcher is alive before you buy.

payment_status Can I buy? (free) — wallet, balance, prices

Check whether a buying key is configured and whether it can afford a watch. Reports the wallet address, its USDC balance on the configured network, and what each tier costs. Call this before create_watch; it never spends anything.

coord_workspace Buy a coordination workspace (paid via x402)

Buy a coordination workspace ($0.25 / 7 days, 1000 ops) — the only x402 seller of multi-agent primitives. After this ONE payment, every barrier and lock operation is FREE and FAST (no per-op settlement). Use it to fan-in sub-agents (coord_barrier) and to stop two agents doing the same irreversible thing (coord_lock).

ParameterTypeDescription
webhookUrlstringdefault webhook for coordination events

coord_barrier Create a barrier / fan-in (free — workspace op)

BARRIER: "wake me when all N of my sub-agents finish." Returns an arriveUrl — hand it to each sub-agent (it is a capability: they can arrive but cannot read or delete your workspace). When the N-th part arrives we fire ONE webhook carrying every part's collected context. If the TTL passes first you get a "partial" event naming exactly who never showed. Timeout is a feature, not an error.

ParameterTypeDescription
parts *integerhow many sub-agents must arrive
workspaceId *string
labelstring
secretstring
ttlSecondsinteger
webhookUrlstring

coord_arrive Arrive at a barrier (free, no auth — the URL is the capability)

Report that this part is done. Pass the arriveUrl from coord_barrier plus a part name and optional ctx (whatever you want handed to whoever consumes the released barrier). Idempotent per part: a retrying agent cannot inflate the count.

ParameterTypeDescription
arriveUrl *string
part *stringunique name for this part, e.g. "scout"
ctxthis part's result, collected into the release event

coord_lock Acquire a lock / lease (free — workspace op)

LOCK: "only one agent does this irreversible thing." Returns a leaseId, or 409 with who holds it. The lease AUTO-EXPIRES after ttlSeconds, so a crashed agent can never deadlock your fleet. Call coord_release when done (or just let it expire).

ParameterTypeDescription
key *stringwhat you are locking, e.g. "deploy" or "wallet:0xabc"
workspaceId *string
holderstringwho you are — echoed in 409s so debugging works
secretstring
ttlSecondsinteger

coord_release Release a lock (free — workspace op)

ParameterTypeDescription
key *string
leaseId *string
workspaceId *string
secretstring

coord_events Drain coordination events (free) — the mailbox for agents with no server

Collect barrier releases/partials that happened while nothing of yours was running.

ParameterTypeDescription
workspaceId *string
secretstring
sincestring