use-agently 0.28.0 → 0.29.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 -17
- package/build/bin.js +18 -52
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -25,10 +25,13 @@ use-agently whoami
|
|
|
25
25
|
# Check your on-chain balance
|
|
26
26
|
use-agently balance
|
|
27
27
|
|
|
28
|
-
#
|
|
29
|
-
use-agently
|
|
28
|
+
# Browse available agents
|
|
29
|
+
use-agently search
|
|
30
|
+
|
|
31
|
+
# Search for agents by intent
|
|
32
|
+
use-agently search -q "echo"
|
|
30
33
|
|
|
31
|
-
# Send a message to an agent (use the URI from `use-agently
|
|
34
|
+
# Send a message to an agent (use the URI from `use-agently search`)
|
|
32
35
|
use-agently a2a send --uri <agent-uri> -m "Hello, agent!"
|
|
33
36
|
```
|
|
34
37
|
|
|
@@ -86,23 +89,15 @@ use-agently balance
|
|
|
86
89
|
use-agently balance --rpc https://mainnet.base.org
|
|
87
90
|
```
|
|
88
91
|
|
|
89
|
-
### `agents`
|
|
90
|
-
|
|
91
|
-
List available agents on Agently.
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
use-agently agents
|
|
95
|
-
```
|
|
96
|
-
|
|
97
92
|
### `search`
|
|
98
93
|
|
|
99
|
-
Search the Agently marketplace for agents, optionally filtering by query and/or protocol.
|
|
94
|
+
Search the Agently marketplace for agents, optionally filtering by query and/or protocol. Running without a query lists all available agents.
|
|
100
95
|
|
|
101
96
|
```bash
|
|
102
|
-
use-agently search
|
|
103
|
-
use-agently search "echo"
|
|
104
|
-
use-agently search --protocol a2a
|
|
105
|
-
use-agently search "assistant" --protocol "a2a,mcp"
|
|
97
|
+
use-agently search # Browse all agents
|
|
98
|
+
use-agently search -q "echo" # Search by intent
|
|
99
|
+
use-agently search --protocol a2a # Filter by protocol
|
|
100
|
+
use-agently search -q "assistant" --protocol "a2a,mcp" # Combine query and protocol filter
|
|
106
101
|
```
|
|
107
102
|
|
|
108
103
|
### `a2a`
|
|
@@ -147,7 +142,7 @@ use-agently web get https://paid-api.example.com/resource
|
|
|
147
142
|
## How It Works
|
|
148
143
|
|
|
149
144
|
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** — `
|
|
145
|
+
2. **Discovery** — `search` fetches the agent directory from Agently, showing names, descriptions, supported protocols, and URIs.
|
|
151
146
|
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
147
|
|
|
153
148
|
## 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.29.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: {
|
|
@@ -96502,7 +96502,7 @@ var balanceCommand = new Command("balance").description("Check wallet balance on
|
|
|
96502
96502
|
// package.json
|
|
96503
96503
|
var package_default2 = {
|
|
96504
96504
|
name: "use-agently",
|
|
96505
|
-
version: "0.
|
|
96505
|
+
version: "0.29.0",
|
|
96506
96506
|
description: "Use Agently CLI",
|
|
96507
96507
|
homepage: "https://use-agently.com",
|
|
96508
96508
|
bugs: "https://github.com/AgentlyHQ/use-agently/issues",
|
|
@@ -96526,7 +96526,7 @@ var package_default2 = {
|
|
|
96526
96526
|
test: "bun test"
|
|
96527
96527
|
},
|
|
96528
96528
|
dependencies: {
|
|
96529
|
-
"@use-agently/sdk": "0.
|
|
96529
|
+
"@use-agently/sdk": "0.29.0",
|
|
96530
96530
|
boxen: "^8.0.1",
|
|
96531
96531
|
"cli-table3": "^0.6.5",
|
|
96532
96532
|
commander: "^14.0.3",
|
|
@@ -96672,49 +96672,13 @@ function handleSpendLimitError(err) {
|
|
|
96672
96672
|
handleErrorAndExit("Spend Limit Exceeded", err.message, "red");
|
|
96673
96673
|
}
|
|
96674
96674
|
|
|
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
96675
|
// src/commands/search.ts
|
|
96676
|
+
var SUPPORTED_PROTOCOLS = ["a2a", "mcp"];
|
|
96677
|
+
function getHealthyProtocols(protocol) {
|
|
96678
|
+
if (!protocol)
|
|
96679
|
+
return [];
|
|
96680
|
+
return SUPPORTED_PROTOCOLS.filter((name) => protocol[name]?.healthy === true);
|
|
96681
|
+
}
|
|
96718
96682
|
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
96683
|
"",
|
|
96720
96684
|
"Examples:",
|
|
@@ -96734,18 +96698,21 @@ var searchCommand = new Command("search").description("Search the Agently market
|
|
|
96734
96698
|
const format = getOutputFormat(command);
|
|
96735
96699
|
const protocol = options.protocol ? options.protocol.split(",").map((p) => p.trim().toLowerCase()) : undefined;
|
|
96736
96700
|
const result = await search(defaultClient, { q: options.query, protocol });
|
|
96737
|
-
const items = result.hits.map((
|
|
96701
|
+
const items = result.hits.map((hit) => {
|
|
96702
|
+
const protocols = getHealthyProtocols(hit.protocol);
|
|
96703
|
+
return { id: hit.id, name: hit.name, description: hit.description, protocols };
|
|
96704
|
+
}).filter((item) => item.protocols.length > 0);
|
|
96738
96705
|
if (items.length === 0) {
|
|
96739
96706
|
outputNoResults(format);
|
|
96740
96707
|
return;
|
|
96741
96708
|
}
|
|
96742
96709
|
if (format === "tui") {
|
|
96743
|
-
|
|
96710
|
+
renderAgentsTable(items);
|
|
96744
96711
|
} else {
|
|
96745
96712
|
outputJsonCollection(items);
|
|
96746
96713
|
}
|
|
96747
96714
|
});
|
|
96748
|
-
function
|
|
96715
|
+
function formatId(id) {
|
|
96749
96716
|
const match = id.match(/^(.*?\/erc8004:)(0x[0-9a-fA-F]+)(\/\d+)$/);
|
|
96750
96717
|
if (match)
|
|
96751
96718
|
return `${match[1]}
|
|
@@ -96753,9 +96720,9 @@ ${match[2]}
|
|
|
96753
96720
|
${match[3]}`;
|
|
96754
96721
|
return id;
|
|
96755
96722
|
}
|
|
96756
|
-
function
|
|
96723
|
+
function renderAgentsTable(items) {
|
|
96757
96724
|
const maxWidth = getMaxWidth();
|
|
96758
|
-
const idSegmentWidth = Math.max(...items.flatMap((item) =>
|
|
96725
|
+
const idSegmentWidth = Math.max(...items.flatMap((item) => formatId(item.id).split(`
|
|
96759
96726
|
`).map((line) => line.length))) + 2;
|
|
96760
96727
|
const protoWidth = 12;
|
|
96761
96728
|
const nameDescWidth = maxWidth - idSegmentWidth - protoWidth - 10;
|
|
@@ -96766,7 +96733,7 @@ function renderAgentsTable2(items) {
|
|
|
96766
96733
|
head: ["id", "agent (name & description)", "protocols"]
|
|
96767
96734
|
});
|
|
96768
96735
|
for (const item of items) {
|
|
96769
|
-
table.push([
|
|
96736
|
+
table.push([formatId(item.id), `${boldBlue(item.name)}
|
|
96770
96737
|
${item.description}`, (item.protocols ?? []).join(", ")]);
|
|
96771
96738
|
}
|
|
96772
96739
|
console.log(table.toString());
|
|
@@ -97395,7 +97362,6 @@ cli.name("use-agently").description("Agently is the way AI coordinate and transa
|
|
|
97395
97362
|
cli.addCommand(doctorCommand.helpGroup("Diagnostics"));
|
|
97396
97363
|
cli.addCommand(whoamiCommand.helpGroup("Diagnostics"));
|
|
97397
97364
|
cli.addCommand(balanceCommand.helpGroup("Diagnostics"));
|
|
97398
|
-
cli.addCommand(agentsCommand.helpGroup("Discovery"));
|
|
97399
97365
|
cli.addCommand(searchCommand.helpGroup("Discovery"));
|
|
97400
97366
|
cli.addCommand(viewCommand.helpGroup("Discovery"));
|
|
97401
97367
|
cli.addCommand(a2aCommand.helpGroup("Protocols"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "use-agently",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.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.29.0",
|
|
28
28
|
"boxen": "^8.0.1",
|
|
29
29
|
"cli-table3": "^0.6.5",
|
|
30
30
|
"commander": "^14.0.3",
|