use-agently 0.28.0 → 0.30.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 +13 -17
- package/build/bin.js +68 -59
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Manage local EVM wallets, discover agents, and communicate with them via the [A2
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
+
npx skills add https://github.com/agentlyhq/use-agently --skill use-agently
|
|
10
11
|
npm install -g use-agently@latest
|
|
11
12
|
```
|
|
12
13
|
|
|
@@ -25,10 +26,13 @@ use-agently whoami
|
|
|
25
26
|
# Check your on-chain balance
|
|
26
27
|
use-agently balance
|
|
27
28
|
|
|
28
|
-
#
|
|
29
|
-
use-agently
|
|
29
|
+
# Browse available agents
|
|
30
|
+
use-agently search
|
|
31
|
+
|
|
32
|
+
# Search for agents by intent
|
|
33
|
+
use-agently search -q "echo"
|
|
30
34
|
|
|
31
|
-
# Send a message to an agent (use the URI from `use-agently
|
|
35
|
+
# Send a message to an agent (use the URI from `use-agently search`)
|
|
32
36
|
use-agently a2a send --uri <agent-uri> -m "Hello, agent!"
|
|
33
37
|
```
|
|
34
38
|
|
|
@@ -86,23 +90,15 @@ use-agently balance
|
|
|
86
90
|
use-agently balance --rpc https://mainnet.base.org
|
|
87
91
|
```
|
|
88
92
|
|
|
89
|
-
### `agents`
|
|
90
|
-
|
|
91
|
-
List available agents on Agently.
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
use-agently agents
|
|
95
|
-
```
|
|
96
|
-
|
|
97
93
|
### `search`
|
|
98
94
|
|
|
99
|
-
Search the Agently marketplace for agents, optionally filtering by query and/or protocol.
|
|
95
|
+
Search the Agently marketplace for agents, optionally filtering by query and/or protocol. Running without a query lists all available agents.
|
|
100
96
|
|
|
101
97
|
```bash
|
|
102
|
-
use-agently search
|
|
103
|
-
use-agently search "echo"
|
|
104
|
-
use-agently search --protocol a2a
|
|
105
|
-
use-agently search "assistant" --protocol "a2a,mcp"
|
|
98
|
+
use-agently search # Browse all agents
|
|
99
|
+
use-agently search -q "echo" # Search by intent
|
|
100
|
+
use-agently search --protocol a2a # Filter by protocol
|
|
101
|
+
use-agently search -q "assistant" --protocol "a2a,mcp" # Combine query and protocol filter
|
|
106
102
|
```
|
|
107
103
|
|
|
108
104
|
### `a2a`
|
|
@@ -147,7 +143,7 @@ use-agently web get https://paid-api.example.com/resource
|
|
|
147
143
|
## How It Works
|
|
148
144
|
|
|
149
145
|
1. **Wallet** — `init` generates an EVM private key stored locally. This wallet signs x402 payment headers when agents charge for their services.
|
|
150
|
-
2. **Discovery** — `
|
|
146
|
+
2. **Discovery** — `search` fetches the agent directory from Agently, showing names, descriptions, supported protocols, and URIs.
|
|
151
147
|
3. **Communication** — `a2a send` takes an agent URI (e.g. `echo-agent`), constructs the URL as `https://use-agently.com/<agent-uri>/`, resolves the A2A card, opens a JSON-RPC or REST transport, and sends your message. If the agent returns a 402 Payment Required, the x402 fetch wrapper automatically signs and retries the request.
|
|
152
148
|
|
|
153
149
|
## Development
|
package/build/bin.js
CHANGED
|
@@ -91828,7 +91828,7 @@ function PayTransaction(wallet) {
|
|
|
91828
91828
|
// ../use-agently-sdk/package.json
|
|
91829
91829
|
var package_default = {
|
|
91830
91830
|
name: "@use-agently/sdk",
|
|
91831
|
-
version: "0.
|
|
91831
|
+
version: "0.30.0",
|
|
91832
91832
|
description: "Core SDK for the Agently platform — wallet management, A2A, MCP, x402 payments",
|
|
91833
91833
|
homepage: "https://github.com/AgentlyHQ/use-agently/tree/main/packages/use-agently-sdk",
|
|
91834
91834
|
bugs: {
|
|
@@ -96483,7 +96483,9 @@ Config: ~/.use-agently/config.json (global), .use-agently/config.json (local)`).
|
|
|
96483
96483
|
});
|
|
96484
96484
|
|
|
96485
96485
|
// src/commands/whoami.ts
|
|
96486
|
-
var whoamiCommand = new Command("whoami").description("Show current wallet info").showHelpAfterError(true).
|
|
96486
|
+
var whoamiCommand = new Command("whoami").description("Show current wallet info").showHelpAfterError(true).addHelpText("after", `
|
|
96487
|
+
Examples:
|
|
96488
|
+
use-agently whoami`).action(async (_options, command) => {
|
|
96487
96489
|
const config2 = await getConfigOrThrow();
|
|
96488
96490
|
const wallet = loadWallet(config2.wallet);
|
|
96489
96491
|
output(command, {
|
|
@@ -96493,7 +96495,9 @@ var whoamiCommand = new Command("whoami").description("Show current wallet info"
|
|
|
96493
96495
|
});
|
|
96494
96496
|
|
|
96495
96497
|
// src/commands/balance.ts
|
|
96496
|
-
var balanceCommand = new Command("balance").description("Check wallet balance on-chain").option("--rpc <url>", "Custom RPC URL").showHelpAfterError(true).
|
|
96498
|
+
var balanceCommand = new Command("balance").description("Check wallet balance on-chain").option("--rpc <url>", "Custom RPC URL").showHelpAfterError(true).addHelpText("after", `
|
|
96499
|
+
Examples:
|
|
96500
|
+
use-agently balance`).action(async (options, command) => {
|
|
96497
96501
|
const config2 = await getConfigOrThrow();
|
|
96498
96502
|
const wallet = loadWallet(config2.wallet);
|
|
96499
96503
|
const result = await getBalance2(wallet.address, { rpc: options.rpc });
|
|
@@ -96502,7 +96506,7 @@ var balanceCommand = new Command("balance").description("Check wallet balance on
|
|
|
96502
96506
|
// package.json
|
|
96503
96507
|
var package_default2 = {
|
|
96504
96508
|
name: "use-agently",
|
|
96505
|
-
version: "0.
|
|
96509
|
+
version: "0.30.0",
|
|
96506
96510
|
description: "Use Agently CLI",
|
|
96507
96511
|
homepage: "https://use-agently.com",
|
|
96508
96512
|
bugs: "https://github.com/AgentlyHQ/use-agently/issues",
|
|
@@ -96526,7 +96530,7 @@ var package_default2 = {
|
|
|
96526
96530
|
test: "bun test"
|
|
96527
96531
|
},
|
|
96528
96532
|
dependencies: {
|
|
96529
|
-
"@use-agently/sdk": "0.
|
|
96533
|
+
"@use-agently/sdk": "0.30.0",
|
|
96530
96534
|
boxen: "^8.0.1",
|
|
96531
96535
|
"cli-table3": "^0.6.5",
|
|
96532
96536
|
commander: "^14.0.3",
|
|
@@ -96672,49 +96676,13 @@ function handleSpendLimitError(err) {
|
|
|
96672
96676
|
handleErrorAndExit("Spend Limit Exceeded", err.message, "red");
|
|
96673
96677
|
}
|
|
96674
96678
|
|
|
96675
|
-
// src/commands/agents.ts
|
|
96676
|
-
var agentsCommand = new Command("agents").description("List available agents on Agently").action(async (_options, command) => {
|
|
96677
|
-
const format = getOutputFormat(command);
|
|
96678
|
-
const result = await search(defaultClient);
|
|
96679
|
-
const items = result.hits.map(({ id, name, description, protocols }) => ({ id, name, description, protocols }));
|
|
96680
|
-
if (items.length === 0) {
|
|
96681
|
-
outputNoResults(format);
|
|
96682
|
-
return;
|
|
96683
|
-
}
|
|
96684
|
-
if (format === "tui") {
|
|
96685
|
-
renderAgentsTable(items);
|
|
96686
|
-
} else {
|
|
96687
|
-
outputJsonCollection(items);
|
|
96688
|
-
}
|
|
96689
|
-
});
|
|
96690
|
-
function formatId(id) {
|
|
96691
|
-
const match = id.match(/^(.*?\/erc8004:)(0x[0-9a-fA-F]+)(\/\d+)$/);
|
|
96692
|
-
if (match)
|
|
96693
|
-
return `${match[1]}
|
|
96694
|
-
${match[2]}
|
|
96695
|
-
${match[3]}`;
|
|
96696
|
-
return id;
|
|
96697
|
-
}
|
|
96698
|
-
function renderAgentsTable(items) {
|
|
96699
|
-
const maxWidth = getMaxWidth();
|
|
96700
|
-
const idSegmentWidth = Math.max(...items.flatMap((item) => formatId(item.id).split(`
|
|
96701
|
-
`).map((line) => line.length))) + 2;
|
|
96702
|
-
const protoWidth = 12;
|
|
96703
|
-
const nameDescWidth = maxWidth - idSegmentWidth - protoWidth - 10;
|
|
96704
|
-
const table = new import_cli_table3.default({
|
|
96705
|
-
wordWrap: true,
|
|
96706
|
-
wrapOnWordBoundary: true,
|
|
96707
|
-
colWidths: [idSegmentWidth, nameDescWidth, protoWidth],
|
|
96708
|
-
head: ["id", "agent (name & description)", "protocols"]
|
|
96709
|
-
});
|
|
96710
|
-
for (const item of items) {
|
|
96711
|
-
table.push([formatId(item.id), `${boldBlue(item.name)}
|
|
96712
|
-
${item.description}`, (item.protocols ?? []).join(", ")]);
|
|
96713
|
-
}
|
|
96714
|
-
console.log(table.toString());
|
|
96715
|
-
}
|
|
96716
|
-
|
|
96717
96679
|
// src/commands/search.ts
|
|
96680
|
+
var SUPPORTED_PROTOCOLS = ["a2a", "mcp"];
|
|
96681
|
+
function getHealthyProtocols(protocol) {
|
|
96682
|
+
if (!protocol)
|
|
96683
|
+
return [];
|
|
96684
|
+
return SUPPORTED_PROTOCOLS.filter((name) => protocol[name]?.healthy === true);
|
|
96685
|
+
}
|
|
96718
96686
|
var searchCommand = new Command("search").description("Search the Agently marketplace for agents").option("-q, --query <text>", "Search query to filter agents by name or description").option("-p, --protocol <protocols>", "Filter by protocol(s), comma-separated (e.g. a2a,mcp)").showHelpAfterError(true).addHelpText("after", [
|
|
96719
96687
|
"",
|
|
96720
96688
|
"Examples:",
|
|
@@ -96734,18 +96702,21 @@ var searchCommand = new Command("search").description("Search the Agently market
|
|
|
96734
96702
|
const format = getOutputFormat(command);
|
|
96735
96703
|
const protocol = options.protocol ? options.protocol.split(",").map((p) => p.trim().toLowerCase()) : undefined;
|
|
96736
96704
|
const result = await search(defaultClient, { q: options.query, protocol });
|
|
96737
|
-
const items = result.hits.map((
|
|
96705
|
+
const items = result.hits.map((hit) => {
|
|
96706
|
+
const protocols = getHealthyProtocols(hit.protocol);
|
|
96707
|
+
return { id: hit.id, name: hit.name, description: hit.description, protocols };
|
|
96708
|
+
}).filter((item) => item.protocols.length > 0);
|
|
96738
96709
|
if (items.length === 0) {
|
|
96739
96710
|
outputNoResults(format);
|
|
96740
96711
|
return;
|
|
96741
96712
|
}
|
|
96742
96713
|
if (format === "tui") {
|
|
96743
|
-
|
|
96714
|
+
renderAgentsTable(items);
|
|
96744
96715
|
} else {
|
|
96745
96716
|
outputJsonCollection(items);
|
|
96746
96717
|
}
|
|
96747
96718
|
});
|
|
96748
|
-
function
|
|
96719
|
+
function formatId(id) {
|
|
96749
96720
|
const match = id.match(/^(.*?\/erc8004:)(0x[0-9a-fA-F]+)(\/\d+)$/);
|
|
96750
96721
|
if (match)
|
|
96751
96722
|
return `${match[1]}
|
|
@@ -96753,9 +96724,9 @@ ${match[2]}
|
|
|
96753
96724
|
${match[3]}`;
|
|
96754
96725
|
return id;
|
|
96755
96726
|
}
|
|
96756
|
-
function
|
|
96727
|
+
function renderAgentsTable(items) {
|
|
96757
96728
|
const maxWidth = getMaxWidth();
|
|
96758
|
-
const idSegmentWidth = Math.max(...items.flatMap((item) =>
|
|
96729
|
+
const idSegmentWidth = Math.max(...items.flatMap((item) => formatId(item.id).split(`
|
|
96759
96730
|
`).map((line) => line.length))) + 2;
|
|
96760
96731
|
const protoWidth = 12;
|
|
96761
96732
|
const nameDescWidth = maxWidth - idSegmentWidth - protoWidth - 10;
|
|
@@ -96766,7 +96737,7 @@ function renderAgentsTable2(items) {
|
|
|
96766
96737
|
head: ["id", "agent (name & description)", "protocols"]
|
|
96767
96738
|
});
|
|
96768
96739
|
for (const item of items) {
|
|
96769
|
-
table.push([
|
|
96740
|
+
table.push([formatId(item.id), `${boldBlue(item.name)}
|
|
96770
96741
|
${item.description}`, (item.protocols ?? []).join(", ")]);
|
|
96771
96742
|
}
|
|
96772
96743
|
console.log(table.toString());
|
|
@@ -96794,7 +96765,10 @@ async function resolveTransactionMode(pay) {
|
|
|
96794
96765
|
}
|
|
96795
96766
|
return { client: defaultClient, mode: DryRunTransaction };
|
|
96796
96767
|
}
|
|
96797
|
-
var a2aCommand = new Command("a2a").description("Send messages and fetch agent cards via the A2A protocol").
|
|
96768
|
+
var a2aCommand = new Command("a2a").description("Send messages and fetch agent cards via the A2A protocol").addHelpText("after", `
|
|
96769
|
+
Examples:
|
|
96770
|
+
use-agently a2a send --uri <uri> -m "Hello!"
|
|
96771
|
+
use-agently a2a card --uri <uri>`).action(function() {
|
|
96798
96772
|
this.outputHelp();
|
|
96799
96773
|
});
|
|
96800
96774
|
var a2aSendCommand = new Command("send").description("Send a message to an agent via A2A protocol").requiredOption("-u, --uri <value>", "Agent URL or CAIP-19 ID (e.g. https://example.com/agent or eip155:8453/erc8004:0x1234/1)").requiredOption("-m, --message <text>", "Message to send").option("--pay", "Authorize payment if the agent requires it (default: dry-run, shows cost only)").showHelpAfterError(true).addHelpText("after", `
|
|
@@ -96858,7 +96832,10 @@ function checkSpendLimit(err, maxSpendPerCall) {
|
|
|
96858
96832
|
throw new SpendLimitExceeded(amountInDollars, maxSpendPerCall);
|
|
96859
96833
|
}
|
|
96860
96834
|
}
|
|
96861
|
-
var mcpCommand = new Command("mcp").description("Discover and call tools on MCP servers (always list tools before calling)").
|
|
96835
|
+
var mcpCommand = new Command("mcp").description("Discover and call tools on MCP servers (always list tools before calling)").addHelpText("after", `
|
|
96836
|
+
Examples:
|
|
96837
|
+
use-agently mcp tools --uri <uri>
|
|
96838
|
+
use-agently mcp call --uri <uri> --tool <name> --args '{"key":"value"}'`).action(function() {
|
|
96862
96839
|
this.outputHelp();
|
|
96863
96840
|
});
|
|
96864
96841
|
var mcpToolsCommand = new Command("tools").description("List available tools on an MCP server").requiredOption("-u, --uri <value>", "MCP server URL or CAIP-19 ID").showHelpAfterError(true).addHelpText("after", `
|
|
@@ -97215,15 +97192,20 @@ function createMethodSubcommand(method, description, hasBody) {
|
|
|
97215
97192
|
const cmd = new Command(method).description(description).argument("<url>", "Full URL to request (e.g. https://api.example.com/data)").showHelpAfterError(true);
|
|
97216
97193
|
addSharedOptions(cmd, hasBody);
|
|
97217
97194
|
const bodyExample = hasBody ? ` -d '{"key":"value"}' -H "Content-Type: application/json"` : "";
|
|
97195
|
+
const payExample = !hasBody ? `
|
|
97196
|
+
use-agently web ${method} https://api.example.com/paid-endpoint --pay` : "";
|
|
97218
97197
|
cmd.addHelpText("after", `
|
|
97219
97198
|
Examples:
|
|
97220
|
-
use-agently web ${method} https://api.example.com/data${bodyExample} -v`);
|
|
97199
|
+
use-agently web ${method} https://api.example.com/data${bodyExample} -v${payExample}`);
|
|
97221
97200
|
cmd.action(async (url2, options, command) => {
|
|
97222
97201
|
await executeHttpRequest(method, url2, options, command);
|
|
97223
97202
|
});
|
|
97224
97203
|
return cmd;
|
|
97225
97204
|
}
|
|
97226
|
-
var webCommand = new Command("web").description("Make HTTP requests with automatic x402 payment support (GET, POST, PUT, PATCH, DELETE)").
|
|
97205
|
+
var webCommand = new Command("web").description("Make HTTP requests with automatic x402 payment support (GET, POST, PUT, PATCH, DELETE)").addHelpText("after", `
|
|
97206
|
+
Examples:
|
|
97207
|
+
use-agently web get https://api.example.com/data
|
|
97208
|
+
use-agently web post https://api.example.com/data -d '{"key":"value"}' --pay`).action(function() {
|
|
97227
97209
|
this.outputHelp();
|
|
97228
97210
|
});
|
|
97229
97211
|
webCommand.addCommand(createMethodSubcommand("get", "Make an HTTP GET request", false));
|
|
@@ -97234,6 +97216,9 @@ webCommand.addCommand(createMethodSubcommand("delete", "Make an HTTP DELETE requ
|
|
|
97234
97216
|
|
|
97235
97217
|
// src/commands/doctor.ts
|
|
97236
97218
|
var doctorCommand = new Command("doctor").description("Run environment checks and report any issues").option("--rpc <url>", "Custom RPC URL to use for network check").showHelpAfterError(true).addHelpText("after", `
|
|
97219
|
+
Examples:
|
|
97220
|
+
use-agently doctor
|
|
97221
|
+
|
|
97237
97222
|
Config: ~/.use-agently/config.json (global), .use-agently/config.json (local)`).action(async (options, command) => {
|
|
97238
97223
|
const checks3 = [];
|
|
97239
97224
|
const config2 = await loadConfig();
|
|
@@ -97357,7 +97342,10 @@ var updateCommand = new Command("update").description("Update use-agently to the
|
|
|
97357
97342
|
});
|
|
97358
97343
|
|
|
97359
97344
|
// src/commands/wallet.ts
|
|
97360
|
-
var walletCommand = new Command("wallet").description("Manage wallet settings (spend limits)").
|
|
97345
|
+
var walletCommand = new Command("wallet").description("Manage wallet settings (spend limits)").addHelpText("after", `
|
|
97346
|
+
Examples:
|
|
97347
|
+
use-agently wallet spend
|
|
97348
|
+
use-agently wallet spend set-max 0.5`).action(function() {
|
|
97361
97349
|
this.outputHelp();
|
|
97362
97350
|
});
|
|
97363
97351
|
var spendCommand = new Command("spend").description("View or manage wallet spend limits").showHelpAfterError(true).addHelpText("after", `
|
|
@@ -97395,7 +97383,6 @@ cli.name("use-agently").description("Agently is the way AI coordinate and transa
|
|
|
97395
97383
|
cli.addCommand(doctorCommand.helpGroup("Diagnostics"));
|
|
97396
97384
|
cli.addCommand(whoamiCommand.helpGroup("Diagnostics"));
|
|
97397
97385
|
cli.addCommand(balanceCommand.helpGroup("Diagnostics"));
|
|
97398
|
-
cli.addCommand(agentsCommand.helpGroup("Discovery"));
|
|
97399
97386
|
cli.addCommand(searchCommand.helpGroup("Discovery"));
|
|
97400
97387
|
cli.addCommand(viewCommand.helpGroup("Discovery"));
|
|
97401
97388
|
cli.addCommand(a2aCommand.helpGroup("Protocols"));
|
|
@@ -97404,6 +97391,28 @@ cli.addCommand(webCommand.helpGroup("Protocols"));
|
|
|
97404
97391
|
cli.addCommand(initCommand.helpGroup("Lifecycle"));
|
|
97405
97392
|
cli.addCommand(walletCommand.helpGroup("Lifecycle"));
|
|
97406
97393
|
cli.addCommand(updateCommand.helpGroup("Lifecycle"));
|
|
97394
|
+
cli.addHelpText("after", `
|
|
97395
|
+
Getting started: use-agently init → use-agently doctor → use-agently search
|
|
97396
|
+
|
|
97397
|
+
Quick Reference:
|
|
97398
|
+
|
|
97399
|
+
Send a message or fetch an agent card via A2A:
|
|
97400
|
+
a2a send -u <uri> -m <message> [--pay]
|
|
97401
|
+
a2a card -u <uri>
|
|
97402
|
+
|
|
97403
|
+
List or call tools on an MCP server:
|
|
97404
|
+
mcp tools -u <uri>
|
|
97405
|
+
mcp call -u <uri> --tool <name> [--args <json>] [--pay]
|
|
97406
|
+
|
|
97407
|
+
HTTP requests with x402 payment support:
|
|
97408
|
+
web get|post|put|patch|delete <url> [-d <body>] [-H <header>] [-v] [--pay]
|
|
97409
|
+
|
|
97410
|
+
Manage wallet spend limits:
|
|
97411
|
+
wallet spend
|
|
97412
|
+
wallet spend set-max <value>
|
|
97413
|
+
|
|
97414
|
+
<uri> = HTTP URL or CAIP-19 ID (e.g. eip155:8453/erc8004:0x…/1)
|
|
97415
|
+
Run "use-agently <command> -h" for full option details.`);
|
|
97407
97416
|
function enableGlobalOptionsInHelp(cmd) {
|
|
97408
97417
|
for (const sub of cmd.commands) {
|
|
97409
97418
|
sub.configureHelp({ showGlobalOptions: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "use-agently",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Use Agently CLI",
|
|
5
5
|
"homepage": "https://use-agently.com",
|
|
6
6
|
"bugs": "https://github.com/AgentlyHQ/use-agently/issues",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"test": "bun test"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@use-agently/sdk": "0.
|
|
27
|
+
"@use-agently/sdk": "0.30.0",
|
|
28
28
|
"boxen": "^8.0.1",
|
|
29
29
|
"cli-table3": "^0.6.5",
|
|
30
30
|
"commander": "^14.0.3",
|