Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 42 additions & 52 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: Deploy

on:
push:
Expand All @@ -15,57 +15,75 @@ concurrency:
cancel-in-progress: true

jobs:
ci:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"

- name: Install dependencies
run: pnpm install
- run: pnpm install --frozen-lockfile

- name: Check code
run: pnpm check

- name: Check types
run: pnpm check:types

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"

- run: pnpm install --frozen-lockfile

- name: Tests
run: pnpm test

build-and-deploy:
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"

- run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build
env:
SPEC_PAT: ${{ secrets.SPEC_PAT }}

- name: Smoke test (wrangler dev)
run: |
# ──────────────────────────────────────────────────────────
# To reproduce locally:
# pnpm build
# pnpm wrangler:dev &
# curl -s -o /dev/null -w '%{http_code}' http://localhost:8788/quickstart/tempoctl -H 'Accept: text/html'
# curl -s -o /dev/null -w '%{http_code}' http://localhost:8788/ -H 'Accept: text/html'
# curl -s -o /dev/null -w '%{http_code}' http://localhost:8788/ -H 'Accept: text/markdown'
# All three should return 200. If any return 500, check wrangler
# logs for the error — usually a missing module or unsupported
# Node.js API. Fix in scripts/patch-cf.ts.
# ──────────────────────────────────────────────────────────

WRANGLER_LOG=$(mktemp)
npx wrangler dev --port 8788 > "$WRANGLER_LOG" 2>&1 &
pnpm exec wrangler dev --port 8788 > "$WRANGLER_LOG" 2>&1 &
WRANGLER_PID=$!

# Wait for wrangler to be ready (up to 30s)
for i in $(seq 1 30); do
if curl -sf http://localhost:8788/ -o /dev/null 2>/dev/null; then
break
Expand Down Expand Up @@ -115,34 +133,6 @@ jobs:
- name: Prune server bundle
run: node --experimental-strip-types scripts/prune-server.ts

- name: Upload build
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

deploy:
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Download build
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Sanitize branch name
if: github.event_name == 'pull_request'
id: branch
Expand All @@ -166,15 +156,15 @@ jobs:
script: |
const alias = "${{ steps.branch.outputs.alias }}"
const url = `https://${alias}-mpp-docs.porto.workers.dev`
const body = `MPP Docs preview: ${url}`
const body = `docs preview: ${url}`
const { data: comments } = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
})
let existing = null
for (const comment of comments) {
if (comment.body && comment.body.startsWith('MPP Docs preview:')) {
if (comment.body && comment.body.startsWith('docs preview:')) {
existing = comment
break
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/quickstart/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Pick a starting point based on your role:
/>
<Card
icon="lucide:terminal"
title="tempoctl CLI"
title="presto CLI"
description="wget for payments"
to="/quickstart/tempoctl"
to="/quickstart/presto"
/>
</Cards>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Card, Cards } from 'vocs'

# tempoctl [Make paid HTTP requests from the command line]
# presto [Make paid HTTP requests from the command line]

`tempoctl` is a command-line tool for making HTTP requests with automatic payment support. It handles `402 Payment Required` responses with built-in payment methods and spending controls. Works from scripts, cron jobs, and AI agents.
`presto` is a command-line tool for making HTTP requests with automatic payment support. It handles `402 Payment Required` responses with built-in payment methods and spending controls. Works from scripts, cron jobs, and AI agents.

## Quickstart

Expand All @@ -19,31 +19,31 @@ $ curl -fsSL https://tempo.xyz/ctl/install.sh | bash
Run the login wizard to set up your wallet:

```bash [login.sh]
$ tempoctl login
$ presto login
```

This creates a new encrypted keystore and saves your configuration to `~/.tempoctl/config.toml`.
This creates a new encrypted keystore and saves your configuration to `~/.presto/config.toml`.

:::tip[Quick setup for testing]
For quick testing without a keystore, set your private key directly:

```bash [set-key.sh]
$ export TEMPOCTL_PRIVATE_KEY="0x..."
$ export PRESTO_PRIVATE_KEY="0x..."
```

:::

### Make your first paid request

```bash [paid-request.sh]
$ tempoctl query -vv https://mpp.tempo.xyz/api/ping/paid
$ presto query -vv https://mpp.tempo.xyz/api/ping/paid
```

:::tip[Live demo server]
We host a live demo server at `mpp.tempo.xyz` running on **Tempo testnet**. Use `/api/ping` for free requests and `/api/ping/paid` for paid requests. Get testnet funds at [faucet.tempo.xyz](https://faucet.tempo.xyz).
:::

`tempoctl` automatically:
`presto` automatically:

1. Makes the initial request
2. Detects the `402` Payment Required response
Expand All @@ -61,13 +61,13 @@ We host a live demo server at `mpp.tempo.xyz` running on **Tempo testnet**. Use
Use dry-run mode to see what would happen without actually paying:

```bash [dry-run.sh]
$ tempoctl query -D https://mpp.tempo.xyz/api/ping/paid
$ presto query -D https://mpp.tempo.xyz/api/ping/paid
```

Or inspect the payment requirements before paying:

```bash [inspect.sh]
$ tempoctl inspect https://mpp.tempo.xyz/api/ping/paid
$ presto inspect https://mpp.tempo.xyz/api/ping/paid
```

### Set spending limits
Expand All @@ -76,7 +76,7 @@ Protect yourself with a maximum payment amount:

```bash [max-payment.sh]
# Reject payments over 1 USD
$ tempoctl query -M 1000000 https://mpp.tempo.xyz/api/ping/paid
$ presto query -M 1000000 https://mpp.tempo.xyz/api/ping/paid
```

### Common flags
Expand All @@ -95,64 +95,64 @@ $ tempoctl query -M 1000000 https://mpp.tempo.xyz/api/ping/paid

## Built-in skills

tempoctl ships with built-in support for common AI agents. When used as a skill by AI assistants like Claude, tempoctl enables agents to interact with paid APIs autonomously.
presto ships with built-in support for common AI agents. When used as a skill by AI assistants like Claude, presto enables agents to interact with paid APIs autonomously.

### How it works

AI agents can use `tempoctl` to:
AI agents can use `presto` to:

- **Access paid APIs**—Make requests to services that charge per-call
- **Query premium data**—Fetch information from paid data providers
- **Use commercial tools**—Interact with paid developer services

The agent calls tempoctl like any other commandline tool when it detects a `402` Payment Required response. Payment is handled transparently.
The agent calls presto like any other commandline tool when it detects a `402` Payment Required response. Payment is handled transparently.

### Example: Agent making a paid request

When an AI agent needs to access a paid resource, it runs:

```bash [agent-request.sh]
$ tempoctl query https://api.example.com/premium-data
$ presto query https://api.example.com/premium-data
```

The agent receives the response data directly—no manual payment handling required.

## Safety controls

tempoctl includes safeguards for autonomous agent use:
presto includes safeguards for autonomous agent use:

### Spending limits

Set a maximum amount the agent can spend per request:

```bash [spending-limit.sh]
# Limit to 0.50 USDC per request
$ tempoctl query -M 500000 https://api.example.com/data
$ presto query -M 500000 https://api.example.com/data
```

### Dry run mode

Agents can preview costs before committing:

```bash [preview-cost.sh]
$ tempoctl query -D https://api.example.com/expensive-endpoint
$ presto query -D https://api.example.com/expensive-endpoint
```

### Network filtering

Restrict payments to specific networks:

```bash
tempoctl query -n tempo-moderato https://api.example.com/data
presto query -n tempo-moderato https://api.example.com/data
```

### Skill configuration

For AI agent frameworks that support skills, tempoctl can be configured as a tool:
For AI agent frameworks that support skills, presto can be configured as a tool:

```json
{
"name": "tempoctl",
"name": "presto",
"description": "Make HTTP requests with automatic payment support",
"parameters": {
"url": {
Expand All @@ -173,14 +173,14 @@ For AI agent frameworks that support skills, tempoctl can be configured as a too

```bash [query-api.sh]
# Query a paid data API
$ tempoctl query https://api.data-provider.com/market-data?symbol=BTC
$ presto query https://api.data-provider.com/market-data?symbol=BTC
```

### Paid compute

```bash [inference.sh]
# Run inference on a paid model
$ tempoctl query -X POST \
$ presto query -X POST \
--json '{"prompt": "Explain quantum computing"}' \
https://api.ai-provider.com/generate
```
Expand All @@ -189,7 +189,7 @@ $ tempoctl query -X POST \

```bash [analyze-repo.sh]
# Use a paid developer tool
$ tempoctl query https://api.dev-tools.com/analyze?repo=myorg/myrepo
$ presto query https://api.dev-tools.com/analyze?repo=myorg/myrepo
```

## Next steps
Expand All @@ -199,12 +199,12 @@ $ tempoctl query https://api.dev-tools.com/analyze?repo=myorg/myrepo
icon="lucide:code"
title="Examples"
description="More usage patterns and real endpoints"
to="/tools/tempoctl/examples"
to="/tools/presto/examples"
/>
<Card
icon="lucide:book-open"
title="Reference"
description="Full command reference and configuration"
to="/tools/tempoctl"
to="/tools/presto"
/>
</Cards>
14 changes: 7 additions & 7 deletions src/pages/quickstart/server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,26 +193,26 @@ export async function handler(req: IncomingMessage, res: ServerResponse) {
```


## Testing with tempoctl
## Testing with presto

After your server is running, test it with [tempoctl](/tools/tempoctl):
After your server is running, test it with [presto](/tools/presto):

```bash [test-server.sh]
# See the payment challenge
$ tempoctl inspect <your-server>/resource
$ presto inspect <your-server>/resource

# Make a paid request (requires funded wallet)
$ tempoctl query <your-server>/resource
$ presto query <your-server>/resource

# Verbose output to see the full 402 flow
$ tempoctl query -vi <your-server>/resource
$ presto query -vi <your-server>/resource

# Dry run to preview payment without executing
$ tempoctl query -D <your-server>/resource
$ presto query -D <your-server>/resource
```

:::tip
Use `tempoctl inspect` to debug your server's challenge response without making any payments.
Use `presto inspect` to debug your server's challenge response without making any payments.
:::

## Next steps
Expand Down
4 changes: 2 additions & 2 deletions src/pages/sdk/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Card, Cards } from 'vocs'
<Card
description="A command-line tool for making paid HTTP requests"
icon="lucide:terminal"
title="tempoctl CLI"
to="/tools/tempoctl"
title="presto CLI"
to="/tools/presto"
/>
</Cards>
Loading
Loading