@priors/plugin-elizaos 0.2.0 → 0.3.0
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 +12 -10
- package/elizaos.plugin.json +2 -1
- package/package.json +3 -2
- package/src/index.js +35 -9
- package/src/parse.js +22 -9
- package/src/priors.js +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,8 @@ Add it to the character's plugins (elizaOS 1.7 or later):
|
|
|
21
21
|
"secrets": {
|
|
22
22
|
"PRIORS_KEY_FILE": "/path/to/agent-wallet.key",
|
|
23
23
|
"PRIORS_AGENT_ID": "1234",
|
|
24
|
-
"
|
|
24
|
+
"PRIORS_OWNER_ENTITY_IDS": "<your elizaOS entity id>",
|
|
25
|
+
"PRIORS_PAY_HOSTS": "api.priors.trade"
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -31,11 +32,12 @@ Add it to the character's plugins (elizaOS 1.7 or later):
|
|
|
31
32
|
|---|---|
|
|
32
33
|
| `PRIORS_KEY_FILE` | a file holding the agent wallet's private key, readable by this user only (`chmod 600`); a dedicated wallet, never a main one (`PRIORS_KEY` works too) |
|
|
33
34
|
| `PRIORS_AGENT_ID` | the agent's ERC-8004 id on Robinhood Chain |
|
|
35
|
+
| `PRIORS_OWNER_ENTITY_IDS` | the elizaOS entity ids whose messages may make the agent pay or repay, comma-separated. In a room (Discord, Telegram, X replies) a message is from whoever spoke, so unset, `PRIORS_PAY_X402` and `PRIORS_REPAY` answer no one; `*` lets anyone in the agent's rooms make it pay, within the caps below. The reads answer everyone. New in 0.3.0: an agent upgraded without it pays and repays for no one, so set it when upgrading |
|
|
34
36
|
| `PRIORS_PAY_HOSTS` | the only hosts a payment may go to, comma-separated |
|
|
35
37
|
| `PRIORS_MAX_PRICE_USD` | most one x402 call may cost (default 1.00) |
|
|
36
38
|
| `PRIORS_STATE_DIR` | where the daily caps and sent payments are kept: a directory only this user can write to, with no group- or world-writable parent (otherwise nothing is signed) |
|
|
37
39
|
| `PRIORS_MAX_SPEND_DAY_USD`, `PRIORS_MAX_BORROW_DAY_USD` | optional daily caps |
|
|
38
|
-
| `PRIORS_AUTO_BORROW_USD` | optional, off by default (`@priors/mcp` 0.15.0): auto-borrow. A payment whose message names no borrow then borrows the gap on its own, up to this amount, for 14 days, only while the agent wallet's Autopay covers the loan. Needs `PRIORS_MAX_BORROW_DAY_USD` above 0, `PRIORS_PAY_HOSTS`, `PRIORS_AGENT_ID` and `PRIORS_STATE_DIR` |
|
|
40
|
+
| `PRIORS_AUTO_BORROW_USD` | optional, off by default (`@priors/mcp` 0.15.0): auto-borrow. A payment whose message names no borrow then borrows the gap on its own, up to this amount, for 14 days, only while the agent wallet's Autopay covers the loan (from 0.3.0, on `@priors/mcp` 0.16.0, never while the agent wallet is its owner's own address, which Autopay does not repay under a wallet plan). Needs `PRIORS_MAX_BORROW_DAY_USD` above 0, `PRIORS_PAY_HOSTS`, `PRIORS_AGENT_ID` and `PRIORS_STATE_DIR` |
|
|
39
41
|
|
|
40
42
|
Without a key, only `PRIORS_AGENT_RECORD` works.
|
|
41
43
|
|
|
@@ -50,9 +52,9 @@ Without a key, only `PRIORS_AGENT_RECORD` works.
|
|
|
50
52
|
|
|
51
53
|
Example messages:
|
|
52
54
|
|
|
53
|
-
- "Before we pay it, check agent #
|
|
54
|
-
- "Pay https://
|
|
55
|
-
- "Buy a chat completion from https://
|
|
55
|
+
- "Before we pay it, check agent #1234's record on Priors."
|
|
56
|
+
- "Pay https://api.priors.trade/v1/report/1234 at most 0.05, borrow up to 5 if the wallet is short."
|
|
57
|
+
- "Buy a chat completion from https://models.example/v1/chat/completions at most 0.02: {"model": "…", "messages": [{"role": "user", "content": "…"}]}" (the URL, the price and any borrow are read outside the JSON; `models.example` stands for an OpenAI-compatible model API you choose that charges over x402, its host in `PRIORS_PAY_HOSTS`)
|
|
56
58
|
- "Repay loan 50900 now."
|
|
57
59
|
|
|
58
60
|
## How it works
|
|
@@ -62,7 +64,10 @@ and reads records from the hosted read-only server at `https://mcp.priors.trade/
|
|
|
62
64
|
allowlist and the signing are `@priors/mcp`'s own: a payment above `max_price_usd` or to a host outside
|
|
63
65
|
`PRIORS_PAY_HOSTS` is refused before anything is signed, and the server's totals (`PRIORS_MAX_SPEND_USD` 5 and
|
|
64
66
|
`PRIORS_MAX_BORROW_TOTAL_USD` 25 by default while it runs) bound what one process can spend or borrow. Amounts and
|
|
65
|
-
URLs are read from the
|
|
67
|
+
URLs are read from the message of a sender listed in `PRIORS_OWNER_ENTITY_IDS`, never chosen by the model: the URL is
|
|
68
|
+
taken out before the amounts are read, so nothing in a seller's path or query (`/pay1/borrow5.json`, `#123`) is ever
|
|
69
|
+
read as a price, a borrow or an id, and a bare "pay 5" is a price only when no cap phrase ("at most", "max", "up to",
|
|
70
|
+
"no more than") is named and it is an amount, not a count ("pay 5 items").
|
|
66
71
|
|
|
67
72
|
## Disclosure
|
|
68
73
|
|
|
@@ -72,10 +77,7 @@ URLs are read from the user's message, never chosen by the model.
|
|
|
72
77
|
|
|
73
78
|
## Demo
|
|
74
79
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
A production run in elizaOS 1.7.2 on 2026-10-30 (agent #437, Robinhood Chain mainnet), its own output lines with waits
|
|
78
|
-
over 6 seconds shortened. The agent reads the seller's record (Blockpin, agent #9233), then pays its x402 check (0.10
|
|
80
|
+
A production run in elizaOS 1.7.2 on 2026-10-30 (agent #437, Robinhood Chain mainnet). The agent reads the seller's record, then pays its x402 check (0.10
|
|
79
81
|
USDG) from an empty wallet: PRIORS_PAY_X402 borrows 5 USDG, the pool's minimum loan (loan #50896). The agent's income
|
|
80
82
|
then arrives from another wallet, and PRIORS_REPAY closes the loan for 5.011666 USDG.
|
|
81
83
|
Transactions: [borrow](https://robinhoodchain.blockscout.com/tx/0x1a17ff6a4f4329d4a16fee0c7654f43104b037a0d9109f9c7ee4c503cbdd2d81),
|
package/elizaos.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "priors",
|
|
3
3
|
"name": "@priors/plugin-elizaos",
|
|
4
4
|
"description": "Priors credit for agents on Robinhood Chain: pay x402 APIs and borrow the gap in USDG from the agent's line, repay it, and read another agent's repayment record before paying it.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"kind": "plugin",
|
|
7
7
|
"requiredSecrets": [],
|
|
8
8
|
"configSchema": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"properties": {
|
|
11
11
|
"PRIORS_KEY_FILE": { "type": "string", "description": "Path of a file holding the agent wallet's private key (chmod 600). Without a key, only records can be read." },
|
|
12
12
|
"PRIORS_AGENT_ID": { "type": "string", "description": "The agent's ERC-8004 id on Robinhood Chain." },
|
|
13
|
+
"PRIORS_OWNER_ENTITY_IDS": { "type": "string", "description": "The elizaOS entity ids whose messages may make the agent pay or repay, comma-separated (* for anyone in its rooms). Unset: no one." },
|
|
13
14
|
"PRIORS_PAY_HOSTS": { "type": "string", "description": "The only hosts a payment may go to, comma-separated." },
|
|
14
15
|
"PRIORS_MAX_PRICE_USD": { "type": "string", "description": "Most one x402 call may cost (default 1.00)." },
|
|
15
16
|
"PRIORS_MAX_SPEND_DAY_USD": { "type": "string", "description": "Most the agent may pay per UTC day (optional)." },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@priors/plugin-elizaos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Priors credit for elizaOS agents: pay x402 APIs and borrow the gap in USDG from the agent's Priors line on Robinhood Chain, repay it, and read another agent's repayment record before paying it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@modelcontextprotocol/sdk": "^1.30.1",
|
|
23
|
-
"@priors/mcp": "0.
|
|
23
|
+
"@priors/mcp": "0.16.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@elizaos/core": "^1.7.0"
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"PRIORS_KEY_FILE": { "type": "string", "description": "Path of a file holding the agent wallet's private key, readable by this user only (chmod 600). A dedicated wallet." },
|
|
32
32
|
"PRIORS_KEY": { "type": "string", "description": "The agent wallet's private key, if no key file is used." },
|
|
33
33
|
"PRIORS_AGENT_ID": { "type": "string", "description": "The agent's ERC-8004 id on Robinhood Chain." },
|
|
34
|
+
"PRIORS_OWNER_ENTITY_IDS": { "type": "string", "description": "The elizaOS entity ids whose messages may make the agent pay or repay, comma-separated (* for anyone in its rooms). Unset: no one." },
|
|
34
35
|
"PRIORS_PAY_HOSTS": { "type": "string", "description": "The only hosts a payment may go to, comma-separated." },
|
|
35
36
|
"PRIORS_MAX_PRICE_USD": { "type": "string", "description": "Most one x402 call may cost (default 1.00)." },
|
|
36
37
|
"PRIORS_MAX_SPEND_DAY_USD": { "type": "string", "description": "Most the agent may pay per UTC day (optional)." },
|
package/src/index.js
CHANGED
|
@@ -3,12 +3,36 @@
|
|
|
3
3
|
// wallet is short, and repay a loan. Every amount and URL comes from the user's own message (parse.js); a payment
|
|
4
4
|
// borrows only when the message names the most to borrow, or, with the agent's PRIORS_AUTO_BORROW_USD set, on its own
|
|
5
5
|
// within that setting (a message saying not to borrow never does). A JSON body in the message is sent with POST (a
|
|
6
|
-
// chat completion bought over x402). The caps, the host allowlist and the signing are @priors/mcp's own.
|
|
6
|
+
// chat completion bought over x402). The caps, the host allowlist and the signing are @priors/mcp's own. The two money
|
|
7
|
+
// actions answer only the operator's elizaOS entities (PRIORS_OWNER_ENTITY_IDS): in a room, a message is from whoever
|
|
8
|
+
// spoke in it, not from the agent's operator (GHSA-p29w).
|
|
7
9
|
import { priorsOf } from "./priors.js";
|
|
8
10
|
import { urlOf, agentIdOf, loanIdOf, maxPriceOf, borrowOf, bodyOf } from "./parse.js";
|
|
9
11
|
|
|
10
12
|
const textOf = (message) => String((message && message.content && message.content.text) || "");
|
|
11
13
|
|
|
14
|
+
/** The entities whose messages may move the agent's money: PRIORS_OWNER_ENTITY_IDS (the agent's settings, else the
|
|
15
|
+
* process env), comma-separated elizaOS entity ids, or "*" for anyone (the operator's own choice); none when unset. */
|
|
16
|
+
function operatorsOf(runtime) {
|
|
17
|
+
const v = runtime && typeof runtime.getSetting === "function" ? runtime.getSetting("PRIORS_OWNER_ENTITY_IDS") : undefined;
|
|
18
|
+
const raw = String(v ?? process.env.PRIORS_OWNER_ENTITY_IDS ?? "").trim();
|
|
19
|
+
return raw === "*" ? "*" : new Set(raw.split(",").map((x) => x.trim().toLowerCase()).filter(Boolean));
|
|
20
|
+
}
|
|
21
|
+
/** Whether this message's sender may move the agent's money. */
|
|
22
|
+
function fromOperator(runtime, message) {
|
|
23
|
+
const ops = operatorsOf(runtime);
|
|
24
|
+
if (ops === "*") return true;
|
|
25
|
+
const who = message && message.entityId ? String(message.entityId).toLowerCase() : "";
|
|
26
|
+
return !!who && ops.has(who);
|
|
27
|
+
}
|
|
28
|
+
/** The refusal a money action gives any other sender (nothing is sent). */
|
|
29
|
+
function notOperator(runtime) {
|
|
30
|
+
const set = operatorsOf(runtime) !== "*" && operatorsOf(runtime).size > 0;
|
|
31
|
+
return set
|
|
32
|
+
? "Nothing was paid or repaid: this agent moves money only for its operator (PRIORS_OWNER_ENTITY_IDS)."
|
|
33
|
+
: "Nothing was paid or repaid: this agent moves money only for its operator, and none is set. Set PRIORS_OWNER_ENTITY_IDS to the operator's elizaOS entity ids (comma-separated), or to * to let anyone in its rooms make it pay.";
|
|
34
|
+
}
|
|
35
|
+
|
|
12
36
|
/** Answer through the callback and as the action's result. */
|
|
13
37
|
async function answer(callback, action, ok, text, data = {}) {
|
|
14
38
|
if (typeof callback === "function") await callback({ text, actions: [action] });
|
|
@@ -49,9 +73,10 @@ export const creditStatusAction = {
|
|
|
49
73
|
export const payX402Action = {
|
|
50
74
|
name: "PRIORS_PAY_X402",
|
|
51
75
|
similes: ["PAY_X402", "PAY_HTTP_402", "BUY_API_CALL"],
|
|
52
|
-
description: "Pay an HTTP 402 (x402) URL in USDG from this agent's wallet, with GET, or with POST when the message gives a JSON body (a chat completion, for one). If the wallet is short, it borrows the gap from the agent's Priors line, when the message names the most to borrow, or, with the agent's PRIORS_AUTO_BORROW_USD set, on its own within that setting while Autopay covers the loan. The message must name the URL and the most to pay. Real money.",
|
|
53
|
-
validate: async (
|
|
76
|
+
description: "Pay an HTTP 402 (x402) URL in USDG from this agent's wallet, with GET, or with POST when the message gives a JSON body (a chat completion, for one). If the wallet is short, it borrows the gap from the agent's Priors line, when the message names the most to borrow, or, with the agent's PRIORS_AUTO_BORROW_USD set, on its own within that setting while Autopay covers the loan. The message must name the URL and the most to pay, and come from the agent's operator (PRIORS_OWNER_ENTITY_IDS). Real money.",
|
|
77
|
+
validate: async (runtime, message) => fromOperator(runtime, message) && !!urlOf(textOf(message)) && /\bpay|buy|call|fetch/i.test(textOf(message)),
|
|
54
78
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
79
|
+
if (!fromOperator(runtime, message)) return answer(callback, "PRIORS_PAY_X402", false, notOperator(runtime), {});
|
|
55
80
|
const text = textOf(message);
|
|
56
81
|
const b = bodyOf(text);
|
|
57
82
|
const rest = b ? text.replace(b.raw, " ") : text;
|
|
@@ -66,20 +91,21 @@ export const payX402Action = {
|
|
|
66
91
|
return answer(callback, "PRIORS_PAY_X402", r.ok, r.text, { url, maxPrice, maxBorrow: borrow ?? 0, ...(b ? { method: "POST" } : {}) });
|
|
67
92
|
},
|
|
68
93
|
examples: [[
|
|
69
|
-
{ name: "{{user1}}", content: { text: "Pay https://
|
|
70
|
-
{ name: "{{agentName}}", content: { text: "Paid 0.
|
|
94
|
+
{ name: "{{user1}}", content: { text: "Pay https://api.priors.trade/v1/report/1234 at most 0.05, borrow up to 5 if the wallet is short." } },
|
|
95
|
+
{ name: "{{agentName}}", content: { text: "Paid 0.03 USDG; the wallet was short, so it borrowed 5 USDG, the pool's minimum loan, from the Priors line (loan #50900, due 6 November).", actions: ["PRIORS_PAY_X402"] } },
|
|
71
96
|
], [
|
|
72
|
-
{ name: "{{user1}}", content: { text: "Buy one chat completion from https://
|
|
73
|
-
{ name: "{{agentName}}", content: { text: "Paid 0.02 USDG to
|
|
97
|
+
{ name: "{{user1}}", content: { text: "Buy one chat completion from https://models.example/v1/chat/completions at most 0.02: {\"model\": \"…\", \"messages\": [{\"role\": \"user\", \"content\": \"Summarise x402 in one line.\"}]}" } },
|
|
98
|
+
{ name: "{{agentName}}", content: { text: "Paid 0.02 USDG to models.example with POST; the model answered: \"x402 lets an API charge per call over HTTP 402.\"", actions: ["PRIORS_PAY_X402"] } },
|
|
74
99
|
]],
|
|
75
100
|
};
|
|
76
101
|
|
|
77
102
|
export const repayAction = {
|
|
78
103
|
name: "PRIORS_REPAY",
|
|
79
104
|
similes: ["REPAY_LOAN", "PAY_BACK_LOAN"],
|
|
80
|
-
description: "Repay one of this agent's Priors loans in full (principal and fee) from its wallet. Needs the loan id in the message, as loan 50900. Real money.",
|
|
81
|
-
validate: async (
|
|
105
|
+
description: "Repay one of this agent's Priors loans in full (principal and fee) from its wallet. Needs the loan id in the message, as loan 50900, from the agent's operator (PRIORS_OWNER_ENTITY_IDS). Real money.",
|
|
106
|
+
validate: async (runtime, message) => fromOperator(runtime, message) && loanIdOf(textOf(message)) !== null && /repay|pay (it )?back/i.test(textOf(message)),
|
|
82
107
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
108
|
+
if (!fromOperator(runtime, message)) return answer(callback, "PRIORS_REPAY", false, notOperator(runtime), {});
|
|
83
109
|
const loan = loanIdOf(textOf(message));
|
|
84
110
|
const r = await priorsOf(runtime).wallet("repay", { loan_id: loan });
|
|
85
111
|
return answer(callback, "PRIORS_REPAY", r.ok, r.text, { loanId: loan });
|
package/src/parse.js
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
const num = (s) => { const n = Number(String(s).replace(",", ".")); return Number.isFinite(n) && n >= 0 ? n : null; };
|
|
5
5
|
|
|
6
|
+
const URL_RE = /https?:\/\/[^\s<>"'`)\]]+/gi;
|
|
7
|
+
/** The message's own words: every URL taken out, so nothing in a seller's path or query (/pay1/borrow5.json, #123) is
|
|
8
|
+
* ever read as an amount or an id (GHSA-rf6g, GHSA-62m7). */
|
|
9
|
+
export const proseOf = (text) => String(text || "").replace(URL_RE, " ");
|
|
10
|
+
|
|
6
11
|
/** The first https URL in the text, or null. */
|
|
7
12
|
export function urlOf(text) {
|
|
8
13
|
const m = String(text || "").match(/https:\/\/[^\s<>"'`)\]]+/i);
|
|
@@ -12,7 +17,7 @@ export function urlOf(text) {
|
|
|
12
17
|
|
|
13
18
|
/** An agent id: "agent 9233" or "agent #9233" first, else a bare "#9233" that is not a loan's; null when none. */
|
|
14
19
|
export function agentIdOf(text) {
|
|
15
|
-
const t =
|
|
20
|
+
const t = proseOf(text);
|
|
16
21
|
const named = t.match(/agent\s*#?\s*(\d{1,12})\b/i);
|
|
17
22
|
if (named) return Number(named[1]);
|
|
18
23
|
for (const m of t.matchAll(/#(\d{1,12})\b/g)) if (!/loan\s*$/i.test(t.slice(0, m.index))) return Number(m[1]);
|
|
@@ -21,18 +26,26 @@ export function agentIdOf(text) {
|
|
|
21
26
|
|
|
22
27
|
/** A loan id: "loan 50327" or "loan #50327"; null when none. */
|
|
23
28
|
export function loanIdOf(text) {
|
|
24
|
-
const m =
|
|
29
|
+
const m = proseOf(text).match(/\bloan\s*#?\s*(\d{1,12})\b/i);
|
|
25
30
|
return m ? Number(m[1]) : null;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
// The borrow phrase with its amount: "borrow up to 1", "borrow at most $0.50", "borrow 1"
|
|
29
|
-
|
|
33
|
+
// The borrow phrase with its amount: "borrow up to 1", "borrow at most $0.50", "borrow 1" (whole words only), and an
|
|
34
|
+
// aside right after it ("borrow 0.50 (up to 5)"), which is the borrow's too.
|
|
35
|
+
const BORROW = /\bborrow(?:ing)?\s*(?:up to|at most|no more than|max(?:imum)?)?\s*\$?\s*(\d+(?:[.,]\d+)?)\b(?:\s*\([^)]*\))?/i;
|
|
36
|
+
const AMOUNT = "\\$?\\s*(\\d+(?:[.,]\\d+)?)";
|
|
37
|
+
// a cap phrase: "at most 0.10", "max $0.10", "up to 0.10", "no more than 0.10"
|
|
38
|
+
const CAP = new RegExp(`\\b(?:at most|max(?:imum)?|up to|no more than)\\s*${AMOUNT}(?!\\d|[.,]\\d)`, "i");
|
|
39
|
+
// a bare "pay 0.10": an amount (USDG, USD, dollars, or nothing more) before the end, punctuation or a preposition, not a
|
|
40
|
+
// count ("pay 5 items")
|
|
41
|
+
const PAY = new RegExp(`\\bpay\\s+${AMOUNT}(?:\\s*(?:usdg|usd|dollars?))?(?=\\s*(?:$|[.,;:!?)]|(?:for|to|at|per|each|on)\\b))`, "i");
|
|
30
42
|
|
|
31
|
-
/** The most to pay: "at most 0.10", "max 0.10", "up to
|
|
32
|
-
* wherever it stands, is taken out first, so
|
|
43
|
+
/** The most to pay, from the message's own words (never its URL): a cap phrase ("at most 0.10", "max 0.10", "up to
|
|
44
|
+
* $0.10 for it"), else a bare "pay 0.10"; null when none. The borrow phrase, wherever it stands, is taken out first, so
|
|
45
|
+
* its amount is never read as the price. */
|
|
33
46
|
export function maxPriceOf(text) {
|
|
34
|
-
const t =
|
|
35
|
-
const m = t.match(
|
|
47
|
+
const t = proseOf(text).replace(new RegExp(BORROW.source, "gi"), " ");
|
|
48
|
+
const m = t.match(CAP) || t.match(PAY);
|
|
36
49
|
return m ? num(m[1]) : null;
|
|
37
50
|
}
|
|
38
51
|
|
|
@@ -44,7 +57,7 @@ export function maxBorrowOf(text) {
|
|
|
44
57
|
/** The borrow the message names: its amount, 0 for "don't borrow", "no borrowing", "without borrowing" or "never
|
|
45
58
|
* borrow", null when it names none (then @priors/mcp's own setting decides: never, or its auto-borrow). */
|
|
46
59
|
export function borrowOf(text) {
|
|
47
|
-
const t =
|
|
60
|
+
const t = proseOf(text);
|
|
48
61
|
if (/\b(?:do not|don't|dont|never|no|without)\s+borrow/i.test(t)) return 0;
|
|
49
62
|
const m = t.match(BORROW);
|
|
50
63
|
return m ? num(m[1]) ?? 0 : null;
|
package/src/priors.js
CHANGED
|
@@ -6,7 +6,7 @@ import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
|
6
6
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
7
7
|
|
|
8
8
|
export const HOSTED_URL = "https://mcp.priors.trade/mcp";
|
|
9
|
-
export const CLIENT = { name: "elizaos-plugin-priors", version: "0.
|
|
9
|
+
export const CLIENT = { name: "elizaos-plugin-priors", version: "0.3.0" };
|
|
10
10
|
|
|
11
11
|
/** The settings @priors/mcp reads, taken from the agent's settings (runtime.getSetting), else the process env. */
|
|
12
12
|
export const SETTINGS = Object.freeze([
|