@priors/agentkit 0.2.0 → 0.2.1

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 CHANGED
@@ -38,17 +38,19 @@ Then hand `agentKit` to your framework as usual (`getVercelAITools(agentKit)`, `
38
38
  **Inference on credit (0.2.0).** Give the provider `autoBorrow`, set by you in code, never by the model:
39
39
 
40
40
  ```ts
41
- priorsActionProvider(undefined, { autoBorrow: { perCall: "5", perDay: "10", hosts: ["agent402.tools"] } })
41
+ priorsActionProvider(undefined, { autoBorrow: { perCall: "5", perDay: "10", hosts: ["models.example"] } })
42
42
  ```
43
43
 
44
44
  With it, `pay_x402_with_priors_credit` borrows the gap on its own when the wallet is short, for the listed hosts only.
45
+ There is no default host: `hosts` names each one, exactly (here `models.example` stands for the model API you choose).
45
46
  The limits are `perCall` USDG a call and `perDay` USDG a UTC day in the process, for 14 days (or the pool's maximum
46
47
  term). It borrows only while this wallet's Autopay (AutoRepay v2) covers the new loan: the wallet is the agent's
47
48
  declared wallet, the plan is on under the agent's current owner, not held or paused, its limit per loan and its USDG
48
49
  approval cover the loan's due. Otherwise nothing is borrowed or paid, and the answer says to turn Autopay on. Autopay
49
- then repays the loan in its window. The model's `maxBorrow` can only lower the amount. A chat completion is one call:
50
- `url` `https://agent402.tools/v1/chat/completions`, `body` the OpenAI-style request as JSON (sent with POST),
51
- `maxPrice` `"0.02"`.
50
+ then repays the loan in its window. The model's `maxBorrow` can only lower the amount. A chat completion is one call
51
+ to an OpenAI-compatible model API you choose that charges over x402 in USDG on Robinhood Chain: `url` its chat
52
+ completions URL (for example `https://models.example/v1/chat/completions`, its host in `hosts`), `body` the
53
+ OpenAI-style request as JSON (sent with POST), `maxPrice` the most to pay for the call (for example `"0.02"`).
52
54
 
53
55
  ## Actions
54
56
 
@@ -79,11 +81,8 @@ process.on("unhandledRejection", (e) => {
79
81
 
80
82
  ## Demo
81
83
 
82
- ![An AgentKit agent paying an x402 API on credit with this provider](../../docs/demos/agentkit.gif)
83
-
84
84
  A production run on 2026-10-30 (agent #437, Robinhood Chain mainnet; the model calling these actions through
85
- `@coinbase/agentkit-vercel-ai-sdk`), its own output lines with waits over 6 seconds shortened. The agent reads the
86
- seller's record (Blockpin, agent #9233), pays its x402 check (0.10 USDG) from an empty wallet by borrowing 5 USDG (loan
85
+ `@coinbase/agentkit-vercel-ai-sdk`). The agent reads the seller's record, pays its x402 check (0.10 USDG) from an empty wallet by borrowing 5 USDG (loan
87
86
  #50884), and repays 5.011666 USDG after its income arrives.
88
87
  Transactions: [borrow](https://robinhoodchain.blockscout.com/tx/0x297608c51007480ec8c5aa510d78926d6f14bf58ed467cb797aedc5922884a9e),
89
88
  [payment](https://robinhoodchain.blockscout.com/tx/0xbb7fd5dcc13ac547873516713e4940cecadcda76873d980d3ad402de48288c19),
@@ -53,7 +53,7 @@ class PriorsActionProvider extends agentkit_1.ActionProvider {
53
53
  throw new Error("autoBorrow.perDay must be at least autoBorrow.perCall");
54
54
  const hosts = (a.hosts ?? []).map(h => String(h).trim().toLowerCase());
55
55
  if (!hosts.length || hosts.some(h => !/^[a-z0-9.-]+(:\d{1,5})?$/.test(h)))
56
- throw new Error("autoBorrow.hosts must list the host names it may borrow to pay, e.g. [\"agent402.tools\"]");
56
+ throw new Error("autoBorrow.hosts must list the host names it may borrow to pay, e.g. [\"models.example\"]");
57
57
  this.auto = { perCall, perDay, hosts: new Set(hosts) };
58
58
  }
59
59
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@priors/agentkit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Priors action provider for Coinbase AgentKit: pay x402 APIs in USDG on Robinhood Chain and borrow the gap from an ERC-8004 agent's Priors credit line, repay, and read another agent's repayment record before paying it.",
5
5
  "license": "MIT",
6
6
  "author": "Priors <contact@priors.trade>",