Skip to content

Commit e4e3af5

Browse files
authored
Merge pull request #755 from Merit-Systems/br/bump-discovery-1.5.0
Bump @agentcash/discovery to 1.5.0, adopt structured x-payment-info
2 parents 2eda0c3 + 4993f41 commit e4e3af5

6 files changed

Lines changed: 23 additions & 25 deletions

File tree

apps/scan/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"format:check": "pnpm -w format:check:dir ./apps/scan"
2222
},
2323
"dependencies": {
24-
"@agentcash/discovery": "1.4.5",
24+
"@agentcash/discovery": "1.5.0",
2525
"@agentcash/router": "1.2.5",
2626
"@ai-sdk/openai": "^2.0.52",
2727
"@ai-sdk/react": "^2.0.68",

apps/scan/src/app/(app)/(home)/integration-spec/discovery-strategy-panel.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const strategies: Strategy[] = [
3131
requirements: [
3232
'Top-level fields: openapi, info.title, info.x-guidance, info.version, paths.',
3333
'For paid operations: responses.402 and x-payment-info.',
34-
'Set x-payment-info.protocols and one pricing mode (fixed, range, quote).',
34+
'Set x-payment-info.protocols and one pricing mode (fixed or dynamic).',
3535
'Use OpenAPI security + components.securitySchemes for auth declaration.',
3636
'Add high-level guidance in info.x-guidance for user-friendly discovery.',
3737
],
@@ -44,8 +44,7 @@ const strategies: Strategy[] = [
4444
"responses": { "402": { "description": "Payment Required" } },
4545
"x-payment-info": {
4646
"protocols": ["x402"],
47-
"pricingMode": "fixed",
48-
"price": "0.05"
47+
"price": { "mode": "fixed", "currency": "USD", "amount": "0.05" }
4948
}
5049
}
5150
}

apps/scan/src/app/(app)/(home)/integration-spec/page.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ Schema guidance (important):
4141
OpenAPI payable operation must include ALL:
4242
- x-payment-info with:
4343
- protocols: ["x402"]
44-
- pricingMode + fields:
45-
- fixed: { pricingMode: "fixed", price: "<amount>" }
46-
- range: { pricingMode: "range", minPrice: "<min>", maxPrice: "<max>" }
47-
- quote: { pricingMode: "quote" }
48-
- IMPORTANT: for fixed pricing use "price" (not "amount")
44+
- price (structured object):
45+
- fixed: { mode: "fixed", currency: "USD", amount: "<amount>" }
46+
- dynamic: { mode: "dynamic", currency: "USD", min: "<min>", max: "<max>" }
4947
- responses: { "402": { description: "Payment Required" } }
5048
5149
/.well-known/x402 must be exactly:
@@ -57,7 +55,7 @@ OpenAPI payable operation must include ALL:
5755
5856
Rules:
5957
- Runtime 402 behavior is authoritative over static metadata.
60-
- "amount" is for runtime accepts; "price" is for x-payment-info fixed pricing.
58+
- "amount" is for both runtime accepts and x-payment-info fixed pricing.
6159
6260
Workflow:
6361
0) Install the agentcash MCP server:

docs/DISCOVERY.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ For each paid operation:
3838
- declare `x-payment-info`
3939
- include a `402` response in `responses`
4040
- include `x-payment-info.protocols` (for example `"x402"`)
41-
- include valid pricing metadata:
42-
- `pricingMode: "fixed"` + `price`
43-
- or `pricingMode: "range"` + `minPrice` + `maxPrice`
44-
- or `pricingMode: "quote"`
41+
- include valid pricing metadata via `x-payment-info.price`:
42+
- fixed: `{ mode: "fixed", currency: "USD", amount: "0.05" }`
43+
- dynamic: `{ mode: "dynamic", currency: "USD", min: "0.01", max: "1.00" }`
4544

4645
### Auth requirements
4746

evals/prompts/copy-for-agents-v3.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ Schema guidance (important):
1414
OpenAPI payable operation must include ALL:
1515
- x-payment-info with:
1616
- protocols: ["x402"]
17-
- pricingMode + fields:
18-
- fixed: { pricingMode: "fixed", price: "<amount>" }
19-
- range: { pricingMode: "range", minPrice: "<min>", maxPrice: "<max>" }
20-
- quote: { pricingMode: "quote" }
21-
- IMPORTANT: for fixed pricing use "price" (not "amount")
17+
- price (structured object, canonical format):
18+
- fixed: { mode: "fixed", currency: "USD", amount: "<amount>" }
19+
- dynamic: { mode: "dynamic", currency: "USD", min: "<min>", max: "<max>" }
2220
- responses: { "402": { description: "Payment Required" } }
2321

2422
/.well-known/x402 must be exactly:
@@ -30,7 +28,7 @@ OpenAPI payable operation must include ALL:
3028

3129
Rules:
3230
- Runtime 402 behavior is authoritative over static metadata.
33-
- "amount" is for runtime accepts; "price" is for x-payment-info fixed pricing.
31+
- "amount" is for both runtime accepts and x-payment-info fixed pricing.
3432

3533
Workflow:
3634
1) Audit discovery and probe failures.

pnpm-lock.yaml

Lines changed: 9 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)