@botsrated/ai-sdk 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -6
- package/dist/index.d.ts +23 -1623
- package/dist/index.js +10 -3
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ export function botsratedPreflight(client = new BotsRatedClient()) {
|
|
|
40
40
|
},
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
/** Paid ($0.001; first 100/day free) BotsRated check. Needs a client created with `paid: { budgetUsd,
|
|
43
|
+
/** Paid ($0.001; first 100/day free) BotsRated check. Needs a client created with `paid: { budgetUsd, x402Client }`. */
|
|
44
44
|
export function botsratedCheck(client) {
|
|
45
45
|
return tool({
|
|
46
46
|
description: "Paid: $0.001 USDC on Base (first 100 per day free, nothing charged), within a budget the user set. Full BotsRated facts for one x402 seller host (probe counts, valid-402 rate, latency, price/payTo vs listing, paid test-buys with tx links). Use botsratedPreflight (free) first.",
|
|
@@ -56,7 +56,14 @@ export function botsratedCheck(client) {
|
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* `{ botsratedPreflight }`, plus `botsratedCheck` when the client has a budget.
|
|
61
|
+
* Typed as the AI SDK's `ToolSet` so it can be passed straight to `tools:` (or spread into one) under
|
|
62
|
+
* strict TypeScript on AI SDK 5, 6 and 7.
|
|
63
|
+
*/
|
|
60
64
|
export function botsratedTools(client = new BotsRatedClient()) {
|
|
61
|
-
|
|
65
|
+
const tools = { botsratedPreflight: botsratedPreflight(client) };
|
|
66
|
+
if (client.paidEnabled)
|
|
67
|
+
tools.botsratedCheck = botsratedCheck(client);
|
|
68
|
+
return tools;
|
|
62
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botsrated/ai-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "AI SDK tools for BotsRated: free pre-payment preflight of x402 sellers, opt-in budgeted paid check.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "tsc -p tsconfig.json",
|
|
22
|
-
"test": "vitest run"
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.typecheck.json"
|
|
23
24
|
},
|
|
24
25
|
"homepage": "https://botsrated.com",
|
|
25
26
|
"repository": {
|
|
@@ -28,18 +29,18 @@
|
|
|
28
29
|
"directory": "integrations/vercel-ai-sdk"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@botsrated/x402-preflight": "^0.1.
|
|
32
|
+
"@botsrated/x402-preflight": "^0.1.2"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"ai": ">=5",
|
|
35
36
|
"zod": "^3.25.76 || ^4.1.8"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
39
|
+
"@types/node": "^22.0.0",
|
|
38
40
|
"ai": "^7.0.0",
|
|
39
|
-
"zod": "^4.1.8",
|
|
40
41
|
"typescript": "^5.6.0",
|
|
41
42
|
"vitest": "^3.2.0",
|
|
42
|
-
"
|
|
43
|
+
"zod": "^4.1.8"
|
|
43
44
|
},
|
|
44
45
|
"bugs": {
|
|
45
46
|
"url": "https://github.com/botsrated/botsrated/issues"
|